diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..1cc0d8d6b2d --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,8 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "internal/protocoltest/smithyrpcv2cbor" + ] +} \ No newline at end of file diff --git a/.changelog/68407b7ce0d8493f83c684f2455da645.json b/.changelog/68407b7ce0d8493f83c684f2455da645.json new file mode 100644 index 00000000000..f474f1f7030 --- /dev/null +++ b/.changelog/68407b7ce0d8493f83c684f2455da645.json @@ -0,0 +1,8 @@ +{ + "id": "68407b7c-e0d8-493f-83c6-84f2455da645", + "type": "feature", + "description": "This release includes a new API for retrieving the public endorsement key of the EC2 instance's Nitro Trusted Platform Module (NitroTPM).", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/6f1d6afdd81f4306842b4c52ab31b433.json b/.changelog/6f1d6afdd81f4306842b4c52ab31b433.json new file mode 100644 index 00000000000..10411049977 --- /dev/null +++ b/.changelog/6f1d6afdd81f4306842b4c52ab31b433.json @@ -0,0 +1,8 @@ +{ + "id": "6f1d6afd-d81f-4306-842b-4c52ab31b433", + "type": "feature", + "description": "This releases ability to delete users and their data, including their metadata and interactions data, from a dataset group.", + "modules": [ + "service/personalize" + ] +} \ No newline at end of file diff --git a/.changelog/8451816999404ed689955b51de3ba88c.json b/.changelog/8451816999404ed689955b51de3ba88c.json new file mode 100644 index 00000000000..c9376370c01 --- /dev/null +++ b/.changelog/8451816999404ed689955b51de3ba88c.json @@ -0,0 +1,8 @@ +{ + "id": "84518169-9940-4ed6-8995-5b51de3ba88c", + "type": "feature", + "description": "Update Redshift Serverless List Scheduled Actions Output Response to include Namespace Name.", + "modules": [ + "service/redshiftserverless" + ] +} \ No newline at end of file diff --git a/.changelog/adf9c7dcd48a43f4adbc0567d294b5dc.json b/.changelog/adf9c7dcd48a43f4adbc0567d294b5dc.json new file mode 100644 index 00000000000..716ce7f52ef --- /dev/null +++ b/.changelog/adf9c7dcd48a43f4adbc0567d294b5dc.json @@ -0,0 +1,8 @@ +{ + "id": "adf9c7dc-d48a-43f4-adbc-0567d294b5dc", + "type": "feature", + "description": "This release adds support to specify an optional, maximum OnDemandThroughput for DynamoDB tables and global secondary indexes in the CreateTable or UpdateTable APIs. You can also override the OnDemandThroughput settings by calling the ImportTable, RestoreFromPointInTime, or RestoreFromBackup APIs.", + "modules": [ + "service/dynamodb" + ] +} \ No newline at end of file diff --git a/service/dynamodb/api_op_CreateTable.go b/service/dynamodb/api_op_CreateTable.go index 92975ec6d3a..19f9a7aa962 100644 --- a/service/dynamodb/api_op_CreateTable.go +++ b/service/dynamodb/api_op_CreateTable.go @@ -140,6 +140,11 @@ type CreateTableInput struct { // as two distinct attributes when determining the total. LocalSecondaryIndexes []types.LocalSecondaryIndex + // Sets the maximum number of read and write units for the specified table in + // on-demand capacity mode. If you use this parameter, you must specify + // MaxReadRequestUnits , MaxWriteRequestUnits , or both. + OnDemandThroughput *types.OnDemandThroughput + // Represents the provisioned throughput settings for a specified table or index. // The settings can be modified using the UpdateTable operation. If you set // BillingMode as PROVISIONED , you must specify this property. If you set @@ -151,12 +156,11 @@ type CreateTableInput struct { // An Amazon Web Services resource-based policy document in JSON format that will // be attached to the table. When you attach a resource-based policy while creating - // a table, the policy creation is strongly consistent. The maximum size supported - // for a resource-based policy document is 20 KB. DynamoDB counts whitespaces when - // calculating the size of a policy against this limit. You can’t request an - // increase for this limit. For a full list of all considerations that you should - // keep in mind while attaching a resource-based policy, see Resource-based policy - // considerations (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html) + // a table, the policy application is strongly consistent. The maximum size + // supported for a resource-based policy document is 20 KB. DynamoDB counts + // whitespaces when calculating the size of a policy against this limit. For a full + // list of all considerations that apply for resource-based policies, see + // Resource-based policy considerations (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html) // . ResourcePolicy *string diff --git a/service/dynamodb/api_op_DeleteResourcePolicy.go b/service/dynamodb/api_op_DeleteResourcePolicy.go index cd6720b0861..05247546fc6 100644 --- a/service/dynamodb/api_op_DeleteResourcePolicy.go +++ b/service/dynamodb/api_op_DeleteResourcePolicy.go @@ -61,7 +61,7 @@ type DeleteResourcePolicyInput struct { type DeleteResourcePolicyOutput struct { - // A unique string that represents the revision ID of the policy. If you are + // A unique string that represents the revision ID of the policy. If you're // comparing revision IDs, make sure to always use string comparison logic. This // value will be empty if you make a request against a resource without a policy. RevisionId *string diff --git a/service/dynamodb/api_op_GetResourcePolicy.go b/service/dynamodb/api_op_GetResourcePolicy.go index baadeb90f2e..02ce13977ee 100644 --- a/service/dynamodb/api_op_GetResourcePolicy.go +++ b/service/dynamodb/api_op_GetResourcePolicy.go @@ -28,12 +28,12 @@ import ( // Because GetResourcePolicy uses an eventually consistent query, the metadata for // your policy or table might not be available at that moment. Wait for a few // seconds, and then retry the GetResourcePolicy request. After a GetResourcePolicy -// request returns a policy created using the PutResourcePolicy request, you can -// assume the policy will start getting applied in the authorization of requests to -// the resource. Because this process is eventually consistent, it will take some -// time to apply the policy to all requests to a resource. Policies that you attach -// while creating a table using the CreateTable request will always be applied to -// all requests for that table. +// request returns a policy created using the PutResourcePolicy request, the +// policy will be applied in the authorization of requests to the resource. Because +// this process is eventually consistent, it will take some time to apply the +// policy to all requests to a resource. Policies that you attach while creating a +// table using the CreateTable request will always be applied to all requests for +// that table. func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { if params == nil { params = &GetResourcePolicyInput{} @@ -66,7 +66,7 @@ type GetResourcePolicyOutput struct { // table or stream, in JSON format. Policy *string - // A unique string that represents the revision ID of the policy. If you are + // A unique string that represents the revision ID of the policy. If you're // comparing revision IDs, make sure to always use string comparison logic. RevisionId *string diff --git a/service/dynamodb/api_op_PutResourcePolicy.go b/service/dynamodb/api_op_PutResourcePolicy.go index 064a2682052..5d3e3b13933 100644 --- a/service/dynamodb/api_op_PutResourcePolicy.go +++ b/service/dynamodb/api_op_PutResourcePolicy.go @@ -16,7 +16,7 @@ import ( // application is eventually consistent (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html) // . PutResourcePolicy is an idempotent operation; running it multiple times on // the same resource using the same policy document will return the same revision -// ID. If you specify an ExpectedRevisionId which doesn't match the current +// ID. If you specify an ExpectedRevisionId that doesn't match the current // policy's RevisionId , the PolicyNotFoundException will be returned. // PutResourcePolicy is an asynchronous operation. If you issue a GetResourcePolicy // request immediately after a PutResourcePolicy request, DynamoDB might return @@ -41,10 +41,14 @@ func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolic type PutResourcePolicyInput struct { - // An Amazon Web Services resource-based policy document in JSON format. The - // maximum size supported for a resource-based policy document is 20 KB. DynamoDB - // counts whitespaces when calculating the size of a policy against this limit. For - // a full list of all considerations that you should keep in mind while attaching a + // An Amazon Web Services resource-based policy document in JSON format. + // - The maximum size supported for a resource-based policy document is 20 KB. + // DynamoDB counts whitespaces when calculating the size of a policy against this + // limit. + // - Within a resource-based policy, if the action for a DynamoDB service-linked + // role (SLR) to replicate data for a global table is denied, adding or deleting a + // replica will fail with an error. + // For a full list of all considerations that apply while attaching a // resource-based policy, see Resource-based policy considerations (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html) // . // @@ -72,7 +76,7 @@ type PutResourcePolicyInput struct { // against that policy. When you provide an expected revision ID, if the revision // ID of the existing policy on the resource doesn't match or if there's no policy // attached to the resource, your request will be rejected with a - // PolicyNotFoundException . To conditionally put a policy when no policy exists + // PolicyNotFoundException . To conditionally attach a policy when no policy exists // for the resource, specify NO_POLICY for the revision ID. ExpectedRevisionId *string @@ -81,7 +85,7 @@ type PutResourcePolicyInput struct { type PutResourcePolicyOutput struct { - // A unique string that represents the revision ID of the policy. If you are + // A unique string that represents the revision ID of the policy. If you're // comparing revision IDs, make sure to always use string comparison logic. RevisionId *string diff --git a/service/dynamodb/api_op_RestoreTableFromBackup.go b/service/dynamodb/api_op_RestoreTableFromBackup.go index 0bba0c74de6..28825e2c18a 100644 --- a/service/dynamodb/api_op_RestoreTableFromBackup.go +++ b/service/dynamodb/api_op_RestoreTableFromBackup.go @@ -62,6 +62,11 @@ type RestoreTableFromBackupInput struct { // of the indexes at the time of restore. LocalSecondaryIndexOverride []types.LocalSecondaryIndex + // Sets the maximum number of read and write units for the specified on-demand + // table. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughputOverride *types.OnDemandThroughput + // Provisioned throughput settings for the restored table. ProvisionedThroughputOverride *types.ProvisionedThroughput diff --git a/service/dynamodb/api_op_RestoreTableToPointInTime.go b/service/dynamodb/api_op_RestoreTableToPointInTime.go index 9049d3d3a14..2a9ff40db56 100644 --- a/service/dynamodb/api_op_RestoreTableToPointInTime.go +++ b/service/dynamodb/api_op_RestoreTableToPointInTime.go @@ -70,6 +70,11 @@ type RestoreTableToPointInTimeInput struct { // of the indexes at the time of restore. LocalSecondaryIndexOverride []types.LocalSecondaryIndex + // Sets the maximum number of read and write units for the specified on-demand + // table. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughputOverride *types.OnDemandThroughput + // Provisioned throughput settings for the restored table. ProvisionedThroughputOverride *types.ProvisionedThroughput diff --git a/service/dynamodb/api_op_UpdateTable.go b/service/dynamodb/api_op_UpdateTable.go index a51de71d5a2..fe97db50f94 100644 --- a/service/dynamodb/api_op_UpdateTable.go +++ b/service/dynamodb/api_op_UpdateTable.go @@ -82,6 +82,11 @@ type UpdateTableInput struct { // in the Amazon DynamoDB Developer Guide. GlobalSecondaryIndexUpdates []types.GlobalSecondaryIndexUpdate + // Updates the maximum number of read and write units for the specified table in + // on-demand capacity mode. If you use this parameter, you must specify + // MaxReadRequestUnits , MaxWriteRequestUnits , or both. + OnDemandThroughput *types.OnDemandThroughput + // The new provisioned throughput settings for the specified table or index. ProvisionedThroughput *types.ProvisionedThroughput diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index be3f239b434..3bbd7230bd7 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -10628,6 +10628,11 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndex(v **types.GlobalSecond return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "Projection": if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil { return err @@ -10736,6 +10741,11 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(v **types.G return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "Projection": if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil { return err @@ -10859,6 +10869,11 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexInfo(v **types.GlobalSe return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "Projection": if err := awsAwsjson10_deserializeDocumentProjection(&sv.Projection, value); err != nil { return err @@ -12986,6 +13001,107 @@ func awsAwsjson10_deserializeDocumentNumberSetAttributeValue(v *[]string, value return nil } +func awsAwsjson10_deserializeDocumentOnDemandThroughput(v **types.OnDemandThroughput, 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.OnDemandThroughput + if *v == nil { + sv = &types.OnDemandThroughput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MaxReadRequestUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxReadRequestUnits = ptr.Int64(i64) + } + + case "MaxWriteRequestUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxWriteRequestUnits = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(v **types.OnDemandThroughputOverride, 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.OnDemandThroughputOverride + if *v == nil { + sv = &types.OnDemandThroughputOverride{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MaxReadRequestUnits": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongObject to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxReadRequestUnits = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentPartiQLBatchResponse(v *[]types.BatchStatementResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13744,6 +13860,11 @@ func awsAwsjson10_deserializeDocumentReplicaDescription(v **types.ReplicaDescrip sv.KMSMasterKeyId = ptr.String(jtv) } + case "OnDemandThroughputOverride": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(&sv.OnDemandThroughputOverride, value); err != nil { + return err + } + case "ProvisionedThroughputOverride": if err := awsAwsjson10_deserializeDocumentProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { return err @@ -13973,6 +14094,11 @@ func awsAwsjson10_deserializeDocumentReplicaGlobalSecondaryIndexDescription(v ** sv.IndexName = ptr.String(jtv) } + case "OnDemandThroughputOverride": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughputOverride(&sv.OnDemandThroughputOverride, value); err != nil { + return err + } + case "ProvisionedThroughputOverride": if err := awsAwsjson10_deserializeDocumentProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { return err @@ -14684,6 +14810,11 @@ func awsAwsjson10_deserializeDocumentSourceTableDetails(v **types.SourceTableDet return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "ProvisionedThroughput": if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err @@ -15223,6 +15354,11 @@ func awsAwsjson10_deserializeDocumentTableCreationParameters(v **types.TableCrea return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "ProvisionedThroughput": if err := awsAwsjson10_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err @@ -15368,6 +15504,11 @@ func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription return err } + case "OnDemandThroughput": + if err := awsAwsjson10_deserializeDocumentOnDemandThroughput(&sv.OnDemandThroughput, value); err != nil { + return err + } + case "ProvisionedThroughput": if err := awsAwsjson10_deserializeDocumentProvisionedThroughputDescription(&sv.ProvisionedThroughput, value); err != nil { return err diff --git a/service/dynamodb/serializers.go b/service/dynamodb/serializers.go index 0a5c1e813c9..eb9d1999bec 100644 --- a/service/dynamodb/serializers.go +++ b/service/dynamodb/serializers.go @@ -3547,6 +3547,13 @@ func awsAwsjson10_serializeDocumentCreateGlobalSecondaryIndexAction(v *types.Cre } } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.Projection != nil { ok := object.Key("Projection") if err := awsAwsjson10_serializeDocumentProjection(v.Projection, ok); err != nil { @@ -3592,6 +3599,13 @@ func awsAwsjson10_serializeDocumentCreateReplicationGroupMemberAction(v *types.C ok.String(*v.KMSMasterKeyId) } + if v.OnDemandThroughputOverride != nil { + ok := object.Key("OnDemandThroughputOverride") + if err := awsAwsjson10_serializeDocumentOnDemandThroughputOverride(v.OnDemandThroughputOverride, ok); err != nil { + return err + } + } + if v.ProvisionedThroughputOverride != nil { ok := object.Key("ProvisionedThroughputOverride") if err := awsAwsjson10_serializeDocumentProvisionedThroughputOverride(v.ProvisionedThroughputOverride, ok); err != nil { @@ -3880,6 +3894,13 @@ func awsAwsjson10_serializeDocumentGlobalSecondaryIndex(v *types.GlobalSecondary } } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.Projection != nil { ok := object.Key("Projection") if err := awsAwsjson10_serializeDocumentProjection(v.Projection, ok); err != nil { @@ -4263,6 +4284,35 @@ func awsAwsjson10_serializeDocumentNumberSetAttributeValue(v []string, value smi return nil } +func awsAwsjson10_serializeDocumentOnDemandThroughput(v *types.OnDemandThroughput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxReadRequestUnits != nil { + ok := object.Key("MaxReadRequestUnits") + ok.Long(*v.MaxReadRequestUnits) + } + + if v.MaxWriteRequestUnits != nil { + ok := object.Key("MaxWriteRequestUnits") + ok.Long(*v.MaxWriteRequestUnits) + } + + return nil +} + +func awsAwsjson10_serializeDocumentOnDemandThroughputOverride(v *types.OnDemandThroughputOverride, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxReadRequestUnits != nil { + ok := object.Key("MaxReadRequestUnits") + ok.Long(*v.MaxReadRequestUnits) + } + + return nil +} + func awsAwsjson10_serializeDocumentParameterizedStatement(v *types.ParameterizedStatement, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4522,6 +4572,13 @@ func awsAwsjson10_serializeDocumentReplicaGlobalSecondaryIndex(v *types.ReplicaG ok.String(*v.IndexName) } + if v.OnDemandThroughputOverride != nil { + ok := object.Key("OnDemandThroughputOverride") + if err := awsAwsjson10_serializeDocumentOnDemandThroughputOverride(v.OnDemandThroughputOverride, ok); err != nil { + return err + } + } + if v.ProvisionedThroughputOverride != nil { ok := object.Key("ProvisionedThroughputOverride") if err := awsAwsjson10_serializeDocumentProvisionedThroughputOverride(v.ProvisionedThroughputOverride, ok); err != nil { @@ -4853,6 +4910,13 @@ func awsAwsjson10_serializeDocumentTableCreationParameters(v *types.TableCreatio } } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.ProvisionedThroughput != nil { ok := object.Key("ProvisionedThroughput") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { @@ -5065,6 +5129,13 @@ func awsAwsjson10_serializeDocumentUpdateGlobalSecondaryIndexAction(v *types.Upd ok.String(*v.IndexName) } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.ProvisionedThroughput != nil { ok := object.Key("ProvisionedThroughput") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { @@ -5103,6 +5174,13 @@ func awsAwsjson10_serializeDocumentUpdateReplicationGroupMemberAction(v *types.U ok.String(*v.KMSMasterKeyId) } + if v.OnDemandThroughputOverride != nil { + ok := object.Key("OnDemandThroughputOverride") + if err := awsAwsjson10_serializeDocumentOnDemandThroughputOverride(v.OnDemandThroughputOverride, ok); err != nil { + return err + } + } + if v.ProvisionedThroughputOverride != nil { ok := object.Key("ProvisionedThroughputOverride") if err := awsAwsjson10_serializeDocumentProvisionedThroughputOverride(v.ProvisionedThroughputOverride, ok); err != nil { @@ -5297,6 +5375,13 @@ func awsAwsjson10_serializeOpDocumentCreateTableInput(v *CreateTableInput, value } } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.ProvisionedThroughput != nil { ok := object.Key("ProvisionedThroughput") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { @@ -6276,6 +6361,13 @@ func awsAwsjson10_serializeOpDocumentRestoreTableFromBackupInput(v *RestoreTable } } + if v.OnDemandThroughputOverride != nil { + ok := object.Key("OnDemandThroughputOverride") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughputOverride, ok); err != nil { + return err + } + } + if v.ProvisionedThroughputOverride != nil { ok := object.Key("ProvisionedThroughputOverride") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughputOverride, ok); err != nil { @@ -6321,6 +6413,13 @@ func awsAwsjson10_serializeOpDocumentRestoreTableToPointInTimeInput(v *RestoreTa } } + if v.OnDemandThroughputOverride != nil { + ok := object.Key("OnDemandThroughputOverride") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughputOverride, ok); err != nil { + return err + } + } + if v.ProvisionedThroughputOverride != nil { ok := object.Key("ProvisionedThroughputOverride") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughputOverride, ok); err != nil { @@ -6783,6 +6882,13 @@ func awsAwsjson10_serializeOpDocumentUpdateTableInput(v *UpdateTableInput, value } } + if v.OnDemandThroughput != nil { + ok := object.Key("OnDemandThroughput") + if err := awsAwsjson10_serializeDocumentOnDemandThroughput(v.OnDemandThroughput, ok); err != nil { + return err + } + } + if v.ProvisionedThroughput != nil { ok := object.Key("ProvisionedThroughput") if err := awsAwsjson10_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index 437acc5dae9..9fc2ed1a2b0 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -838,6 +838,11 @@ type CreateGlobalSecondaryIndexAction struct { // This member is required. Projection *Projection + // The maximum number of read and write units for the global secondary index being + // created. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents the provisioned throughput settings for the specified global // secondary index. For current minimum and maximum provisioned throughput values, // see Service, Account, and Table Quotas (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) @@ -875,6 +880,11 @@ type CreateReplicationGroupMemberAction struct { // from the default DynamoDB KMS key alias/aws/dynamodb . KMSMasterKeyId *string + // The maximum on-demand throughput settings for the specified replica table being + // created. You can only modify MaxReadRequestUnits , because you can't modify + // MaxWriteRequestUnits for individual replica tables. + OnDemandThroughputOverride *OnDemandThroughputOverride + // Replica-specific provisioned throughput. If not specified, uses the source // table's provisioned throughput settings. ProvisionedThroughputOverride *ProvisionedThroughputOverride @@ -1324,6 +1334,11 @@ type GlobalSecondaryIndex struct { // This member is required. Projection *Projection + // The maximum number of read and write units for the specified global secondary + // index. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents the provisioned throughput settings for the specified global // secondary index. For current minimum and maximum provisioned throughput values, // see Service, Account, and Table Quotas (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) @@ -1398,6 +1413,11 @@ type GlobalSecondaryIndexDescription struct { // partition key physically close together, in sorted order by the sort key value. KeySchema []KeySchemaElement + // The maximum number of read and write units for the specified global secondary + // index. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents attributes that are copied (projected) from the table into the // global secondary index. These are in addition to the primary key attributes and // index key attributes, which are automatically projected. @@ -1431,6 +1451,11 @@ type GlobalSecondaryIndexInfo struct { // partition key physically close together, in sorted order by the sort key value. KeySchema []KeySchemaElement + // Sets the maximum number of read and write units for the specified on-demand + // table. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents attributes that are copied (projected) from the table into the // global secondary index. These are in addition to the primary key attributes and // index key attributes, which are automatically projected. @@ -1905,6 +1930,37 @@ type LocalSecondaryIndexInfo struct { noSmithyDocumentSerde } +// Sets the maximum number of read and write units for the specified on-demand +// table. If you use this parameter, you must specify MaxReadRequestUnits , +// MaxWriteRequestUnits , or both. +type OnDemandThroughput struct { + + // Maximum number of read request units for the specified table. To specify a + // maximum OnDemandThroughput on your table, set the value of MaxReadRequestUnits + // as greater than or equal to 1. To remove the maximum OnDemandThroughput that is + // currently set on your table, set the value of MaxReadRequestUnits to -1. + MaxReadRequestUnits *int64 + + // Maximum number of write request units for the specified table. To specify a + // maximum OnDemandThroughput on your table, set the value of MaxWriteRequestUnits + // as greater than or equal to 1. To remove the maximum OnDemandThroughput that is + // currently set on your table, set the value of MaxWriteRequestUnits to -1. + MaxWriteRequestUnits *int64 + + noSmithyDocumentSerde +} + +// Overrides the on-demand throughput settings for this replica table. If you +// don't specify a value for this parameter, it uses the source table's on-demand +// throughput settings. +type OnDemandThroughputOverride struct { + + // Maximum number of read request units for the specified replica table. + MaxReadRequestUnits *int64 + + noSmithyDocumentSerde +} + // Represents a PartiQL statement that uses parameters. type ParameterizedStatement struct { @@ -2161,6 +2217,10 @@ type ReplicaDescription struct { // The KMS key of the replica that will be used for KMS encryption. KMSMasterKeyId *string + // Overrides the maximum on-demand throughput settings for the specified replica + // table. + OnDemandThroughputOverride *OnDemandThroughputOverride + // Replica-specific provisioned throughput. If not described, uses the source // table's provisioned throughput settings. ProvisionedThroughputOverride *ProvisionedThroughputOverride @@ -2209,6 +2269,10 @@ type ReplicaGlobalSecondaryIndex struct { // This member is required. IndexName *string + // Overrides the maximum on-demand throughput settings for the specified global + // secondary index in the specified replica table. + OnDemandThroughputOverride *OnDemandThroughputOverride + // Replica table GSI-specific provisioned throughput. If not specified, uses the // source table GSI's read capacity settings. ProvisionedThroughputOverride *ProvisionedThroughputOverride @@ -2261,6 +2325,10 @@ type ReplicaGlobalSecondaryIndexDescription struct { // The name of the global secondary index. IndexName *string + // Overrides the maximum on-demand throughput for the specified global secondary + // index in the specified replica table. + OnDemandThroughputOverride *OnDemandThroughputOverride + // If not described, uses the source table GSI's read capacity settings. ProvisionedThroughputOverride *ProvisionedThroughputOverride @@ -2516,6 +2584,11 @@ type SourceTableDetails struct { // Number of items in the table. Note that this is an approximate value. ItemCount *int64 + // Sets the maximum number of read and write units for the specified on-demand + // table. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // ARN of the table for which backup was created. TableArn *string @@ -2687,6 +2760,11 @@ type TableCreationParameters struct { // import operation. GlobalSecondaryIndexes []GlobalSecondaryIndex + // Sets the maximum number of read and write units for the specified on-demand + // table. If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents the provisioned throughput settings for a specified table or index. // The settings can be modified using the UpdateTable operation. For current // minimum and maximum provisioned throughput values, see Service, Account, and @@ -2841,6 +2919,11 @@ type TableDescription struct { // returned. LocalSecondaryIndexes []LocalSecondaryIndexDescription + // The maximum number of read and write units for the specified on-demand table. + // If you use this parameter, you must specify MaxReadRequestUnits , + // MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // The provisioned throughput settings for the table, consisting of read and write // capacity units, along with data about increases and decreases. ProvisionedThroughput *ProvisionedThroughputDescription @@ -3027,12 +3110,15 @@ type UpdateGlobalSecondaryIndexAction struct { // This member is required. IndexName *string + // Updates the maximum number of read and write units for the specified global + // secondary index. If you use this parameter, you must specify MaxReadRequestUnits + // , MaxWriteRequestUnits , or both. + OnDemandThroughput *OnDemandThroughput + // Represents the provisioned throughput settings for the specified global // secondary index. For current minimum and maximum provisioned throughput values, // see Service, Account, and Table Quotas (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) // in the Amazon DynamoDB Developer Guide. - // - // This member is required. ProvisionedThroughput *ProvisionedThroughput noSmithyDocumentSerde @@ -3064,6 +3150,9 @@ type UpdateReplicationGroupMemberAction struct { // default DynamoDB KMS key alias/aws/dynamodb . KMSMasterKeyId *string + // Overrides the maximum on-demand throughput for the replica table. + OnDemandThroughputOverride *OnDemandThroughputOverride + // Replica-specific provisioned throughput. If not specified, uses the source // table's provisioned throughput settings. ProvisionedThroughputOverride *ProvisionedThroughputOverride diff --git a/service/dynamodb/validators.go b/service/dynamodb/validators.go index d1925ed8b4b..3d7f72cbefb 100644 --- a/service/dynamodb/validators.go +++ b/service/dynamodb/validators.go @@ -2430,9 +2430,7 @@ func validateUpdateGlobalSecondaryIndexAction(v *types.UpdateGlobalSecondaryInde if v.IndexName == nil { invalidParams.Add(smithy.NewErrParamRequired("IndexName")) } - if v.ProvisionedThroughput == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProvisionedThroughput")) - } else if v.ProvisionedThroughput != nil { + if v.ProvisionedThroughput != nil { if err := validateProvisionedThroughput(v.ProvisionedThroughput); err != nil { invalidParams.AddNested("ProvisionedThroughput", err.(smithy.InvalidParamsError)) } diff --git a/service/ec2/api_op_GetInstanceTpmEkPub.go b/service/ec2/api_op_GetInstanceTpmEkPub.go new file mode 100644 index 00000000000..c23d440d2c4 --- /dev/null +++ b/service/ec2/api_op_GetInstanceTpmEkPub.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the public endorsement key associated with the Nitro Trusted Platform +// Module (NitroTPM) for the specified instance. +func (c *Client) GetInstanceTpmEkPub(ctx context.Context, params *GetInstanceTpmEkPubInput, optFns ...func(*Options)) (*GetInstanceTpmEkPubOutput, error) { + if params == nil { + params = &GetInstanceTpmEkPubInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetInstanceTpmEkPub", params, optFns, c.addOperationGetInstanceTpmEkPubMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetInstanceTpmEkPubOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetInstanceTpmEkPubInput struct { + + // The ID of the instance for which to get the public endorsement key. + // + // This member is required. + InstanceId *string + + // The required public endorsement key format. Specify der for a DER-encoded + // public key that is compatible with OpenSSL. Specify tpmt for a TPM 2.0 format + // that is compatible with tpm2-tools. The returned key is base64 encoded. + // + // This member is required. + KeyFormat types.EkPubKeyFormat + + // The required public endorsement key type. + // + // This member is required. + KeyType types.EkPubKeyType + + // Specify this parameter to verify whether the request will succeed, without + // actually making the request. If the request will succeed, the response is + // DryRunOperation . Otherwise, the response is UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type GetInstanceTpmEkPubOutput struct { + + // The ID of the instance. + InstanceId *string + + // The public endorsement key format. + KeyFormat types.EkPubKeyFormat + + // The public endorsement key type. + KeyType types.EkPubKeyType + + // The public endorsement key material. + KeyValue *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetInstanceTpmEkPubMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpGetInstanceTpmEkPub{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetInstanceTpmEkPub{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetInstanceTpmEkPub"); err != nil { + return fmt.Errorf("add 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 = 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 = addOpGetInstanceTpmEkPubValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstanceTpmEkPub(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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetInstanceTpmEkPub(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetInstanceTpmEkPub", + } +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 8082383d738..5f8493e2559 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -39532,6 +39532,97 @@ func awsEc2query_deserializeOpErrorGetInstanceMetadataDefaults(response *smithyh } } +type awsEc2query_deserializeOpGetInstanceTpmEkPub struct { +} + +func (*awsEc2query_deserializeOpGetInstanceTpmEkPub) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpGetInstanceTpmEkPub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(response, &metadata) + } + output := &GetInstanceTpmEkPubOutput{} + 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 = awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(&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 awsEc2query_deserializeOpErrorGetInstanceTpmEkPub(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 := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + 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 awsEc2query_deserializeOpGetInstanceTypesFromInstanceRequirements struct { } @@ -161700,6 +161791,94 @@ func awsEc2query_deserializeOpDocumentGetInstanceMetadataDefaultsOutput(v **GetI return nil } +func awsEc2query_deserializeOpDocumentGetInstanceTpmEkPubOutput(v **GetInstanceTpmEkPubOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetInstanceTpmEkPubOutput + if *v == nil { + sv = &GetInstanceTpmEkPubOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("instanceId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceId = ptr.String(xtv) + } + + case strings.EqualFold("keyFormat", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KeyFormat = types.EkPubKeyFormat(xtv) + } + + case strings.EqualFold("keyType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KeyType = types.EkPubKeyType(xtv) + } + + case strings.EqualFold("keyValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KeyValue = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentGetInstanceTypesFromInstanceRequirementsOutput(v **GetInstanceTypesFromInstanceRequirementsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index a5a88e1437c..a82c0ca18cc 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -455,6 +455,7 @@ "api_op_GetHostReservationPurchasePreview.go", "api_op_GetImageBlockPublicAccessState.go", "api_op_GetInstanceMetadataDefaults.go", + "api_op_GetInstanceTpmEkPub.go", "api_op_GetInstanceTypesFromInstanceRequirements.go", "api_op_GetInstanceUefiData.go", "api_op_GetIpamAddressHistory.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 2f67c2edad1..923775f027f 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -28369,6 +28369,70 @@ func (m *awsEc2query_serializeOpGetInstanceMetadataDefaults) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpGetInstanceTpmEkPub struct { +} + +func (*awsEc2query_serializeOpGetInstanceTpmEkPub) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpGetInstanceTpmEkPub) 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, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetInstanceTpmEkPubInput) + _ = 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("GetInstanceTpmEkPub") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentGetInstanceTpmEkPubInput(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 + + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpGetInstanceTypesFromInstanceRequirements struct { } @@ -62441,6 +62505,33 @@ func awsEc2query_serializeOpDocumentGetInstanceMetadataDefaultsInput(v *GetInsta return nil } +func awsEc2query_serializeOpDocumentGetInstanceTpmEkPubInput(v *GetInstanceTpmEkPubInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.InstanceId != nil { + objectKey := object.Key("InstanceId") + objectKey.String(*v.InstanceId) + } + + if len(v.KeyFormat) > 0 { + objectKey := object.Key("KeyFormat") + objectKey.String(string(v.KeyFormat)) + } + + if len(v.KeyType) > 0 { + objectKey := object.Key("KeyType") + objectKey.String(string(v.KeyType)) + } + + return nil +} + func awsEc2query_serializeOpDocumentGetInstanceTypesFromInstanceRequirementsInput(v *GetInstanceTypesFromInstanceRequirementsInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/snapshot_test.go b/service/ec2/snapshot_test.go index 036657b3f28..9f4aa4f7f95 100644 --- a/service/ec2/snapshot_test.go +++ b/service/ec2/snapshot_test.go @@ -5378,6 +5378,18 @@ func TestCheckSnapshot_GetInstanceMetadataDefaults(t *testing.T) { } } +func TestCheckSnapshot_GetInstanceTpmEkPub(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetInstanceTpmEkPub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetInstanceTpmEkPub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetInstanceTypesFromInstanceRequirements(t *testing.T) { svc := New(Options{}) _, err := svc.GetInstanceTypesFromInstanceRequirements(context.Background(), nil, func(o *Options) { @@ -12817,6 +12829,18 @@ func TestUpdateSnapshot_GetInstanceMetadataDefaults(t *testing.T) { } } +func TestUpdateSnapshot_GetInstanceTpmEkPub(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetInstanceTpmEkPub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetInstanceTpmEkPub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetInstanceTypesFromInstanceRequirements(t *testing.T) { svc := New(Options{}) _, err := svc.GetInstanceTypesFromInstanceRequirements(context.Background(), nil, func(o *Options) { diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 1c6c8c96bea..fce6e7a6866 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -1744,6 +1744,42 @@ func (Ec2InstanceConnectEndpointState) Values() []Ec2InstanceConnectEndpointStat } } +type EkPubKeyFormat string + +// Enum values for EkPubKeyFormat +const ( + EkPubKeyFormatDer EkPubKeyFormat = "der" + EkPubKeyFormatTpmt EkPubKeyFormat = "tpmt" +) + +// Values returns all known values for EkPubKeyFormat. 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 (EkPubKeyFormat) Values() []EkPubKeyFormat { + return []EkPubKeyFormat{ + "der", + "tpmt", + } +} + +type EkPubKeyType string + +// Enum values for EkPubKeyType +const ( + EkPubKeyTypeRsa2048 EkPubKeyType = "rsa-2048" + EkPubKeyTypeEccSecP384 EkPubKeyType = "ecc-sec-p384" +) + +// Values returns all known values for EkPubKeyType. 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 (EkPubKeyType) Values() []EkPubKeyType { + return []EkPubKeyType{ + "rsa-2048", + "ecc-sec-p384", + } +} + type ElasticGpuState string // Enum values for ElasticGpuState diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 96adf38ba76..7914ceaab83 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -5490,6 +5490,26 @@ func (m *validateOpGetHostReservationPurchasePreview) HandleInitialize(ctx conte return next.HandleInitialize(ctx, in) } +type validateOpGetInstanceTpmEkPub struct { +} + +func (*validateOpGetInstanceTpmEkPub) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetInstanceTpmEkPub) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetInstanceTpmEkPubInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetInstanceTpmEkPubInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetInstanceTypesFromInstanceRequirements struct { } @@ -9826,6 +9846,10 @@ func addOpGetHostReservationPurchasePreviewValidationMiddleware(stack *middlewar return stack.Initialize.Add(&validateOpGetHostReservationPurchasePreview{}, middleware.After) } +func addOpGetInstanceTpmEkPubValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetInstanceTpmEkPub{}, middleware.After) +} + func addOpGetInstanceTypesFromInstanceRequirementsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetInstanceTypesFromInstanceRequirements{}, middleware.After) } @@ -15956,6 +15980,27 @@ func validateOpGetHostReservationPurchasePreviewInput(v *GetHostReservationPurch } } +func validateOpGetInstanceTpmEkPubInput(v *GetInstanceTpmEkPubInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetInstanceTpmEkPubInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if len(v.KeyType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KeyType")) + } + if len(v.KeyFormat) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("KeyFormat")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetInstanceTypesFromInstanceRequirementsInput(v *GetInstanceTypesFromInstanceRequirementsInput) error { if v == nil { return nil diff --git a/service/personalize/api_op_CreateDataDeletionJob.go b/service/personalize/api_op_CreateDataDeletionJob.go new file mode 100644 index 00000000000..18422d2183e --- /dev/null +++ b/service/personalize/api_op_CreateDataDeletionJob.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalize + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/personalize/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a batch job that deletes all references to specific users from an +// Amazon Personalize dataset group in batches. You specify the users to delete in +// a CSV file of userIds in an Amazon S3 bucket. After a job completes, Amazon +// Personalize no longer trains on the users’ data and no longer considers the +// users when generating user segments. For more information about creating a data +// deletion job, see Deleting users (https://docs.aws.amazon.com/personalize/latest/dg/delete-records.html) +// . +// - Your input file must be a CSV file with a single USER_ID column that lists +// the users IDs. For more information about preparing the CSV file, see +// Preparing your data deletion file and uploading it to Amazon S3 (https://docs.aws.amazon.com/personalize/latest/dg/prepare-deletion-input-file.html) +// . +// - To give Amazon Personalize permission to access your input CSV file of +// userIds, you must specify an IAM service role that has permission to read from +// the data source. This role needs GetObject and ListBucket permissions for the +// bucket and its content. These permissions are the same as importing data. For +// information on granting access to your Amazon S3 bucket, see Giving Amazon +// Personalize Access to Amazon S3 Resources (https://docs.aws.amazon.com/personalize/latest/dg/granting-personalize-s3-access.html) +// . +// +// After you create a job, it can take up to a day to delete all references to the +// users from datasets and models. Until the job completes, Amazon Personalize +// continues to use the data when training. And if you use a User Segmentation +// recipe, the users might appear in user segments. Status A data deletion job can +// have one of the following statuses: +// - PENDING > IN_PROGRESS > COMPLETED -or- FAILED +// +// To get the status of the data deletion job, call DescribeDataDeletionJob (https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDataDeletionJob.html) +// API operation and specify the Amazon Resource Name (ARN) of the job. If the +// status is FAILED, the response includes a failureReason key, which describes +// why the job failed. Related APIs +// - ListDataDeletionJobs (https://docs.aws.amazon.com/personalize/latest/dg/API_ListDataDeletionJobs.html) +// - DescribeDataDeletionJob (https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDataDeletionJob.html) +func (c *Client) CreateDataDeletionJob(ctx context.Context, params *CreateDataDeletionJobInput, optFns ...func(*Options)) (*CreateDataDeletionJobOutput, error) { + if params == nil { + params = &CreateDataDeletionJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDataDeletionJob", params, optFns, c.addOperationCreateDataDeletionJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDataDeletionJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDataDeletionJobInput struct { + + // The Amazon S3 bucket that contains the list of userIds of the users to delete. + // + // This member is required. + DataSource *types.DataSource + + // The Amazon Resource Name (ARN) of the dataset group that has the datasets you + // want to delete records from. + // + // This member is required. + DatasetGroupArn *string + + // The name for the data deletion job. + // + // This member is required. + JobName *string + + // The Amazon Resource Name (ARN) of the IAM role that has permissions to read + // from the Amazon S3 data source. + // + // This member is required. + RoleArn *string + + // A list of tags (https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html) + // to apply to the data deletion job. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateDataDeletionJobOutput struct { + + // The Amazon Resource Name (ARN) of the data deletion job. + DataDeletionJobArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDataDeletionJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataDeletionJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataDeletionJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDataDeletionJob"); err != nil { + return fmt.Errorf("add 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 = 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 = addOpCreateDataDeletionJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataDeletionJob(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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDataDeletionJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDataDeletionJob", + } +} diff --git a/service/personalize/api_op_DescribeDataDeletionJob.go b/service/personalize/api_op_DescribeDataDeletionJob.go new file mode 100644 index 00000000000..7d7af9375f8 --- /dev/null +++ b/service/personalize/api_op_DescribeDataDeletionJob.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalize + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/personalize/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the data deletion job created by CreateDataDeletionJob (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateDataDeletionJob.html) +// , including the job status. +func (c *Client) DescribeDataDeletionJob(ctx context.Context, params *DescribeDataDeletionJobInput, optFns ...func(*Options)) (*DescribeDataDeletionJobOutput, error) { + if params == nil { + params = &DescribeDataDeletionJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDataDeletionJob", params, optFns, c.addOperationDescribeDataDeletionJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDataDeletionJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDataDeletionJobInput struct { + + // The Amazon Resource Name (ARN) of the data deletion job. + // + // This member is required. + DataDeletionJobArn *string + + noSmithyDocumentSerde +} + +type DescribeDataDeletionJobOutput struct { + + // Information about the data deletion job, including the status. The status is + // one of the following values: + // - PENDING + // - IN_PROGRESS + // - COMPLETED + // - FAILED + DataDeletionJob *types.DataDeletionJob + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDataDeletionJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDataDeletionJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDataDeletionJob{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDataDeletionJob"); err != nil { + return fmt.Errorf("add 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 = 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 = addOpDescribeDataDeletionJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDataDeletionJob(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 + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeDataDeletionJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeDataDeletionJob", + } +} diff --git a/service/personalize/api_op_ListDataDeletionJobs.go b/service/personalize/api_op_ListDataDeletionJobs.go new file mode 100644 index 00000000000..1ac762eccd7 --- /dev/null +++ b/service/personalize/api_op_ListDataDeletionJobs.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalize + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/personalize/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of data deletion jobs for a dataset group ordered by creation +// time, with the most recent first. When a dataset group is not specified, all the +// data deletion jobs associated with the account are listed. The response provides +// the properties for each job, including the Amazon Resource Name (ARN). For more +// information on data deletion jobs, see Deleting users (https://docs.aws.amazon.com/personalize/latest/dg/delete-records.html) +// . +func (c *Client) ListDataDeletionJobs(ctx context.Context, params *ListDataDeletionJobsInput, optFns ...func(*Options)) (*ListDataDeletionJobsOutput, error) { + if params == nil { + params = &ListDataDeletionJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDataDeletionJobs", params, optFns, c.addOperationListDataDeletionJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDataDeletionJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDataDeletionJobsInput struct { + + // The Amazon Resource Name (ARN) of the dataset group to list data deletion jobs + // for. + DatasetGroupArn *string + + // The maximum number of data deletion jobs to return. + MaxResults *int32 + + // A token returned from the previous call to ListDataDeletionJobs for getting the + // next set of jobs (if they exist). + NextToken *string + + noSmithyDocumentSerde +} + +type ListDataDeletionJobsOutput struct { + + // The list of data deletion jobs. + DataDeletionJobs []types.DataDeletionJobSummary + + // A token for getting the next set of data deletion jobs (if they exist). + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDataDeletionJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDataDeletionJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDataDeletionJobs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDataDeletionJobs"); err != nil { + return fmt.Errorf("add 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 = 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 = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataDeletionJobs(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 + } + return nil +} + +func newServiceMetadataMiddleware_opListDataDeletionJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDataDeletionJobs", + } +} diff --git a/service/personalize/deserializers.go b/service/personalize/deserializers.go index 37017f591fc..00d00186725 100644 --- a/service/personalize/deserializers.go +++ b/service/personalize/deserializers.go @@ -387,6 +387,128 @@ func awsAwsjson11_deserializeOpErrorCreateCampaign(response *smithyhttp.Response } } +type awsAwsjson11_deserializeOpCreateDataDeletionJob struct { +} + +func (*awsAwsjson11_deserializeOpCreateDataDeletionJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateDataDeletionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateDataDeletionJob(response, &metadata) + } + output := &CreateDataDeletionJobOutput{} + 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 = awsAwsjson11_deserializeOpDocumentCreateDataDeletionJobOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateDataDeletionJob(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateDataset struct { } @@ -2967,6 +3089,116 @@ func awsAwsjson11_deserializeOpErrorDescribeCampaign(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpDescribeDataDeletionJob struct { +} + +func (*awsAwsjson11_deserializeOpDescribeDataDeletionJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeDataDeletionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDataDeletionJob(response, &metadata) + } + output := &DescribeDataDeletionJobOutput{} + 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 = awsAwsjson11_deserializeOpDocumentDescribeDataDeletionJobOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeDataDeletionJob(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeDataset struct { } @@ -4840,14 +5072,14 @@ func awsAwsjson11_deserializeOpErrorListCampaigns(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListDatasetExportJobs struct { +type awsAwsjson11_deserializeOpListDataDeletionJobs struct { } -func (*awsAwsjson11_deserializeOpListDatasetExportJobs) ID() string { +func (*awsAwsjson11_deserializeOpListDataDeletionJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListDatasetExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDataDeletionJobs) 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) @@ -4861,9 +5093,9 @@ func (m *awsAwsjson11_deserializeOpListDatasetExportJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetExportJobs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDataDeletionJobs(response, &metadata) } - output := &ListDatasetExportJobsOutput{} + output := &ListDataDeletionJobsOutput{} out.Result = output var buff [1024]byte @@ -4883,7 +5115,7 @@ func (m *awsAwsjson11_deserializeOpListDatasetExportJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListDatasetExportJobsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDataDeletionJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4897,7 +5129,7 @@ func (m *awsAwsjson11_deserializeOpListDatasetExportJobs) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListDatasetExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDataDeletionJobs(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)} @@ -4950,14 +5182,14 @@ func awsAwsjson11_deserializeOpErrorListDatasetExportJobs(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListDatasetGroups struct { +type awsAwsjson11_deserializeOpListDatasetExportJobs struct { } -func (*awsAwsjson11_deserializeOpListDatasetGroups) ID() string { +func (*awsAwsjson11_deserializeOpListDatasetExportJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListDatasetGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDatasetExportJobs) 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) @@ -4971,9 +5203,9 @@ func (m *awsAwsjson11_deserializeOpListDatasetGroups) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetExportJobs(response, &metadata) } - output := &ListDatasetGroupsOutput{} + output := &ListDatasetExportJobsOutput{} out.Result = output var buff [1024]byte @@ -4993,7 +5225,7 @@ func (m *awsAwsjson11_deserializeOpListDatasetGroups) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListDatasetGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDatasetExportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5007,7 +5239,7 @@ func (m *awsAwsjson11_deserializeOpListDatasetGroups) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListDatasetGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDatasetExportJobs(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)} @@ -5044,6 +5276,9 @@ func awsAwsjson11_deserializeOpErrorListDatasetGroups(response *smithyhttp.Respo errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidInputException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) + case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) @@ -5057,14 +5292,14 @@ func awsAwsjson11_deserializeOpErrorListDatasetGroups(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListDatasetImportJobs struct { +type awsAwsjson11_deserializeOpListDatasetGroups struct { } -func (*awsAwsjson11_deserializeOpListDatasetImportJobs) ID() string { +func (*awsAwsjson11_deserializeOpListDatasetGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListDatasetImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDatasetGroups) 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) @@ -5078,9 +5313,9 @@ func (m *awsAwsjson11_deserializeOpListDatasetImportJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetImportJobs(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetGroups(response, &metadata) } - output := &ListDatasetImportJobsOutput{} + output := &ListDatasetGroupsOutput{} out.Result = output var buff [1024]byte @@ -5100,7 +5335,7 @@ func (m *awsAwsjson11_deserializeOpListDatasetImportJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListDatasetImportJobsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDatasetGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5114,7 +5349,114 @@ func (m *awsAwsjson11_deserializeOpListDatasetImportJobs) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListDatasetImportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDatasetGroups(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") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListDatasetImportJobs struct { +} + +func (*awsAwsjson11_deserializeOpListDatasetImportJobs) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListDatasetImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListDatasetImportJobs(response, &metadata) + } + output := &ListDatasetImportJobsOutput{} + 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 = awsAwsjson11_deserializeOpDocumentListDatasetImportJobsOutput(&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 out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListDatasetImportJobs(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)} @@ -9318,16 +9660,329 @@ func awsAwsjson11_deserializeDocumentCategoricalValues(v *[]string, value interf if !ok { return fmt.Errorf("expected CategoricalValue to be of type string, got %T instead", value) } - col = jtv - } - cv = append(cv, col) + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentColumnNamesList(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 ColumnName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.ContinuousHyperParameterRange, 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.ContinuousHyperParameterRange + if *v == nil { + sv = &types.ContinuousHyperParameterRange{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "maxValue": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.MaxValue = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.MaxValue = f64 + + default: + return fmt.Errorf("expected ContinuousMaxValue to be a JSON Number, got %T instead", value) + + } + } + + case "minValue": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.MinValue = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.MinValue = f64 + + default: + return fmt.Errorf("expected ContinuousMinValue to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentContinuousHyperParameterRanges(v *[]types.ContinuousHyperParameterRange, 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.ContinuousHyperParameterRange + if *v == nil { + cv = []types.ContinuousHyperParameterRange{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ContinuousHyperParameterRange + destAddr := &col + if err := awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDataDeletionJob(v **types.DataDeletionJob, 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.DataDeletionJob + if *v == nil { + sv = &types.DataDeletionJob{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "dataDeletionJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DataDeletionJobArn = ptr.String(jtv) + } + + case "datasetGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DatasetGroupArn = ptr.String(jtv) + } + + case "dataSource": + if err := awsAwsjson11_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { + return err + } + + case "failureReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) + } + sv.FailureReason = ptr.String(jtv) + } + + case "jobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.JobName = ptr.String(jtv) + } + + case "lastUpdatedDateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "numDeleted": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumDeleted = ptr.Int32(int32(i64)) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentColumnNamesList(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentDataDeletionJobs(v *[]types.DataDeletionJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9340,22 +9995,20 @@ func awsAwsjson11_deserializeDocumentColumnNamesList(v *[]string, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.DataDeletionJobSummary if *v == nil { - cv = []string{} + cv = []types.DataDeletionJobSummary{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) - } - col = jtv + var col types.DataDeletionJobSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDataDeletionJobSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -9363,7 +10016,7 @@ func awsAwsjson11_deserializeDocumentColumnNamesList(v *[]string, value interfac return nil } -func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.ContinuousHyperParameterRange, value interface{}) error { +func awsAwsjson11_deserializeDocumentDataDeletionJobSummary(v **types.DataDeletionJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9376,16 +10029,16 @@ func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.Con return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ContinuousHyperParameterRange + var sv *types.DataDeletionJobSummary if *v == nil { - sv = &types.ContinuousHyperParameterRange{} + sv = &types.DataDeletionJobSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "maxValue": + case "creationDateTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -9393,33 +10046,51 @@ func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.Con if err != nil { return err } - sv.MaxValue = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() + sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) + } + } - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) + case "dataDeletionJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DataDeletionJobArn = ptr.String(jtv) + } - } - sv.MaxValue = f64 + case "datasetGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DatasetGroupArn = ptr.String(jtv) + } - default: - return fmt.Errorf("expected ContinuousMaxValue to be a JSON Number, got %T instead", value) + case "failureReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value) + } + sv.FailureReason = ptr.String(jtv) + } + case "jobName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) } + sv.JobName = ptr.String(jtv) } - case "minValue": + case "lastUpdatedDateTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -9427,39 +10098,21 @@ func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.Con if err != nil { return err } - sv.MinValue = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.MinValue = f64 + sv.LastUpdatedDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected ContinuousMinValue to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) } } - case "name": + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) + return fmt.Errorf("expected Status to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Status = ptr.String(jtv) } default: @@ -9471,40 +10124,6 @@ func awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(v **types.Con return nil } -func awsAwsjson11_deserializeDocumentContinuousHyperParameterRanges(v *[]types.ContinuousHyperParameterRange, 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.ContinuousHyperParameterRange - if *v == nil { - cv = []types.ContinuousHyperParameterRange{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ContinuousHyperParameterRange - destAddr := &col - if err := awsAwsjson11_deserializeDocumentContinuousHyperParameterRange(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - func awsAwsjson11_deserializeDocumentDataset(v **types.Dataset, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15062,6 +15681,46 @@ func awsAwsjson11_deserializeOpDocumentCreateCampaignOutput(v **CreateCampaignOu return nil } +func awsAwsjson11_deserializeOpDocumentCreateDataDeletionJobOutput(v **CreateDataDeletionJobOutput, 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 *CreateDataDeletionJobOutput + if *v == nil { + sv = &CreateDataDeletionJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataDeletionJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DataDeletionJobArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateDatasetExportJobOutput(v **CreateDatasetExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15664,6 +16323,42 @@ func awsAwsjson11_deserializeOpDocumentDescribeCampaignOutput(v **DescribeCampai return nil } +func awsAwsjson11_deserializeOpDocumentDescribeDataDeletionJobOutput(v **DescribeDataDeletionJobOutput, 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 *DescribeDataDeletionJobOutput + if *v == nil { + sv = &DescribeDataDeletionJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataDeletionJob": + if err := awsAwsjson11_deserializeDocumentDataDeletionJob(&sv.DataDeletionJob, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeDatasetExportJobOutput(v **DescribeDatasetExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16312,6 +17007,51 @@ func awsAwsjson11_deserializeOpDocumentListCampaignsOutput(v **ListCampaignsOutp return nil } +func awsAwsjson11_deserializeOpDocumentListDataDeletionJobsOutput(v **ListDataDeletionJobsOutput, 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 *ListDataDeletionJobsOutput + if *v == nil { + sv = &ListDataDeletionJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataDeletionJobs": + if err := awsAwsjson11_deserializeDocumentDataDeletionJobs(&sv.DataDeletionJobs, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListDatasetExportJobsOutput(v **ListDatasetExportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/personalize/generated.json b/service/personalize/generated.json index c299bb8d7a9..56efac0baad 100644 --- a/service/personalize/generated.json +++ b/service/personalize/generated.json @@ -11,6 +11,7 @@ "api_op_CreateBatchInferenceJob.go", "api_op_CreateBatchSegmentJob.go", "api_op_CreateCampaign.go", + "api_op_CreateDataDeletionJob.go", "api_op_CreateDataset.go", "api_op_CreateDatasetExportJob.go", "api_op_CreateDatasetGroup.go", @@ -35,6 +36,7 @@ "api_op_DescribeBatchInferenceJob.go", "api_op_DescribeBatchSegmentJob.go", "api_op_DescribeCampaign.go", + "api_op_DescribeDataDeletionJob.go", "api_op_DescribeDataset.go", "api_op_DescribeDatasetExportJob.go", "api_op_DescribeDatasetGroup.go", @@ -52,6 +54,7 @@ "api_op_ListBatchInferenceJobs.go", "api_op_ListBatchSegmentJobs.go", "api_op_ListCampaigns.go", + "api_op_ListDataDeletionJobs.go", "api_op_ListDatasetExportJobs.go", "api_op_ListDatasetGroups.go", "api_op_ListDatasetImportJobs.go", diff --git a/service/personalize/serializers.go b/service/personalize/serializers.go index 5b0df72f8d3..a637db54528 100644 --- a/service/personalize/serializers.go +++ b/service/personalize/serializers.go @@ -181,6 +181,61 @@ func (m *awsAwsjson11_serializeOpCreateCampaign) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateDataDeletionJob struct { +} + +func (*awsAwsjson11_serializeOpCreateDataDeletionJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateDataDeletionJob) 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, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDataDeletionJobInput) + _ = 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-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonPersonalize.CreateDataDeletionJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateDataDeletionJobInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateDataset struct { } @@ -1501,6 +1556,61 @@ func (m *awsAwsjson11_serializeOpDescribeCampaign) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeDataDeletionJob struct { +} + +func (*awsAwsjson11_serializeOpDescribeDataDeletionJob) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeDataDeletionJob) 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, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeDataDeletionJobInput) + _ = 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-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonPersonalize.DescribeDataDeletionJob") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeDataDeletionJobInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeDataset struct { } @@ -2436,6 +2546,61 @@ func (m *awsAwsjson11_serializeOpListCampaigns) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListDataDeletionJobs struct { +} + +func (*awsAwsjson11_serializeOpListDataDeletionJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListDataDeletionJobs) 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, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDataDeletionJobsInput) + _ = 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-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonPersonalize.ListDataDeletionJobs") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListDataDeletionJobsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListDatasetExportJobs struct { } @@ -4578,6 +4743,42 @@ func awsAwsjson11_serializeOpDocumentCreateCampaignInput(v *CreateCampaignInput, return nil } +func awsAwsjson11_serializeOpDocumentCreateDataDeletionJobInput(v *CreateDataDeletionJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DatasetGroupArn != nil { + ok := object.Key("datasetGroupArn") + ok.String(*v.DatasetGroupArn) + } + + if v.DataSource != nil { + ok := object.Key("dataSource") + if err := awsAwsjson11_serializeDocumentDataSource(v.DataSource, ok); err != nil { + return err + } + } + + if v.JobName != nil { + ok := object.Key("jobName") + ok.String(*v.JobName) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateDatasetExportJobInput(v *CreateDatasetExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5116,6 +5317,18 @@ func awsAwsjson11_serializeOpDocumentDescribeCampaignInput(v *DescribeCampaignIn return nil } +func awsAwsjson11_serializeOpDocumentDescribeDataDeletionJobInput(v *DescribeDataDeletionJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataDeletionJobArn != nil { + ok := object.Key("dataDeletionJobArn") + ok.String(*v.DataDeletionJobArn) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeDatasetExportJobInput(v *DescribeDatasetExportJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5350,6 +5563,28 @@ func awsAwsjson11_serializeOpDocumentListCampaignsInput(v *ListCampaignsInput, v return nil } +func awsAwsjson11_serializeOpDocumentListDataDeletionJobsInput(v *ListDataDeletionJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DatasetGroupArn != nil { + ok := object.Key("datasetGroupArn") + ok.String(*v.DatasetGroupArn) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListDatasetExportJobsInput(v *ListDatasetExportJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/personalize/snapshot_test.go b/service/personalize/snapshot_test.go index cd7ab5013de..1c394b42f8a 100644 --- a/service/personalize/snapshot_test.go +++ b/service/personalize/snapshot_test.go @@ -98,6 +98,18 @@ func TestCheckSnapshot_CreateCampaign(t *testing.T) { } } +func TestCheckSnapshot_CreateDataDeletionJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDataDeletionJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateDataDeletionJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateDataset(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDataset(context.Background(), nil, func(o *Options) { @@ -386,6 +398,18 @@ func TestCheckSnapshot_DescribeCampaign(t *testing.T) { } } +func TestCheckSnapshot_DescribeDataDeletionJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeDataDeletionJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeDataDeletionJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeDataset(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeDataset(context.Background(), nil, func(o *Options) { @@ -590,6 +614,18 @@ func TestCheckSnapshot_ListCampaigns(t *testing.T) { } } +func TestCheckSnapshot_ListDataDeletionJobs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListDataDeletionJobs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListDataDeletionJobs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListDatasetExportJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListDatasetExportJobs(context.Background(), nil, func(o *Options) { @@ -901,6 +937,18 @@ func TestUpdateSnapshot_CreateCampaign(t *testing.T) { } } +func TestUpdateSnapshot_CreateDataDeletionJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDataDeletionJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateDataDeletionJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateDataset(t *testing.T) { svc := New(Options{}) _, err := svc.CreateDataset(context.Background(), nil, func(o *Options) { @@ -1189,6 +1237,18 @@ func TestUpdateSnapshot_DescribeCampaign(t *testing.T) { } } +func TestUpdateSnapshot_DescribeDataDeletionJob(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeDataDeletionJob(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeDataDeletionJob") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeDataset(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeDataset(context.Background(), nil, func(o *Options) { @@ -1393,6 +1453,18 @@ func TestUpdateSnapshot_ListCampaigns(t *testing.T) { } } +func TestUpdateSnapshot_ListDataDeletionJobs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListDataDeletionJobs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListDataDeletionJobs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListDatasetExportJobs(t *testing.T) { svc := New(Options{}) _, err := svc.ListDatasetExportJobs(context.Background(), nil, func(o *Options) { diff --git a/service/personalize/types/types.go b/service/personalize/types/types.go index dc168046d67..3f8f1075bcf 100644 --- a/service/personalize/types/types.go +++ b/service/personalize/types/types.go @@ -508,6 +508,82 @@ type ContinuousHyperParameterRange struct { noSmithyDocumentSerde } +// Describes a job that deletes all references to specific users from an Amazon +// Personalize dataset group in batches. For information about creating a data +// deletion job, see Deleting users (https://docs.aws.amazon.com/personalize/latest/dg/delete-records.html) +// . +type DataDeletionJob struct { + + // The creation date and time (in Unix time) of the data deletion job. + CreationDateTime *time.Time + + // The Amazon Resource Name (ARN) of the data deletion job. + DataDeletionJobArn *string + + // Describes the data source that contains the data to upload to a dataset, or the + // list of records to delete from Amazon Personalize. + DataSource *DataSource + + // The Amazon Resource Name (ARN) of the dataset group the job deletes records + // from. + DatasetGroupArn *string + + // If a data deletion job fails, provides the reason why. + FailureReason *string + + // The name of the data deletion job. + JobName *string + + // The date and time (in Unix time) the data deletion job was last updated. + LastUpdatedDateTime *time.Time + + // The number of records deleted by a COMPLETED job. + NumDeleted *int32 + + // The Amazon Resource Name (ARN) of the IAM role that has permissions to read + // from the Amazon S3 data source. + RoleArn *string + + // The status of the data deletion job. A data deletion job can have one of the + // following statuses: + // - PENDING > IN_PROGRESS > COMPLETED -or- FAILED + Status *string + + noSmithyDocumentSerde +} + +// Provides a summary of the properties of a data deletion job. For a complete +// listing, call the DescribeDataDeletionJob (https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeDataDeletionJob.html) +// API operation. +type DataDeletionJobSummary struct { + + // The creation date and time (in Unix time) of the data deletion job. + CreationDateTime *time.Time + + // The Amazon Resource Name (ARN) of the data deletion job. + DataDeletionJobArn *string + + // The Amazon Resource Name (ARN) of the dataset group the job deleted records + // from. + DatasetGroupArn *string + + // If a data deletion job fails, provides the reason why. + FailureReason *string + + // The name of the data deletion job. + JobName *string + + // The date and time (in Unix time) the data deletion job was last updated. + LastUpdatedDateTime *time.Time + + // The status of the data deletion job. A data deletion job can have one of the + // following statuses: + // - PENDING > IN_PROGRESS > COMPLETED -or- FAILED + Status *string + + noSmithyDocumentSerde +} + // Provides metadata for a dataset. type Dataset struct { @@ -903,11 +979,19 @@ type DatasetUpdateSummary struct { noSmithyDocumentSerde } -// Describes the data source that contains the data to upload to a dataset. +// Describes the data source that contains the data to upload to a dataset, or the +// list of records to delete from Amazon Personalize. type DataSource struct { - // The path to the Amazon S3 bucket where the data that you want to upload to your - // dataset is stored. For example: s3://bucket-name/folder-name/ + // For dataset import jobs, the path to the Amazon S3 bucket where the data that + // you want to upload to your dataset is stored. For data deletion jobs, the path + // to the Amazon S3 bucket that stores the list of records to delete. For example: + // s3://bucket-name/folder-name/fileName.csv If your CSV files are in a folder in + // your Amazon S3 bucket and you want your import job or data deletion job to + // consider multiple files, you can specify the path to the folder. With a data + // deletion job, Amazon Personalize uses all files in the folder and any sub + // folder. Use the following syntax with a / after the folder name: + // s3://bucket-name/folder-name/ DataLocation *string noSmithyDocumentSerde diff --git a/service/personalize/validators.go b/service/personalize/validators.go index 3a4a221c096..70650a2c91f 100644 --- a/service/personalize/validators.go +++ b/service/personalize/validators.go @@ -70,6 +70,26 @@ func (m *validateOpCreateCampaign) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpCreateDataDeletionJob struct { +} + +func (*validateOpCreateDataDeletionJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDataDeletionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDataDeletionJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDataDeletionJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDatasetExportJob struct { } @@ -550,6 +570,26 @@ func (m *validateOpDescribeCampaign) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDescribeDataDeletionJob struct { +} + +func (*validateOpDescribeDataDeletionJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeDataDeletionJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeDataDeletionJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeDataDeletionJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeDatasetExportJob struct { } @@ -1042,6 +1082,10 @@ func addOpCreateCampaignValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCampaign{}, middleware.After) } +func addOpCreateDataDeletionJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDataDeletionJob{}, middleware.After) +} + func addOpCreateDatasetExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDatasetExportJob{}, middleware.After) } @@ -1138,6 +1182,10 @@ func addOpDescribeCampaignValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCampaign{}, middleware.After) } +func addOpDescribeDataDeletionJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeDataDeletionJob{}, middleware.After) +} + func addOpDescribeDatasetExportJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDatasetExportJob{}, middleware.After) } @@ -1579,6 +1627,35 @@ func validateOpCreateCampaignInput(v *CreateCampaignInput) error { } } +func validateOpCreateDataDeletionJobInput(v *CreateDataDeletionJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDataDeletionJobInput"} + if v.JobName == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobName")) + } + if v.DatasetGroupArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DatasetGroupArn")) + } + if v.DataSource == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataSource")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.Tags != nil { + if err := validateTags(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDatasetExportJobInput(v *CreateDatasetExportJobInput) error { if v == nil { return nil @@ -2053,6 +2130,21 @@ func validateOpDescribeCampaignInput(v *DescribeCampaignInput) error { } } +func validateOpDescribeDataDeletionJobInput(v *DescribeDataDeletionJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeDataDeletionJobInput"} + if v.DataDeletionJobArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataDeletionJobArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeDatasetExportJobInput(v *DescribeDatasetExportJobInput) error { if v == nil { return nil diff --git a/service/redshiftserverless/api_op_CreateWorkgroup.go b/service/redshiftserverless/api_op_CreateWorkgroup.go index d5e790d2fe1..5475e590806 100644 --- a/service/redshiftserverless/api_op_CreateWorkgroup.go +++ b/service/redshiftserverless/api_op_CreateWorkgroup.go @@ -45,10 +45,10 @@ type CreateWorkgroupInput struct { // An array of parameters to set for advanced control over a database. The options // are auto_mv , datestyle , enable_case_sensitive_identifier , - // enable_user_activity_logging , query_group , search_path , require_ssl , and - // query monitoring metrics that let you define performance boundaries. For more - // information about query monitoring rules and available metrics, see Query - // monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) + // enable_user_activity_logging , query_group , search_path , require_ssl , + // use_fips_ssl , and query monitoring metrics that let you define performance + // boundaries. For more information about query monitoring rules and available + // metrics, see Query monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) // . ConfigParameters []types.ConfigParameter diff --git a/service/redshiftserverless/api_op_ListScheduledActions.go b/service/redshiftserverless/api_op_ListScheduledActions.go index f18c7dde2f7..e1838984b9d 100644 --- a/service/redshiftserverless/api_op_ListScheduledActions.go +++ b/service/redshiftserverless/api_op_ListScheduledActions.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/redshiftserverless/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) @@ -51,8 +52,8 @@ type ListScheduledActionsOutput struct { // the returned token to retrieve the next page. NextToken *string - // All of the returned scheduled action objects. - ScheduledActions []string + // All of the returned scheduled action association objects. + ScheduledActions []types.ScheduledActionAssociation // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/redshiftserverless/api_op_UpdateWorkgroup.go b/service/redshiftserverless/api_op_UpdateWorkgroup.go index e4d3653c1a4..f1d6622cbd9 100644 --- a/service/redshiftserverless/api_op_UpdateWorkgroup.go +++ b/service/redshiftserverless/api_op_UpdateWorkgroup.go @@ -42,10 +42,10 @@ type UpdateWorkgroupInput struct { // An array of parameters to set for advanced control over a database. The options // are auto_mv , datestyle , enable_case_sensitive_identifier , - // enable_user_activity_logging , query_group , search_path , require_ssl , and - // query monitoring metrics that let you define performance boundaries. For more - // information about query monitoring rules and available metrics, see Query - // monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) + // enable_user_activity_logging , query_group , search_path , require_ssl , + // use_fips_ssl , and query monitoring metrics that let you define performance + // boundaries. For more information about query monitoring rules and available + // metrics, see Query monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) // . ConfigParameters []types.ConfigParameter diff --git a/service/redshiftserverless/deserializers.go b/service/redshiftserverless/deserializers.go index 39403248118..a35baa4689b 100644 --- a/service/redshiftserverless/deserializers.go +++ b/service/redshiftserverless/deserializers.go @@ -8194,6 +8194,55 @@ loop: return nil } +func awsAwsjson11_deserializeDocumentScheduledActionAssociation(v **types.ScheduledActionAssociation, 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.ScheduledActionAssociation + if *v == nil { + sv = &types.ScheduledActionAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value) + } + sv.NamespaceName = ptr.String(jtv) + } + + case "scheduledActionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduledActionName to be of type string, got %T instead", value) + } + sv.ScheduledActionName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentScheduledActionResponse(v **types.ScheduledActionResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8326,7 +8375,7 @@ func awsAwsjson11_deserializeDocumentScheduledActionResponse(v **types.Scheduled return nil } -func awsAwsjson11_deserializeDocumentScheduledActionsList(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentScheduledActionsList(v *[]types.ScheduledActionAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8339,22 +8388,20 @@ func awsAwsjson11_deserializeDocumentScheduledActionsList(v *[]string, value int return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.ScheduledActionAssociation if *v == nil { - cv = []string{} + cv = []types.ScheduledActionAssociation{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ScheduledActionName to be of type string, got %T instead", value) - } - col = jtv + var col types.ScheduledActionAssociation + destAddr := &col + if err := awsAwsjson11_deserializeDocumentScheduledActionAssociation(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } diff --git a/service/redshiftserverless/types/types.go b/service/redshiftserverless/types/types.go index bbdb200f2a1..64242565d33 100644 --- a/service/redshiftserverless/types/types.go +++ b/service/redshiftserverless/types/types.go @@ -31,9 +31,10 @@ type ConfigParameter struct { // The key of the parameter. The options are auto_mv , datestyle , // enable_case_sensitive_identifier , enable_user_activity_logging , query_group , - // search_path , require_ssl , and query monitoring metrics that let you define - // performance boundaries. For more information about query monitoring rules and - // available metrics, see Query monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) + // search_path , require_ssl , use_fips_ssl , and query monitoring metrics that let + // you define performance boundaries. For more information about query monitoring + // rules and available metrics, see Query monitoring metrics for Amazon Redshift + // Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) // . ParameterKey *string @@ -271,6 +272,18 @@ type ScheduleMemberCron struct { func (*ScheduleMemberCron) isSchedule() {} +// Contains names of objects associated with a scheduled action. +type ScheduledActionAssociation struct { + + // Name of associated Amazon Redshift Serverless namespace. + NamespaceName *string + + // Name of associated scheduled action. + ScheduledActionName *string + + noSmithyDocumentSerde +} + // The returned scheduled action object. type ScheduledActionResponse struct { @@ -600,10 +613,10 @@ type Workgroup struct { // An array of parameters to set for advanced control over a database. The options // are auto_mv , datestyle , enable_case_sensitive_identifier , - // enable_user_activity_logging , query_group , search_path , require_ssl , and - // query monitoring metrics that let you define performance boundaries. For more - // information about query monitoring rules and available metrics, see Query - // monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) + // enable_user_activity_logging , query_group , search_path , require_ssl , + // use_fips_ssl , and query monitoring metrics that let you define performance + // boundaries. For more information about query monitoring rules and available + // metrics, see Query monitoring metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless) // . ConfigParameters []ConfigParameter @@ -649,7 +662,7 @@ type Workgroup struct { Port *int32 // A value that specifies whether the workgroup can be accessible from a public - // network + // network. PubliclyAccessible *bool // An array of security group IDs to associate with the workgroup.