From f93a9b9c8a8f084624ec7d31858a696c10b48851 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 14 Sep 2023 18:12:27 +0000 Subject: [PATCH] Regenerated Clients --- .../37bc8377733a457491dc3f72ab031ceb.json | 8 + .../88a6f30174ab455db73ed66c447ebc84.json | 8 + .../8b2800f8eea04c7bb71f8f527e1bb25e.json | 8 + .../f23b80c3841a4007b181708d1cad60d2.json | 8 + service/appstream/api_op_CreateFleet.go | 6 +- service/appstream/api_op_DescribeFleets.go | 12 +- service/appstream/api_op_DescribeSessions.go | 3 + service/appstream/api_op_UpdateFleet.go | 4 + service/appstream/deserializers.go | 74 + service/appstream/serializers.go | 20 + service/appstream/types/enums.go | 2 + service/appstream/types/types.go | 36 +- service/appstream/validators.go | 25 - service/cloudformation/api_op_CreateStack.go | 9 +- .../cloudformation/api_op_CreateStackSet.go | 10 +- .../cloudformation/api_op_DescribeStacks.go | 17 +- .../cloudformation/api_op_ExecuteChangeSet.go | 9 +- .../cloudformation/api_op_RollbackStack.go | 9 +- service/cloudformation/api_op_UpdateStack.go | 9 +- .../cloudformation/api_op_UpdateStackSet.go | 10 +- service/cloudformation/types/types.go | 13 +- .../api_op_CreateMatchingWorkflow.go | 12 +- .../api_op_CreateSchemaMapping.go | 12 +- .../entityresolution/api_op_GetMatchingJob.go | 2 +- .../api_op_GetMatchingWorkflow.go | 6 +- .../api_op_ListMatchingWorkflows.go | 4 +- .../api_op_ListSchemaMappings.go | 4 +- .../api_op_ListTagsForResource.go | 2 +- .../entityresolution/api_op_TagResource.go | 22 +- .../entityresolution/api_op_UntagResource.go | 2 +- .../api_op_UpdateMatchingWorkflow.go | 10 +- service/entityresolution/deserializers.go | 24 +- service/entityresolution/doc.go | 24 +- service/entityresolution/endpoints_test.go | 249 +- service/entityresolution/types/errors.go | 13 +- service/entityresolution/types/types.go | 48 +- service/entityresolution/validators.go | 7 +- .../api_op_CreateInferenceScheduler.go | 4 +- .../lookoutequipment/api_op_CreateModel.go | 40 +- .../api_op_CreateRetrainingScheduler.go | 338 +++ .../api_op_DeleteInferenceScheduler.go | 4 +- .../lookoutequipment/api_op_DeleteModel.go | 8 +- .../api_op_DeleteRetrainingScheduler.go | 257 +++ .../api_op_DescribeInferenceScheduler.go | 7 +- .../lookoutequipment/api_op_DescribeModel.go | 81 +- .../api_op_DescribeModelVersion.go | 21 + .../api_op_DescribeRetrainingScheduler.go | 292 +++ .../api_op_ImportModelVersion.go | 9 + .../api_op_ListInferenceSchedulers.go | 3 +- service/lookoutequipment/api_op_ListModels.go | 19 +- .../api_op_ListRetrainingSchedulers.go | 367 +++ .../api_op_StartInferenceScheduler.go | 6 +- .../api_op_StartRetrainingScheduler.go | 267 +++ .../api_op_StopInferenceScheduler.go | 7 +- .../api_op_StopRetrainingScheduler.go | 267 +++ .../lookoutequipment/api_op_UpdateModel.go | 264 +++ .../api_op_UpdateRetrainingScheduler.go | 282 +++ service/lookoutequipment/deserializers.go | 1994 +++++++++++++++-- service/lookoutequipment/generated.json | 8 + service/lookoutequipment/serializers.go | 685 +++++- service/lookoutequipment/types/enums.go | 84 + service/lookoutequipment/types/types.go | 77 +- service/lookoutequipment/validators.go | 287 +++ 63 files changed, 5877 insertions(+), 542 deletions(-) create mode 100644 .changelog/37bc8377733a457491dc3f72ab031ceb.json create mode 100644 .changelog/88a6f30174ab455db73ed66c447ebc84.json create mode 100644 .changelog/8b2800f8eea04c7bb71f8f527e1bb25e.json create mode 100644 .changelog/f23b80c3841a4007b181708d1cad60d2.json create mode 100644 service/lookoutequipment/api_op_CreateRetrainingScheduler.go create mode 100644 service/lookoutequipment/api_op_DeleteRetrainingScheduler.go create mode 100644 service/lookoutequipment/api_op_DescribeRetrainingScheduler.go create mode 100644 service/lookoutequipment/api_op_ListRetrainingSchedulers.go create mode 100644 service/lookoutequipment/api_op_StartRetrainingScheduler.go create mode 100644 service/lookoutequipment/api_op_StopRetrainingScheduler.go create mode 100644 service/lookoutequipment/api_op_UpdateModel.go create mode 100644 service/lookoutequipment/api_op_UpdateRetrainingScheduler.go diff --git a/.changelog/37bc8377733a457491dc3f72ab031ceb.json b/.changelog/37bc8377733a457491dc3f72ab031ceb.json new file mode 100644 index 00000000000..af085600cf4 --- /dev/null +++ b/.changelog/37bc8377733a457491dc3f72ab031ceb.json @@ -0,0 +1,8 @@ +{ + "id": "37bc8377-733a-4574-91dc-3f72ab031ceb", + "type": "feature", + "description": "Changed \"ResolutionTechniques\" and \"MappedInputFields\" in workflow and schema mapping operations to be required fields.", + "modules": [ + "service/entityresolution" + ] +} \ No newline at end of file diff --git a/.changelog/88a6f30174ab455db73ed66c447ebc84.json b/.changelog/88a6f30174ab455db73ed66c447ebc84.json new file mode 100644 index 00000000000..47b0d071984 --- /dev/null +++ b/.changelog/88a6f30174ab455db73ed66c447ebc84.json @@ -0,0 +1,8 @@ +{ + "id": "88a6f301-74ab-455d-b73e-d66c447ebc84", + "type": "feature", + "description": "This release adds APIs for the new scheduled retraining feature.", + "modules": [ + "service/lookoutequipment" + ] +} \ No newline at end of file diff --git a/.changelog/8b2800f8eea04c7bb71f8f527e1bb25e.json b/.changelog/8b2800f8eea04c7bb71f8f527e1bb25e.json new file mode 100644 index 00000000000..72ac4392eb1 --- /dev/null +++ b/.changelog/8b2800f8eea04c7bb71f8f527e1bb25e.json @@ -0,0 +1,8 @@ +{ + "id": "8b2800f8-eea0-4c7b-b71f-8f527e1bb25e", + "type": "feature", + "description": "This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance.", + "modules": [ + "service/appstream" + ] +} \ No newline at end of file diff --git a/.changelog/f23b80c3841a4007b181708d1cad60d2.json b/.changelog/f23b80c3841a4007b181708d1cad60d2.json new file mode 100644 index 00000000000..10e5d57089f --- /dev/null +++ b/.changelog/f23b80c3841a4007b181708d1cad60d2.json @@ -0,0 +1,8 @@ +{ + "id": "f23b80c3-841a-4007-b181-708d1cad60d2", + "type": "documentation", + "description": "Documentation updates for AWS CloudFormation", + "modules": [ + "service/cloudformation" + ] +} \ No newline at end of file diff --git a/service/appstream/api_op_CreateFleet.go b/service/appstream/api_op_CreateFleet.go index f61c411fdc6..91945e7ceed 100644 --- a/service/appstream/api_op_CreateFleet.go +++ b/service/appstream/api_op_CreateFleet.go @@ -160,11 +160,15 @@ type CreateFleetInput struct { // Elastic fleets, and not allowed for other fleet types. MaxConcurrentSessions *int32 + // The maximum number of user sessions on an instance. This only applies to + // multi-session fleets. + MaxSessionsPerInstance *int32 + // The maximum amount of time that a streaming session can remain active, in // seconds. If users are still connected to a streaming instance five minutes // before this limit is reached, they are prompted to save any open documents // before being disconnected. After this time elapses, the instance is terminated - // and replaced by a new instance. Specify a value between 600 and 360000. + // and replaced by a new instance. Specify a value between 600 and 432000. MaxUserDurationInSeconds *int32 // The fleet platform. WINDOWS_SERVER_2019 and AMAZON_LINUX2 are supported for diff --git a/service/appstream/api_op_DescribeFleets.go b/service/appstream/api_op_DescribeFleets.go index 31ccf99b660..181dbb56661 100644 --- a/service/appstream/api_op_DescribeFleets.go +++ b/service/appstream/api_op_DescribeFleets.go @@ -289,7 +289,7 @@ func fleetStartedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "RUNNING" + expectedValue := "ACTIVE" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { @@ -321,7 +321,7 @@ func fleetStartedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "STOPPING" + expectedValue := "PENDING_DEACTIVATE" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) @@ -345,7 +345,7 @@ func fleetStartedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "STOPPED" + expectedValue := "INACTIVE" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) @@ -511,7 +511,7 @@ func fleetStoppedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "STOPPED" + expectedValue := "INACTIVE" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { @@ -543,7 +543,7 @@ func fleetStoppedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "STARTING" + expectedValue := "PENDING_ACTIVATE" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) @@ -567,7 +567,7 @@ func fleetStoppedStateRetryable(ctx context.Context, input *DescribeFleetsInput, return false, fmt.Errorf("error evaluating waiter state: %w", err) } - expectedValue := "RUNNING" + expectedValue := "ACTIVE" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) diff --git a/service/appstream/api_op_DescribeSessions.go b/service/appstream/api_op_DescribeSessions.go index 4c27562d3b9..0f95f32e603 100644 --- a/service/appstream/api_op_DescribeSessions.go +++ b/service/appstream/api_op_DescribeSessions.go @@ -52,6 +52,9 @@ type DescribeSessionsInput struct { // users using a streaming URL. AuthenticationType types.AuthenticationType + // The identifier for the instance hosting the session. + InstanceId *string + // The size of each page of results. The default value is 20 and the maximum value // is 50. Limit *int32 diff --git a/service/appstream/api_op_UpdateFleet.go b/service/appstream/api_op_UpdateFleet.go index d49ebe58a0f..d889fd98c22 100644 --- a/service/appstream/api_op_UpdateFleet.go +++ b/service/appstream/api_op_UpdateFleet.go @@ -161,6 +161,10 @@ type UpdateFleetInput struct { // The maximum number of concurrent sessions for a fleet. MaxConcurrentSessions *int32 + // The maximum number of user sessions on an instance. This only applies to + // multi-session fleets. + MaxSessionsPerInstance *int32 + // The maximum amount of time that a streaming session can remain active, in // seconds. If users are still connected to a streaming instance five minutes // before this limit is reached, they are prompted to save any open documents diff --git a/service/appstream/deserializers.go b/service/appstream/deserializers.go index ddb322931b4..620e681d1cf 100644 --- a/service/appstream/deserializers.go +++ b/service/appstream/deserializers.go @@ -10383,6 +10383,32 @@ func awsAwsjson11_deserializeDocumentComputeCapacityStatus(v **types.ComputeCapa for key, value := range shape { switch key { + case "ActiveUserSessions": + 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.ActiveUserSessions = ptr.Int32(int32(i64)) + } + + case "ActualUserSessions": + 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.ActualUserSessions = ptr.Int32(int32(i64)) + } + case "Available": if value != nil { jtv, ok := value.(json.Number) @@ -10396,6 +10422,19 @@ func awsAwsjson11_deserializeDocumentComputeCapacityStatus(v **types.ComputeCapa sv.Available = ptr.Int32(int32(i64)) } + case "AvailableUserSessions": + 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.AvailableUserSessions = ptr.Int32(int32(i64)) + } + case "Desired": if value != nil { jtv, ok := value.(json.Number) @@ -10409,6 +10448,19 @@ func awsAwsjson11_deserializeDocumentComputeCapacityStatus(v **types.ComputeCapa sv.Desired = ptr.Int32(int32(i64)) } + case "DesiredUserSessions": + 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.DesiredUserSessions = ptr.Int32(int32(i64)) + } + case "InUse": if value != nil { jtv, ok := value.(json.Number) @@ -11341,6 +11393,19 @@ func awsAwsjson11_deserializeDocumentFleet(v **types.Fleet, value interface{}) e sv.MaxConcurrentSessions = ptr.Int32(int32(i64)) } + case "MaxSessionsPerInstance": + 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.MaxSessionsPerInstance = ptr.Int32(int32(i64)) + } + case "MaxUserDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) @@ -13142,6 +13207,15 @@ func awsAwsjson11_deserializeDocumentSession(v **types.Session, value interface{ sv.Id = ptr.String(jtv) } + case "InstanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + case "MaxExpirationTime": if value != nil { switch jtv := value.(type) { diff --git a/service/appstream/serializers.go b/service/appstream/serializers.go index c489b480537..22f47c23251 100644 --- a/service/appstream/serializers.go +++ b/service/appstream/serializers.go @@ -4256,6 +4256,11 @@ func awsAwsjson11_serializeDocumentComputeCapacity(v *types.ComputeCapacity, val ok.Integer(*v.DesiredInstances) } + if v.DesiredSessions != nil { + ok := object.Key("DesiredSessions") + ok.Integer(*v.DesiredSessions) + } + return nil } @@ -5142,6 +5147,11 @@ func awsAwsjson11_serializeOpDocumentCreateFleetInput(v *CreateFleetInput, value ok.Integer(*v.MaxConcurrentSessions) } + if v.MaxSessionsPerInstance != nil { + ok := object.Key("MaxSessionsPerInstance") + ok.Integer(*v.MaxSessionsPerInstance) + } + if v.MaxUserDurationInSeconds != nil { ok := object.Key("MaxUserDurationInSeconds") ok.Integer(*v.MaxUserDurationInSeconds) @@ -5939,6 +5949,11 @@ func awsAwsjson11_serializeOpDocumentDescribeSessionsInput(v *DescribeSessionsIn ok.String(*v.FleetName) } + if v.InstanceId != nil { + ok := object.Key("InstanceId") + ok.String(*v.InstanceId) + } + if v.Limit != nil { ok := object.Key("Limit") ok.Integer(*v.Limit) @@ -6625,6 +6640,11 @@ func awsAwsjson11_serializeOpDocumentUpdateFleetInput(v *UpdateFleetInput, value ok.Integer(*v.MaxConcurrentSessions) } + if v.MaxSessionsPerInstance != nil { + ok := object.Key("MaxSessionsPerInstance") + ok.Integer(*v.MaxSessionsPerInstance) + } + if v.MaxUserDurationInSeconds != nil { ok := object.Key("MaxUserDurationInSeconds") ok.Integer(*v.MaxUserDurationInSeconds) diff --git a/service/appstream/types/enums.go b/service/appstream/types/enums.go index f2b0585fd2c..d3f82721bc7 100644 --- a/service/appstream/types/enums.go +++ b/service/appstream/types/enums.go @@ -227,6 +227,7 @@ const ( FleetAttributeIamRoleArn FleetAttribute = "IAM_ROLE_ARN" FleetAttributeUsbDeviceFilterStrings FleetAttribute = "USB_DEVICE_FILTER_STRINGS" FleetAttributeSessionScriptS3Location FleetAttribute = "SESSION_SCRIPT_S3_LOCATION" + FleetAttributeMaxSessionsPerInstance FleetAttribute = "MAX_SESSIONS_PER_INSTANCE" ) // Values returns all known values for FleetAttribute. Note that this can be @@ -240,6 +241,7 @@ func (FleetAttribute) Values() []FleetAttribute { "IAM_ROLE_ARN", "USB_DEVICE_FILTER_STRINGS", "SESSION_SCRIPT_S3_LOCATION", + "MAX_SESSIONS_PER_INSTANCE", } } diff --git a/service/appstream/types/types.go b/service/appstream/types/types.go index d0423c8a97f..458a682452f 100644 --- a/service/appstream/types/types.go +++ b/service/appstream/types/types.go @@ -298,10 +298,14 @@ type CertificateBasedAuthProperties struct { type ComputeCapacity struct { // The desired number of streaming instances. - // - // This member is required. DesiredInstances *int32 + // The desired number of user sessions for a multi-session fleet. This is not + // allowed for single-session fleets. When you create a fleet, you must set either + // the DesiredSessions or DesiredInstances attribute, based on the type of fleet + // you create. You can’t define both attributes or leave both attributes blank. + DesiredSessions *int32 + noSmithyDocumentSerde } @@ -313,9 +317,30 @@ type ComputeCapacityStatus struct { // This member is required. Desired *int32 + // The number of user sessions currently being used for streaming sessions. This + // only applies to multi-session fleets. + ActiveUserSessions *int32 + + // The total number of session slots that are available for streaming or are + // currently streaming. ActualUserSessionCapacity = AvailableUserSessionCapacity + + // ActiveUserSessions This only applies to multi-session fleets. + ActualUserSessions *int32 + // The number of currently available instances that can be used to stream sessions. Available *int32 + // The number of idle session slots currently available for user sessions. + // AvailableUserSessionCapacity = ActualUserSessionCapacity - ActiveUserSessions + // This only applies to multi-session fleets. + AvailableUserSessions *int32 + + // The total number of sessions slots that are either running or pending. This + // represents the total number of concurrent streaming sessions your fleet can + // support in a steady state. DesiredUserSessionCapacity = + // ActualUserSessionCapacity + PendingUserSessionCapacity This only applies to + // multi-session fleets. + DesiredUserSessions *int32 + // The number of instances in use for streaming. InUse *int32 @@ -599,6 +624,10 @@ type Fleet struct { // The maximum number of concurrent sessions for the fleet. MaxConcurrentSessions *int32 + // The maximum number of user sessions on an instance. This only applies to + // multi-session fleets. + MaxSessionsPerInstance *int32 + // The maximum amount of time that a streaming session can remain active, in // seconds. If users are still connected to a streaming instance five minutes // before this limit is reached, they are prompted to save any open documents @@ -992,6 +1021,9 @@ type Session struct { // Specifies whether a user is connected to the streaming session. ConnectionState SessionConnectionState + // The identifier for the instance hosting the session. + InstanceId *string + // The time when the streaming session is set to expire. This time is based on the // MaxUserDurationinSeconds value, which determines the maximum length of time that // a streaming session can run. A streaming session might end earlier than the time diff --git a/service/appstream/validators.go b/service/appstream/validators.go index 26fd6c46d93..80c994a9565 100644 --- a/service/appstream/validators.go +++ b/service/appstream/validators.go @@ -1518,21 +1518,6 @@ func validateApplicationSettings(v *types.ApplicationSettings) error { } } -func validateComputeCapacity(v *types.ComputeCapacity) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ComputeCapacity"} - if v.DesiredInstances == nil { - invalidParams.Add(smithy.NewErrParamRequired("DesiredInstances")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateEntitlementAttribute(v *types.EntitlementAttribute) error { if v == nil { return nil @@ -2037,11 +2022,6 @@ func validateOpCreateFleetInput(v *CreateFleetInput) error { if v.InstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } - if v.ComputeCapacity != nil { - if err := validateComputeCapacity(v.ComputeCapacity); err != nil { - invalidParams.AddNested("ComputeCapacity", err.(smithy.InvalidParamsError)) - } - } if v.SessionScriptS3Location != nil { if err := validateS3Location(v.SessionScriptS3Location); err != nil { invalidParams.AddNested("SessionScriptS3Location", err.(smithy.InvalidParamsError)) @@ -2824,11 +2804,6 @@ func validateOpUpdateFleetInput(v *UpdateFleetInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateFleetInput"} - if v.ComputeCapacity != nil { - if err := validateComputeCapacity(v.ComputeCapacity); err != nil { - invalidParams.AddNested("ComputeCapacity", err.(smithy.InvalidParamsError)) - } - } if v.SessionScriptS3Location != nil { if err := validateS3Location(v.SessionScriptS3Location); err != nil { invalidParams.AddNested("SessionScriptS3Location", err.(smithy.InvalidParamsError)) diff --git a/service/cloudformation/api_op_CreateStack.go b/service/cloudformation/api_op_CreateStack.go index 97355c5495c..0493a669e32 100644 --- a/service/cloudformation/api_op_CreateStack.go +++ b/service/cloudformation/api_op_CreateStack.go @@ -151,12 +151,9 @@ type CreateStackInput struct { // . ResourceTypes []string - // This deletion policy deletes newly created resources, but retains existing - // resources, when a stack operation is rolled back. This ensures new, empty, and - // unused resources are deleted, while critical resources and their data are - // retained. RetainExceptOnCreate can be specified for any resource that supports - // the DeletionPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) - // attribute. + // When set to true , newly created resources are deleted when the operation rolls + // back. This includes newly created resources marked with a deletion policy of + // Retain . Default: false RetainExceptOnCreate *bool // The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role diff --git a/service/cloudformation/api_op_CreateStackSet.go b/service/cloudformation/api_op_CreateStackSet.go index d67c4a21d07..3de60da6c33 100644 --- a/service/cloudformation/api_op_CreateStackSet.go +++ b/service/cloudformation/api_op_CreateStackSet.go @@ -46,7 +46,7 @@ type CreateStackSetInput struct { // Specify an IAM role only if you are using customized administrator roles to // control which users or groups can manage specific stack sets within the same // administrator account. For more information, see Prerequisites: Granting - // Permissions for Stack Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/stacksets-prereqs.html) + // Permissions for Stack Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) // in the CloudFormation User Guide. AdministrationRoleARN *string @@ -94,17 +94,17 @@ type CreateStackSetInput struct { // - AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) // For more information, see Acknowledging IAM Resources in CloudFormation - // Templates (https://docs.aws.amazon.com/AWSCloudFormation/using-iam-template.html#capabilities) + // Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) // . // - CAPABILITY_AUTO_EXPAND Some templates reference macros. If your stack set // template references one or more macros, you must create the stack set directly // from the processed template, without first reviewing the resulting changes in a // change set. To create the stack set directly, you must acknowledge this // capability. For more information, see Using CloudFormation Macros to Perform - // Custom Processing on Templates (https://docs.aws.amazon.com/AWSCloudFormation/template-macros.html) + // Custom Processing on Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) // . Stack sets with service-managed permissions don't currently support the use of - // macros in templates. (This includes the AWS::Include (https://docs.aws.amazon.com/AWSCloudFormation/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) - // and AWS::Serverless (https://docs.aws.amazon.com/AWSCloudFormation/transform-aws-serverless.html) + // macros in templates. (This includes the AWS::Include (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) + // and AWS::Serverless (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) // transforms, which are macros hosted by CloudFormation.) Even if you specify this // capability for a stack set with service-managed permissions, if you reference a // macro in your template the stack set operation will fail. diff --git a/service/cloudformation/api_op_DescribeStacks.go b/service/cloudformation/api_op_DescribeStacks.go index e88e2fef310..fa4ac44d8ad 100644 --- a/service/cloudformation/api_op_DescribeStacks.go +++ b/service/cloudformation/api_op_DescribeStacks.go @@ -46,14 +46,15 @@ type DescribeStacksInput struct { NextToken *string // If you don't pass a parameter to StackName , the API returns a response that - // describes all resources in the account. This requires ListStacks and - // DescribeStacks permissions. The IAM policy below can be added to IAM policies - // when you want to limit resource-level permissions and avoid returning a response - // when no parameter is sent in the request: { "Version": "2012-10-17", - // "Statement": [{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", - // "NotResource": "arn:aws:cloudformation:*:*:stack/*/*" }] } The name or the - // unique stack ID that's associated with the stack, which aren't always - // interchangeable: + // describes all resources in the account, which can impact performance. This + // requires ListStacks and DescribeStacks permissions. Consider using the + // ListStacks API if you're not passing a parameter to StackName . The IAM policy + // below can be added to IAM policies when you want to limit resource-level + // permissions and avoid returning a response when no parameter is sent in the + // request: { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": + // "cloudformation:DescribeStacks", "NotResource": + // "arn:aws:cloudformation:*:*:stack/*/*" }] } The name or the unique stack ID + // that's associated with the stack, which aren't always interchangeable: // - Running stacks: You can specify either the stack's name or its unique stack // ID. // - Deleted stacks: You must specify the unique stack ID. diff --git a/service/cloudformation/api_op_ExecuteChangeSet.go b/service/cloudformation/api_op_ExecuteChangeSet.go index 8cd73c44187..12e0dc0b679 100644 --- a/service/cloudformation/api_op_ExecuteChangeSet.go +++ b/service/cloudformation/api_op_ExecuteChangeSet.go @@ -68,12 +68,9 @@ type ExecuteChangeSetInput struct { // Default: True DisableRollback *bool - // This deletion policy deletes newly created resources, but retains existing - // resources, when a stack operation is rolled back. This ensures new, empty, and - // unused resources are deleted, while critical resources and their data are - // retained. RetainExceptOnCreate can be specified for any resource that supports - // the DeletionPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) - // attribute. + // When set to true , newly created resources are deleted when the operation rolls + // back. This includes newly created resources marked with a deletion policy of + // Retain . Default: false RetainExceptOnCreate *bool // If you specified the name of a change set, specify the stack name or Amazon diff --git a/service/cloudformation/api_op_RollbackStack.go b/service/cloudformation/api_op_RollbackStack.go index e0d5f5f07fd..0b8b03efd66 100644 --- a/service/cloudformation/api_op_RollbackStack.go +++ b/service/cloudformation/api_op_RollbackStack.go @@ -52,12 +52,9 @@ type RollbackStackInput struct { // A unique identifier for this RollbackStack request. ClientRequestToken *string - // This deletion policy deletes newly created resources, but retains existing - // resources, when a stack operation is rolled back. This ensures new, empty, and - // unused resources are deleted, while critical resources and their data are - // retained. RetainExceptOnCreate can be specified for any resource that supports - // the DeletionPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) - // attribute. + // When set to true , newly created resources are deleted when the operation rolls + // back. This includes newly created resources marked with a deletion policy of + // Retain . Default: false RetainExceptOnCreate *bool // The Amazon Resource Name (ARN) of an Identity and Access Management role that diff --git a/service/cloudformation/api_op_UpdateStack.go b/service/cloudformation/api_op_UpdateStack.go index 2975a6dcce1..311570ba9f7 100644 --- a/service/cloudformation/api_op_UpdateStack.go +++ b/service/cloudformation/api_op_UpdateStack.go @@ -133,12 +133,9 @@ type UpdateStackInput struct { // . ResourceTypes []string - // This deletion policy deletes newly created resources, but retains existing - // resources, when a stack operation is rolled back. This ensures new, empty, and - // unused resources are deleted, while critical resources and their data are - // retained. RetainExceptOnCreate can be specified for any resource that supports - // the DeletionPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) - // attribute. + // When set to true , newly created resources are deleted when the operation rolls + // back. This includes newly created resources marked with a deletion policy of + // Retain . Default: false RetainExceptOnCreate *bool // The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role diff --git a/service/cloudformation/api_op_UpdateStackSet.go b/service/cloudformation/api_op_UpdateStackSet.go index 686b840b021..255087d3ee6 100644 --- a/service/cloudformation/api_op_UpdateStackSet.go +++ b/service/cloudformation/api_op_UpdateStackSet.go @@ -62,7 +62,7 @@ type UpdateStackSetInput struct { // Specify an IAM role only if you are using customized administrator roles to // control which users or groups can manage specific stack sets within the same // administrator account. For more information, see Granting Permissions for Stack - // Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/stacksets-prereqs.html) + // Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) // in the CloudFormation User Guide. If you specified a customized administrator // role when you created the stack set, you must specify a customized administrator // role, even if it is the same customized administrator role used with this stack @@ -111,17 +111,17 @@ type UpdateStackSetInput struct { // - AWS::IAM::User (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html) // - AWS::IAM::UserToGroupAddition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html) // For more information, see Acknowledging IAM Resources in CloudFormation - // Templates (https://docs.aws.amazon.com/AWSCloudFormation/using-iam-template.html#capabilities) + // Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities) // . // - CAPABILITY_AUTO_EXPAND Some templates reference macros. If your stack set // template references one or more macros, you must update the stack set directly // from the processed template, without first reviewing the resulting changes in a // change set. To update the stack set directly, you must acknowledge this // capability. For more information, see Using CloudFormation Macros to Perform - // Custom Processing on Templates (https://docs.aws.amazon.com/AWSCloudFormation/template-macros.html) + // Custom Processing on Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) // . Stack sets with service-managed permissions do not currently support the use - // of macros in templates. (This includes the AWS::Include (https://docs.aws.amazon.com/AWSCloudFormation/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) - // and AWS::Serverless (https://docs.aws.amazon.com/AWSCloudFormation/transform-aws-serverless.html) + // of macros in templates. (This includes the AWS::Include (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html) + // and AWS::Serverless (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html) // transforms, which are macros hosted by CloudFormation.) Even if you specify this // capability for a stack set with service-managed permissions, if you reference a // macro in your template the stack set operation will fail. diff --git a/service/cloudformation/types/types.go b/service/cloudformation/types/types.go index f0f10ab94a4..43d264c1a58 100644 --- a/service/cloudformation/types/types.go +++ b/service/cloudformation/types/types.go @@ -835,12 +835,9 @@ type Stack struct { // in the CloudFormation User Guide. ParentId *string - // This deletion policy deletes newly created resources, but retains existing - // resources, when a stack operation is rolled back. This ensures new, empty, and - // unused resources are deleted, while critical resources and their data are - // retained. RetainExceptOnCreate can be specified for any resource that supports - // the DeletionPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) - // attribute. + // When set to true , newly created resources are deleted when the operation rolls + // back. This includes newly created resources marked with a deletion policy of + // Retain . Default: false RetainExceptOnCreate *bool // The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role @@ -1559,7 +1556,7 @@ type StackSet struct { // The Amazon Resource Name (ARN) of the IAM role used to create or update the // stack set. Use customized administrator roles to control which users or groups // can manage specific stack sets within the same administrator account. For more - // information, see Prerequisites: Granting Permissions for Stack Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/stacksets-prereqs.html) + // information, see Prerequisites: Granting Permissions for Stack Set Operations (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) // in the CloudFormation User Guide. AdministrationRoleARN *string @@ -1718,7 +1715,7 @@ type StackSetOperation struct { // The Amazon Resource Name (ARN) of the IAM role used to perform this stack set // operation. Use customized administrator roles to control which users or groups // can manage specific stack sets within the same administrator account. For more - // information, see Define Permissions for Multiple Administrators (https://docs.aws.amazon.com/AWSCloudFormation/stacksets-prereqs.html) + // information, see Define Permissions for Multiple Administrators (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html) // in the CloudFormation User Guide. AdministrationRoleARN *string diff --git a/service/entityresolution/api_op_CreateMatchingWorkflow.go b/service/entityresolution/api_op_CreateMatchingWorkflow.go index 5cb8e2b685c..f65caf41dd8 100644 --- a/service/entityresolution/api_op_CreateMatchingWorkflow.go +++ b/service/entityresolution/api_op_CreateMatchingWorkflow.go @@ -49,13 +49,13 @@ type CreateMatchingWorkflowInput struct { // This member is required. OutputSourceConfig []types.OutputSource - // An object which defines the resolutionType and the ruleBasedProperties + // An object which defines the resolutionType and the ruleBasedProperties . // // This member is required. ResolutionTechniques *types.ResolutionTechniques - // The Amazon Resource Name (ARN) of the IAM role. AWS Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. + // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes this + // role to create resources on your behalf as part of workflow execution. // // This member is required. RoleArn *string @@ -93,13 +93,13 @@ type CreateMatchingWorkflowOutput struct { // This member is required. OutputSourceConfig []types.OutputSource - // An object which defines the resolutionType and the ruleBasedProperties + // An object which defines the resolutionType and the ruleBasedProperties . // // This member is required. ResolutionTechniques *types.ResolutionTechniques - // The Amazon Resource Name (ARN) of the IAM role. AWS Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. + // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes this + // role to create resources on your behalf as part of workflow execution. // // This member is required. RoleArn *string diff --git a/service/entityresolution/api_op_CreateSchemaMapping.go b/service/entityresolution/api_op_CreateSchemaMapping.go index 5603a625c9e..9d8f34d74d6 100644 --- a/service/entityresolution/api_op_CreateSchemaMapping.go +++ b/service/entityresolution/api_op_CreateSchemaMapping.go @@ -37,6 +37,13 @@ func (c *Client) CreateSchemaMapping(ctx context.Context, params *CreateSchemaMa type CreateSchemaMappingInput struct { + // A list of MappedInputFields . Each MappedInputField corresponds to a column the + // source data table, and contains column name plus additional information that + // Entity Resolution uses for matching. + // + // This member is required. + MappedInputFields []types.SchemaInputAttribute + // The name of the schema. There cannot be multiple SchemaMappings with the same // name. // @@ -46,11 +53,6 @@ type CreateSchemaMappingInput struct { // A description of the schema. Description *string - // A list of MappedInputFields . Each MappedInputField corresponds to a column the - // source data table, and contains column name plus additional information that - // Entity Resolution uses for matching. - MappedInputFields []types.SchemaInputAttribute - // The tags used to organize, track, or control access for this resource. Tags map[string]string diff --git a/service/entityresolution/api_op_GetMatchingJob.go b/service/entityresolution/api_op_GetMatchingJob.go index 948f298dac3..8b172955812 100644 --- a/service/entityresolution/api_op_GetMatchingJob.go +++ b/service/entityresolution/api_op_GetMatchingJob.go @@ -61,7 +61,7 @@ type GetMatchingJobOutput struct { // This member is required. StartTime *time.Time - // The current status of the job. Either running , succeeded , queued , or failed . + // The current status of the job. // // This member is required. Status types.JobStatus diff --git a/service/entityresolution/api_op_GetMatchingWorkflow.go b/service/entityresolution/api_op_GetMatchingWorkflow.go index cd8aa7929ad..d252e6d1f5a 100644 --- a/service/entityresolution/api_op_GetMatchingWorkflow.go +++ b/service/entityresolution/api_op_GetMatchingWorkflow.go @@ -62,13 +62,13 @@ type GetMatchingWorkflowOutput struct { // This member is required. OutputSourceConfig []types.OutputSource - // An object which defines the resolutionType and the ruleBasedProperties + // An object which defines the resolutionType and the ruleBasedProperties . // // This member is required. ResolutionTechniques *types.ResolutionTechniques - // The Amazon Resource Name (ARN) of the IAM role. AWS Entity Resolution assumes - // this role to access resources on your behalf. + // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes this + // role to access resources on your behalf. // // This member is required. RoleArn *string diff --git a/service/entityresolution/api_op_ListMatchingWorkflows.go b/service/entityresolution/api_op_ListMatchingWorkflows.go index b5fa329ae3e..f769a035282 100644 --- a/service/entityresolution/api_op_ListMatchingWorkflows.go +++ b/service/entityresolution/api_op_ListMatchingWorkflows.go @@ -16,8 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all the MatchingWorkflows that have been created for an AWS -// account. +// Returns a list of all the MatchingWorkflows that have been created for an +// Amazon Web Services account. func (c *Client) ListMatchingWorkflows(ctx context.Context, params *ListMatchingWorkflowsInput, optFns ...func(*Options)) (*ListMatchingWorkflowsOutput, error) { if params == nil { params = &ListMatchingWorkflowsInput{} diff --git a/service/entityresolution/api_op_ListSchemaMappings.go b/service/entityresolution/api_op_ListSchemaMappings.go index 8223a5ce0c9..4cf6e2f8ba6 100644 --- a/service/entityresolution/api_op_ListSchemaMappings.go +++ b/service/entityresolution/api_op_ListSchemaMappings.go @@ -16,8 +16,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all the SchemaMappings that have been created for an AWS -// account. +// Returns a list of all the SchemaMappings that have been created for an Amazon +// Web Services account. func (c *Client) ListSchemaMappings(ctx context.Context, params *ListSchemaMappingsInput, optFns ...func(*Options)) (*ListSchemaMappingsOutput, error) { if params == nil { params = &ListSchemaMappingsInput{} diff --git a/service/entityresolution/api_op_ListTagsForResource.go b/service/entityresolution/api_op_ListTagsForResource.go index ca2b30d2a96..4d6b89fb924 100644 --- a/service/entityresolution/api_op_ListTagsForResource.go +++ b/service/entityresolution/api_op_ListTagsForResource.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Displays the tags associated with an AWS Entity Resolution resource. In Entity +// Displays the tags associated with an Entity Resolution resource. In Entity // Resolution, SchemaMapping , and MatchingWorkflow can be tagged. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { diff --git a/service/entityresolution/api_op_TagResource.go b/service/entityresolution/api_op_TagResource.go index 1fb0761e514..aca64da0827 100644 --- a/service/entityresolution/api_op_TagResource.go +++ b/service/entityresolution/api_op_TagResource.go @@ -15,17 +15,17 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Assigns one or more tags (key-value pairs) to the specified AWS Entity -// Resolution resource. Tags can help you organize and categorize your resources. -// You can also use them to scope user permissions by granting a user permission to -// access or change only resources with certain tag values. In Entity Resolution, -// SchemaMapping , and MatchingWorkflow can be tagged. Tags don't have any -// semantic meaning to AWS and are interpreted strictly as strings of characters. -// You can use the TagResource action with a resource that already has tags. If -// you specify a new tag key, this tag is appended to the list of tags associated -// with the resource. If you specify a tag key that is already associated with the -// resource, the new tag value that you specify replaces the previous value for -// that tag. +// Assigns one or more tags (key-value pairs) to the specified Entity Resolution +// resource. Tags can help you organize and categorize your resources. You can also +// use them to scope user permissions by granting a user permission to access or +// change only resources with certain tag values. In Entity Resolution, +// SchemaMapping and MatchingWorkflow can be tagged. Tags don't have any semantic +// meaning to Amazon Web Services and are interpreted strictly as strings of +// characters. You can use the TagResource action with a resource that already has +// tags. If you specify a new tag key, this tag is appended to the list of tags +// associated with the resource. If you specify a tag key that is already +// associated with the resource, the new tag value that you specify replaces the +// previous value for that tag. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} diff --git a/service/entityresolution/api_op_UntagResource.go b/service/entityresolution/api_op_UntagResource.go index 37cc80ee235..554f77efd25 100644 --- a/service/entityresolution/api_op_UntagResource.go +++ b/service/entityresolution/api_op_UntagResource.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes one or more tags from the specified AWS Entity Resolution resource. In +// Removes one or more tags from the specified Entity Resolution resource. In // Entity Resolution, SchemaMapping , and MatchingWorkflow can be tagged. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { diff --git a/service/entityresolution/api_op_UpdateMatchingWorkflow.go b/service/entityresolution/api_op_UpdateMatchingWorkflow.go index 28b8a1e21af..586fcdbd5da 100644 --- a/service/entityresolution/api_op_UpdateMatchingWorkflow.go +++ b/service/entityresolution/api_op_UpdateMatchingWorkflow.go @@ -48,13 +48,13 @@ type UpdateMatchingWorkflowInput struct { // This member is required. OutputSourceConfig []types.OutputSource - // An object which defines the resolutionType and the ruleBasedProperties + // An object which defines the resolutionType and the ruleBasedProperties . // // This member is required. ResolutionTechniques *types.ResolutionTechniques - // The Amazon Resource Name (ARN) of the IAM role. AWS Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. + // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes this + // role to create resources on your behalf as part of workflow execution. // // This member is required. RoleArn *string @@ -93,8 +93,8 @@ type UpdateMatchingWorkflowOutput struct { // This member is required. ResolutionTechniques *types.ResolutionTechniques - // The Amazon Resource Name (ARN) of the IAM role. AWS Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. + // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes this + // role to create resources on your behalf as part of workflow execution. // // This member is required. RoleArn *string diff --git a/service/entityresolution/deserializers.go b/service/entityresolution/deserializers.go index 344fdde9623..73ef1b28bed 100644 --- a/service/entityresolution/deserializers.go +++ b/service/entityresolution/deserializers.go @@ -3190,6 +3190,28 @@ func awsRestjson1_deserializeDocumentExceedsLimitException(v **types.ExceedsLimi sv.Message = ptr.String(jtv) } + case "quotaName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaName = ptr.String(jtv) + } + + case "quotaValue": + 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.QuotaValue = ptr.Int32(int32(i64)) + } + default: _, _ = key, value @@ -3852,7 +3874,7 @@ func awsRestjson1_deserializeDocumentOutputSource(v **types.OutputSource, value if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected S3Path to be of type string, got %T instead", value) } sv.OutputS3Path = ptr.String(jtv) } diff --git a/service/entityresolution/doc.go b/service/entityresolution/doc.go index 7c3f9ad6187..464ac903885 100644 --- a/service/entityresolution/doc.go +++ b/service/entityresolution/doc.go @@ -3,18 +3,16 @@ // Package entityresolution provides the API client, operations, and parameter // types for AWS EntityResolution. // -// Welcome to the AWS Entity Resolution API Reference. AWS Entity Resolution is an -// AWS service that provides pre-configured entity resolution capabilities that -// enable developers and analysts at advertising and marketing companies to build -// an accurate and complete view of their consumers. With AWS Entity Resolution, -// you have the ability to match source records containing consumer identifiers, -// such as name, email address, and phone number. This holds true even when these -// records have incomplete or conflicting identifiers. For example, AWS Entity -// Resolution can effectively match a source record from a customer relationship -// management (CRM) system, which includes account information like first name, -// last name, postal address, phone number, and email address, with a source record -// from a marketing system containing campaign information, such as username and -// email address. To learn more about AWS Entity Resolution concepts, procedures, -// and best practices, see the AWS Entity Resolution User Guide (https://docs.aws.amazon.com/entityresolution/latest/userguide/what-is-service.html) +// Welcome to the Entity Resolution API Reference. Entity Resolution is an Amazon +// Web Services service that provides pre-configured entity resolution capabilities +// that enable developers and analysts at advertising and marketing companies to +// build an accurate and complete view of their consumers. With Entity Resolution, +// you can match source records containing consumer identifiers, such as name, +// email address, and phone number. This is true even when these records have +// incomplete or conflicting identifiers. For example, Entity Resolution can +// effectively match a source record from a customer relationship management (CRM) +// system with a source record from a marketing system containing campaign +// information. To learn more about Entity Resolution concepts, procedures, and +// best practices, see the Entity Resolution User Guide (https://docs.aws.amazon.com/entityresolution/latest/userguide/what-is-service.html) // . package entityresolution diff --git a/service/entityresolution/endpoints_test.go b/service/entityresolution/endpoints_test.go index 9b4f69bbd0a..91e02ac796f 100644 --- a/service/entityresolution/endpoints_test.go +++ b/service/entityresolution/endpoints_test.go @@ -14,12 +14,12 @@ import ( "testing" ) -// For region us-gov-east-1 with FIPS enabled and DualStack enabled +// For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase0(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -30,7 +30,7 @@ func TestEndpointCase0(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://entityresolution-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -53,12 +53,12 @@ func TestEndpointCase0(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack disabled +// For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -69,7 +69,7 @@ func TestEndpointCase1(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://entityresolution-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -92,12 +92,12 @@ func TestEndpointCase1(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled +// For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(true), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -108,7 +108,7 @@ func TestEndpointCase2(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://entityresolution.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -131,12 +131,12 @@ func TestEndpointCase2(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled +// For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -147,7 +147,7 @@ func TestEndpointCase3(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://entityresolution.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -174,8 +174,8 @@ func TestEndpointCase3(t *testing.T) { func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -213,8 +213,8 @@ func TestEndpointCase4(t *testing.T) { func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -252,8 +252,8 @@ func TestEndpointCase5(t *testing.T) { func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -291,8 +291,8 @@ func TestEndpointCase6(t *testing.T) { func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("cn-north-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -326,32 +326,12 @@ func TestEndpointCase7(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack enabled +// For region us-gov-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-gov-east-1"), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -362,7 +342,7 @@ func TestEndpointCase9(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution-fips.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://entityresolution-fips.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -385,32 +365,12 @@ func TestEndpointCase9(t *testing.T) { } } -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -421,7 +381,7 @@ func TestEndpointCase11(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://entityresolution-fips.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -444,12 +404,12 @@ func TestEndpointCase11(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -460,7 +420,7 @@ func TestEndpointCase12(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://entityresolution.us-gov-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -483,12 +443,12 @@ func TestEndpointCase12(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), - UseFIPS: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -499,7 +459,7 @@ func TestEndpointCase13(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://entityresolution.us-gov-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -522,12 +482,32 @@ func TestEndpointCase13(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), - UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -538,7 +518,7 @@ func TestEndpointCase14(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution.us-east-1.api.aws") + uri, _ := url.Parse("https://entityresolution-fips.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -561,12 +541,32 @@ func TestEndpointCase14(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack disabled +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -577,7 +577,7 @@ func TestEndpointCase15(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://entityresolution.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://entityresolution.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -604,8 +604,8 @@ func TestEndpointCase15(t *testing.T) { func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -624,8 +624,8 @@ func TestEndpointCase16(t *testing.T) { func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -663,8 +663,8 @@ func TestEndpointCase17(t *testing.T) { func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -683,8 +683,8 @@ func TestEndpointCase18(t *testing.T) { func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -718,12 +718,51 @@ func TestEndpointCase19(t *testing.T) { } } -// For custom endpoint with fips disabled and dualstack disabled +// For custom endpoint with region set and fips disabled and dualstack disabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), + Endpoint: ptr.String("https://example.com"), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { + t.Errorf("expect headers to match\n%s", diff) + } + + if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, + cmp.AllowUnexported(smithy.Properties{}), + ); diff != "" { + t.Errorf("expect properties to match\n%s", diff) + } +} + +// For custom endpoint with region not set and fips disabled and dualstack disabled +func TestEndpointCase21(t *testing.T) { + var params = EndpointParameters{ UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -759,11 +798,11 @@ func TestEndpointCase20(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { +func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(false), UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), Endpoint: ptr.String("https://example.com"), } @@ -780,11 +819,11 @@ func TestEndpointCase21(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase22(t *testing.T) { +func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), - UseDualStack: ptr.Bool(true), UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), Endpoint: ptr.String("https://example.com"), } @@ -799,3 +838,19 @@ func TestEndpointCase22(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Missing region +func TestEndpointCase24(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/entityresolution/types/errors.go b/service/entityresolution/types/errors.go index 28befab7c5d..e453d4154e3 100644 --- a/service/entityresolution/types/errors.go +++ b/service/entityresolution/types/errors.go @@ -62,13 +62,16 @@ func (e *ConflictException) ErrorCode() string { func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was rejected because it attempted to create resources beyond the -// current AWS Entity Resolution account limits. The error message describes the -// limit exceeded. HTTP Status Code: 402 +// current Entity Resolution account limits. The error message describes the limit +// exceeded. HTTP Status Code: 402 type ExceedsLimitException struct { Message *string ErrorCodeOverride *string + QuotaName *string + QuotaValue *int32 + noSmithyDocumentSerde } @@ -89,7 +92,7 @@ func (e *ExceedsLimitException) ErrorCode() string { } func (e *ExceedsLimitException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// This exception occurs when there is an internal failure in the AWS Entity +// This exception occurs when there is an internal failure in the Entity // Resolution service. HTTP Status Code: 500 type InternalServerException struct { Message *string @@ -168,8 +171,8 @@ func (e *ThrottlingException) ErrorCode() string { } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The input fails to satisfy the constraints specified by AWS Entity Resolution. -// HTTP Status Code: 400 +// The input fails to satisfy the constraints specified by Entity Resolution. HTTP +// Status Code: 400 type ValidationException struct { Message *string diff --git a/service/entityresolution/types/types.go b/service/entityresolution/types/types.go index 034daf8be8b..f6b93b2ff72 100644 --- a/service/entityresolution/types/types.go +++ b/service/entityresolution/types/types.go @@ -58,7 +58,7 @@ type JobMetrics struct { // The total number of matchID s generated. MatchIDs *int32 - // The total number of records that did not get processed, + // The total number of records that did not get processed. RecordsNotProcessed *int32 // The total number of records processed. @@ -80,7 +80,7 @@ type JobSummary struct { // This member is required. StartTime *time.Time - // The current status of the job. Either running , succeeded , queued , or failed . + // The current status of the job. // // This member is required. Status JobStatus @@ -119,9 +119,9 @@ type MatchingWorkflowSummary struct { noSmithyDocumentSerde } -// A list of OutputAttribute objects, each of which have the fields Name and -// Hashed. Each of these objects selects a column to be included in the output -// table, and whether the values of the column should be hashed. +// A list of OutputAttribute objects, each of which have the fields Name and Hashed +// . Each of these objects selects a column to be included in the output table, and +// whether the values of the column should be hashed. type OutputAttribute struct { // A name of a column to be written to the output. This must be an InputField name @@ -136,14 +136,14 @@ type OutputAttribute struct { noSmithyDocumentSerde } -// A list of OutputAttribute objects, each of which have the fields Name and -// Hashed. Each of these objects selects a column to be included in the output -// table, and whether the values of the column should be hashed. +// A list of OutputAttribute objects, each of which have the fields Name and Hashed +// . Each of these objects selects a column to be included in the output table, and +// whether the values of the column should be hashed. type OutputSource struct { - // A list of OutputAttribute objects, each of which have the fields Name and - // Hashed. Each of these objects selects a column to be included in the output - // table, and whether the values of the column should be hashed. + // A list of OutputAttribute objects, each of which have the fields Name and Hashed + // . Each of these objects selects a column to be included in the output table, and + // whether the values of the column should be hashed. // // This member is required. Output []OutputAttribute @@ -166,10 +166,13 @@ type OutputSource struct { noSmithyDocumentSerde } -// An object which defines the resolutionType and the ruleBasedProperties +// An object which defines the resolutionType and the ruleBasedProperties . type ResolutionTechniques struct { - // There are two types of matching, RULE_MATCHING and ML_MATCHING + // The type of matching. There are two types of matching: RULE_MATCHING and + // ML_MATCHING . + // + // This member is required. ResolutionType ResolutionType // An object which defines the list of matching rules to run and has a field Rules @@ -201,14 +204,15 @@ type Rule struct { // , which is a list of rule objects. type RuleBasedProperties struct { - // You can either choose ONE_TO_ONE or MANY_TO_MANY as the AttributeMatchingModel. - // When choosing MANY_TO_MANY , the system can match attribute across the sub-types - // of an attribute type. For example, if the value of the Email field of Profile A - // and the value of BusinessEmail field of Profile B matches, the two profiles are - // matched on the Email type. When choosing ONE_TO_ONE the system can only match - // if the sub-types are exact matches. For example, only when the value of the - // Email field of Profile A and the value of the Email field of Profile B matches, - // the two profiles are matched on the Email type. + // The comparison type. You can either choose ONE_TO_ONE or MANY_TO_MANY as the + // AttributeMatchingModel. When choosing MANY_TO_MANY , the system can match + // attributes across the sub-types of an attribute type. For example, if the value + // of the Email field of Profile A and the value of BusinessEmail field of Profile + // B matches, the two profiles are matched on the Email type. When choosing + // ONE_TO_ONE ,the system can only match if the sub-types are exact matches. For + // example, only when the value of the Email field of Profile A and the value of + // the Email field of Profile B matches, the two profiles are matched on the Email + // type. // // This member is required. AttributeMatchingModel AttributeMatchingModel @@ -243,7 +247,7 @@ type SchemaInputAttribute struct { // A key that allows grouping of multiple input attributes into a unified matching // group. For example, let's consider a scenario where the source table contains // various addresses, such as business_address and shipping_address. By assigning - // the MatchKey Address' to both attributes, Entity Resolution will match records + // the MatchKey Address to both attributes, Entity Resolution will match records // across these fields to create a consolidated matching group. If no MatchKey is // specified for a column, it won't be utilized for matching purposes but will // still be included in the output table. diff --git a/service/entityresolution/validators.go b/service/entityresolution/validators.go index 5a8ebc72ce3..58701e78d75 100644 --- a/service/entityresolution/validators.go +++ b/service/entityresolution/validators.go @@ -457,6 +457,9 @@ func validateResolutionTechniques(v *types.ResolutionTechniques) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "ResolutionTechniques"} + if len(v.ResolutionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ResolutionType")) + } if v.RuleBasedProperties != nil { if err := validateRuleBasedProperties(v.RuleBasedProperties); err != nil { invalidParams.AddNested("RuleBasedProperties", err.(smithy.InvalidParamsError)) @@ -608,7 +611,9 @@ func validateOpCreateSchemaMappingInput(v *CreateSchemaMappingInput) error { if v.SchemaName == nil { invalidParams.Add(smithy.NewErrParamRequired("SchemaName")) } - if v.MappedInputFields != nil { + if v.MappedInputFields == nil { + invalidParams.Add(smithy.NewErrParamRequired("MappedInputFields")) + } else if v.MappedInputFields != nil { if err := validateSchemaInputAttributes(v.MappedInputFields); err != nil { invalidParams.AddNested("MappedInputFields", err.(smithy.InvalidParamsError)) } diff --git a/service/lookoutequipment/api_op_CreateInferenceScheduler.go b/service/lookoutequipment/api_op_CreateInferenceScheduler.go index 47b77121ca4..ddfee545d75 100644 --- a/service/lookoutequipment/api_op_CreateInferenceScheduler.go +++ b/service/lookoutequipment/api_op_CreateInferenceScheduler.go @@ -73,8 +73,8 @@ type CreateInferenceSchedulerInput struct { // This member is required. InferenceSchedulerName *string - // The name of the previously trained ML model being used to create the inference - // scheduler. + // The name of the previously trained machine learning model being used to create + // the inference scheduler. // // This member is required. ModelName *string diff --git a/service/lookoutequipment/api_op_CreateModel.go b/service/lookoutequipment/api_op_CreateModel.go index 38677c9a993..494a87e26b4 100644 --- a/service/lookoutequipment/api_op_CreateModel.go +++ b/service/lookoutequipment/api_op_CreateModel.go @@ -17,15 +17,15 @@ import ( "time" ) -// Creates an ML model for data inference. A machine-learning (ML) model is a -// mathematical model that finds patterns in your data. In Amazon Lookout for -// Equipment, the model learns the patterns of normal behavior and detects abnormal -// behavior that could be potential equipment failure (or maintenance events). The -// models are made by analyzing normal data and abnormalities in machine behavior -// that have already occurred. Your model is trained using a portion of the data -// from your dataset and uses that data to learn patterns of normal behavior and -// abnormal patterns that lead to equipment failure. Another portion of the data is -// used to evaluate the model's accuracy. +// Creates a machine learning model for data inference. A machine-learning (ML) +// model is a mathematical model that finds patterns in your data. In Amazon +// Lookout for Equipment, the model learns the patterns of normal behavior and +// detects abnormal behavior that could be potential equipment failure (or +// maintenance events). The models are made by analyzing normal data and +// abnormalities in machine behavior that have already occurred. Your model is +// trained using a portion of the data from your dataset and uses that data to +// learn patterns of normal behavior and abnormal patterns that lead to equipment +// failure. Another portion of the data is used to evaluate the model's accuracy. func (c *Client) CreateModel(ctx context.Context, params *CreateModelInput, optFns ...func(*Options)) (*CreateModelOutput, error) { if params == nil { params = &CreateModelInput{} @@ -49,12 +49,12 @@ type CreateModelInput struct { // This member is required. ClientToken *string - // The name of the dataset for the ML model being created. + // The name of the dataset for the machine learning model being created. // // This member is required. DatasetName *string - // The name for the ML model to be created. + // The name for the machine learning model to be created. // // This member is required. ModelName *string @@ -69,19 +69,19 @@ type CreateModelInput struct { // is PT1H DataPreProcessingConfiguration *types.DataPreProcessingConfiguration - // The data schema for the ML model being created. + // The data schema for the machine learning model being created. DatasetSchema *types.DatasetSchema // Indicates the time reference in the dataset that should be used to end the - // subset of evaluation data for the ML model. + // subset of evaluation data for the machine learning model. EvaluationDataEndTime *time.Time // Indicates the time reference in the dataset that should be used to begin the - // subset of evaluation data for the ML model. + // subset of evaluation data for the machine learning model. EvaluationDataStartTime *time.Time - // The input configuration for the labels being used for the ML model that's being - // created. + // The input configuration for the labels being used for the machine learning + // model that's being created. LabelsInputConfiguration *types.LabelsInputConfiguration // Indicates that the asset associated with this sensor has been shut off. As long @@ -90,22 +90,22 @@ type CreateModelInput struct { OffCondition *string // The Amazon Resource Name (ARN) of a role with permission to access the data - // source being used to create the ML model. + // source being used to create the machine learning model. RoleArn *string // Provides the identifier of the KMS key used to encrypt model data by Amazon // Lookout for Equipment. ServerSideKmsKeyId *string - // Any tags associated with the ML model being created. + // Any tags associated with the machine learning model being created. Tags []types.Tag // Indicates the time reference in the dataset that should be used to end the - // subset of training data for the ML model. + // subset of training data for the machine learning model. TrainingDataEndTime *time.Time // Indicates the time reference in the dataset that should be used to begin the - // subset of training data for the ML model. + // subset of training data for the machine learning model. TrainingDataStartTime *time.Time noSmithyDocumentSerde diff --git a/service/lookoutequipment/api_op_CreateRetrainingScheduler.go b/service/lookoutequipment/api_op_CreateRetrainingScheduler.go new file mode 100644 index 00000000000..d04003b00b9 --- /dev/null +++ b/service/lookoutequipment/api_op_CreateRetrainingScheduler.go @@ -0,0 +1,338 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a retraining scheduler on the specified model. +func (c *Client) CreateRetrainingScheduler(ctx context.Context, params *CreateRetrainingSchedulerInput, optFns ...func(*Options)) (*CreateRetrainingSchedulerOutput, error) { + if params == nil { + params = &CreateRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRetrainingScheduler", params, optFns, c.addOperationCreateRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRetrainingSchedulerInput struct { + + // A unique identifier for the request. If you do not set the client request + // token, Amazon Lookout for Equipment generates one. + // + // This member is required. + ClientToken *string + + // The number of past days of data that will be used for retraining. + // + // This member is required. + LookbackWindow *string + + // The name of the model to add the retraining scheduler to. + // + // This member is required. + ModelName *string + + // This parameter uses the ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601#Durations) + // standard to set the frequency at which you want retraining to occur in terms of + // Years, Months, and/or Days (note: other parameters like Time are not currently + // supported). The minimum value is 30 days (P30D) and the maximum value is 1 year + // (P1Y). For example, the following values are valid: + // - P3M15D – Every 3 months and 15 days + // - P2M – Every 2 months + // - P150D – Every 150 days + // + // This member is required. + RetrainingFrequency *string + + // Indicates how the service will use new models. In MANAGED mode, new models will + // automatically be used for inference if they have better performance than the + // current model. In MANUAL mode, the new models will not be used until they are + // manually activated (https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/versioning-model.html#model-activation) + // . + PromoteMode types.ModelPromoteMode + + // The start date for the retraining scheduler. Lookout for Equipment truncates + // the time you provide to the nearest UTC day. + RetrainingStartDate *time.Time + + noSmithyDocumentSerde +} + +type CreateRetrainingSchedulerOutput struct { + + // The ARN of the model that you added the retraining scheduler to. + ModelArn *string + + // The name of the model that you added the retraining scheduler to. + ModelName *string + + // The status of the retraining scheduler. + Status types.RetrainingSchedulerStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addCreateRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateRetrainingSchedulerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateRetrainingScheduler struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateRetrainingScheduler) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateRetrainingSchedulerInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateRetrainingSchedulerMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateRetrainingScheduler{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "CreateRetrainingScheduler", + } +} + +type opCreateRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_DeleteInferenceScheduler.go b/service/lookoutequipment/api_op_DeleteInferenceScheduler.go index c2a8b9bfd8b..69b931dc501 100644 --- a/service/lookoutequipment/api_op_DeleteInferenceScheduler.go +++ b/service/lookoutequipment/api_op_DeleteInferenceScheduler.go @@ -15,8 +15,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an inference scheduler that has been set up. Already processed output -// results are not affected. +// Deletes an inference scheduler that has been set up. Prior inference results +// will not be deleted. func (c *Client) DeleteInferenceScheduler(ctx context.Context, params *DeleteInferenceSchedulerInput, optFns ...func(*Options)) (*DeleteInferenceSchedulerOutput, error) { if params == nil { params = &DeleteInferenceSchedulerInput{} diff --git a/service/lookoutequipment/api_op_DeleteModel.go b/service/lookoutequipment/api_op_DeleteModel.go index 6bf8bbffd1a..52fac26cf47 100644 --- a/service/lookoutequipment/api_op_DeleteModel.go +++ b/service/lookoutequipment/api_op_DeleteModel.go @@ -15,9 +15,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes an ML model currently available for Amazon Lookout for Equipment. This -// will prevent it from being used with an inference scheduler, even one that is -// already set up. +// Deletes a machine learning model currently available for Amazon Lookout for +// Equipment. This will prevent it from being used with an inference scheduler, +// even one that is already set up. func (c *Client) DeleteModel(ctx context.Context, params *DeleteModelInput, optFns ...func(*Options)) (*DeleteModelOutput, error) { if params == nil { params = &DeleteModelInput{} @@ -35,7 +35,7 @@ func (c *Client) DeleteModel(ctx context.Context, params *DeleteModelInput, optF type DeleteModelInput struct { - // The name of the ML model to be deleted. + // The name of the machine learning model to be deleted. // // This member is required. ModelName *string diff --git a/service/lookoutequipment/api_op_DeleteRetrainingScheduler.go b/service/lookoutequipment/api_op_DeleteRetrainingScheduler.go new file mode 100644 index 00000000000..d2cb1c35417 --- /dev/null +++ b/service/lookoutequipment/api_op_DeleteRetrainingScheduler.go @@ -0,0 +1,257 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a retraining scheduler from a model. The retraining scheduler must be +// in the STOPPED status. +func (c *Client) DeleteRetrainingScheduler(ctx context.Context, params *DeleteRetrainingSchedulerInput, optFns ...func(*Options)) (*DeleteRetrainingSchedulerOutput, error) { + if params == nil { + params = &DeleteRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRetrainingScheduler", params, optFns, c.addOperationDeleteRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRetrainingSchedulerInput struct { + + // The name of the model whose retraining scheduler you want to delete. + // + // This member is required. + ModelName *string + + noSmithyDocumentSerde +} + +type DeleteRetrainingSchedulerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addDeleteRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "DeleteRetrainingScheduler", + } +} + +type opDeleteRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_DescribeInferenceScheduler.go b/service/lookoutequipment/api_op_DescribeInferenceScheduler.go index d84637d54fe..1b47cc2c674 100644 --- a/service/lookoutequipment/api_op_DescribeInferenceScheduler.go +++ b/service/lookoutequipment/api_op_DescribeInferenceScheduler.go @@ -85,11 +85,12 @@ type DescribeInferenceSchedulerOutput struct { // Anomalous (anomalous events found) or Normal (no anomalous events found). LatestInferenceResult types.LatestInferenceResult - // The Amazon Resource Name (ARN) of the ML model of the inference scheduler being - // described. + // The Amazon Resource Name (ARN) of the machine learning model of the inference + // scheduler being described. ModelArn *string - // The name of the ML model of the inference scheduler being described. + // The name of the machine learning model of the inference scheduler being + // described. ModelName *string // The Amazon Resource Name (ARN) of a role with permission to access the data diff --git a/service/lookoutequipment/api_op_DescribeModel.go b/service/lookoutequipment/api_op_DescribeModel.go index 2306b205c15..44dca134a00 100644 --- a/service/lookoutequipment/api_op_DescribeModel.go +++ b/service/lookoutequipment/api_op_DescribeModel.go @@ -17,9 +17,9 @@ import ( "time" ) -// Provides a JSON containing the overall information about a specific ML model, -// including model name and ARN, dataset, training and evaluation information, -// status, and so on. +// Provides a JSON containing the overall information about a specific machine +// learning model, including model name and ARN, dataset, training and evaluation +// information, status, and so on. func (c *Client) DescribeModel(ctx context.Context, params *DescribeModelInput, optFns ...func(*Options)) (*DescribeModelOutput, error) { if params == nil { params = &DescribeModelInput{} @@ -37,7 +37,7 @@ func (c *Client) DescribeModel(ctx context.Context, params *DescribeModelInput, type DescribeModelInput struct { - // The name of the ML model to be described. + // The name of the machine learning model to be described. // // This member is required. ModelName *string @@ -47,6 +47,12 @@ type DescribeModelInput struct { type DescribeModelOutput struct { + // Indicates the end time of the inference data that has been accumulated. + AccumulatedInferenceDataEndTime *time.Time + + // Indicates the start time of the inference data that has been accumulated. + AccumulatedInferenceDataStartTime *time.Time + // The name of the model version used by the inference schedular when running a // scheduled inference execution. ActiveModelVersion *int64 @@ -55,7 +61,7 @@ type DescribeModelOutput struct { // scheduler when running a scheduled inference execution. ActiveModelVersionArn *string - // Indicates the time and date at which the ML model was created. + // Indicates the time and date at which the machine learning model was created. CreatedAt *time.Time // The configuration is the TargetSamplingRate , which is the sampling rate of the @@ -68,23 +74,23 @@ type DescribeModelOutput struct { // is PT1H DataPreProcessingConfiguration *types.DataPreProcessingConfiguration - // The Amazon Resouce Name (ARN) of the dataset used to create the ML model being - // described. + // The Amazon Resouce Name (ARN) of the dataset used to create the machine + // learning model being described. DatasetArn *string - // The name of the dataset being used by the ML being described. + // The name of the dataset being used by the machine learning being described. DatasetName *string // Indicates the time reference in the dataset that was used to end the subset of - // evaluation data for the ML model. + // evaluation data for the machine learning model. EvaluationDataEndTime *time.Time // Indicates the time reference in the dataset that was used to begin the subset - // of evaluation data for the ML model. + // of evaluation data for the machine learning model. EvaluationDataStartTime *time.Time - // If the training of the ML model failed, this indicates the reason for that - // failure. + // If the training of the machine learning model failed, this indicates the reason + // for that failure. FailedReason *string // The date and time when the import job was completed. This field appears if the @@ -99,11 +105,28 @@ type DescribeModelOutput struct { // location. LabelsInputConfiguration *types.LabelsInputConfiguration - // Indicates the last time the ML model was updated. The type of update is not - // specified. + // Indicates the last time the machine learning model was updated. The type of + // update is not specified. LastUpdatedTime *time.Time - // The Amazon Resource Name (ARN) of the ML model being described. + // Indicates the number of days of data used in the most recent scheduled + // retraining run. + LatestScheduledRetrainingAvailableDataInDays *int32 + + // If the model version was generated by retraining and the training failed, this + // indicates the reason for that failure. + LatestScheduledRetrainingFailedReason *string + + // Indicates the most recent model version that was generated by retraining. + LatestScheduledRetrainingModelVersion *int64 + + // Indicates the start time of the most recent scheduled retraining run. + LatestScheduledRetrainingStartTime *time.Time + + // Indicates the status of the most recent scheduled retraining run. + LatestScheduledRetrainingStatus types.ModelVersionStatus + + // The Amazon Resource Name (ARN) of the machine learning model being described. ModelArn *string // The Model Metrics show an aggregated summary of the model's performance within @@ -113,12 +136,16 @@ type DescribeModelOutput struct { // This value conforms to the media type: application/json ModelMetrics *string - // The name of the ML model being described. + // The name of the machine learning model being described. ModelName *string // The date the active model version was activated. ModelVersionActivatedAt *time.Time + // Indicates the date and time that the next scheduled retraining run will start + // on. Lookout for Equipment truncates the time you provide to the nearest UTC day. + NextScheduledRetrainingStartDate *time.Time + // Indicates that the asset associated with this sensor has been shut off. As long // as this condition is met, Lookout for Equipment will not use data from this // asset for training, evaluation, or inference. @@ -135,8 +162,19 @@ type DescribeModelOutput struct { // The date and time when the previous active model version was activated. PreviousModelVersionActivatedAt *time.Time + // If the model version was retrained, this field shows a summary of the + // performance of the prior model on the new training range. You can use the + // information in this JSON-formatted object to compare the new model version and + // the prior model version. + // + // This value conforms to the media type: application/json + PriorModelMetrics *string + + // Indicates the status of the retraining scheduler. + RetrainingSchedulerStatus types.RetrainingSchedulerStatus + // The Amazon Resource Name (ARN) of a role with permission to access the data - // source for the ML model being described. + // source for the machine learning model being described. RoleArn *string // A JSON description of the data that is in each time series dataset, including @@ -158,17 +196,18 @@ type DescribeModelOutput struct { Status types.ModelStatus // Indicates the time reference in the dataset that was used to end the subset of - // training data for the ML model. + // training data for the machine learning model. TrainingDataEndTime *time.Time // Indicates the time reference in the dataset that was used to begin the subset - // of training data for the ML model. + // of training data for the machine learning model. TrainingDataStartTime *time.Time - // Indicates the time at which the training of the ML model was completed. + // Indicates the time at which the training of the machine learning model was + // completed. TrainingExecutionEndTime *time.Time - // Indicates the time at which the training of the ML model began. + // Indicates the time at which the training of the machine learning model began. TrainingExecutionStartTime *time.Time // Metadata pertaining to the operation's result. diff --git a/service/lookoutequipment/api_op_DescribeModelVersion.go b/service/lookoutequipment/api_op_DescribeModelVersion.go index e4de2efffe6..efc998a4117 100644 --- a/service/lookoutequipment/api_op_DescribeModelVersion.go +++ b/service/lookoutequipment/api_op_DescribeModelVersion.go @@ -50,6 +50,17 @@ type DescribeModelVersionInput struct { type DescribeModelVersionOutput struct { + // Indicates whether the model version was promoted to be the active version after + // retraining or if there was an error with or cancellation of the retraining. + AutoPromotionResult types.AutoPromotionResult + + // Indicates the reason for the AutoPromotionResult . For example, a model might + // not be promoted if its performance was worse than the active version, if there + // was an error during training, or if the retraining scheduler was using MANUAL + // promote mode. The model will be promoted in MANAGED promote mode if the + // performance is better than the previous model. + AutoPromotionResultReason *string + // Indicates the time and date at which the machine learning model version was // created. CreatedAt *time.Time @@ -124,6 +135,16 @@ type DescribeModelVersionOutput struct { // asset for training, evaluation, or inference. OffCondition *string + // If the model version was retrained, this field shows a summary of the + // performance of the prior model on the new training range. You can use the + // information in this JSON-formatted object to compare the new model version and + // the prior model version. + PriorModelMetrics *string + + // Indicates the number of days of data used in the most recent scheduled + // retraining run. + RetrainingAvailableDataInDays *int32 + // The Amazon Resource Name (ARN) of the role that was used to train the model // version. RoleArn *string diff --git a/service/lookoutequipment/api_op_DescribeRetrainingScheduler.go b/service/lookoutequipment/api_op_DescribeRetrainingScheduler.go new file mode 100644 index 00000000000..32de2e472f0 --- /dev/null +++ b/service/lookoutequipment/api_op_DescribeRetrainingScheduler.go @@ -0,0 +1,292 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Provides a description of the retraining scheduler, including information such +// as the model name and retraining parameters. +func (c *Client) DescribeRetrainingScheduler(ctx context.Context, params *DescribeRetrainingSchedulerInput, optFns ...func(*Options)) (*DescribeRetrainingSchedulerOutput, error) { + if params == nil { + params = &DescribeRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeRetrainingScheduler", params, optFns, c.addOperationDescribeRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeRetrainingSchedulerInput struct { + + // The name of the model that the retraining scheduler is attached to. + // + // This member is required. + ModelName *string + + noSmithyDocumentSerde +} + +type DescribeRetrainingSchedulerOutput struct { + + // Indicates the time and date at which the retraining scheduler was created. + CreatedAt *time.Time + + // The number of past days of data used for retraining. + LookbackWindow *string + + // The ARN of the model that the retraining scheduler is attached to. + ModelArn *string + + // The name of the model that the retraining scheduler is attached to. + ModelName *string + + // Indicates how the service uses new models. In MANAGED mode, new models are used + // for inference if they have better performance than the current model. In MANUAL + // mode, the new models are not used until they are manually activated (https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/versioning-model.html#model-activation) + // . + PromoteMode types.ModelPromoteMode + + // The frequency at which the model retraining is set. This follows the ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601#Durations) + // guidelines. + RetrainingFrequency *string + + // The start date for the retraining scheduler. Lookout for Equipment truncates + // the time you provide to the nearest UTC day. + RetrainingStartDate *time.Time + + // The status of the retraining scheduler. + Status types.RetrainingSchedulerStatus + + // Indicates the time and date at which the retraining scheduler was updated. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addDescribeRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "DescribeRetrainingScheduler", + } +} + +type opDescribeRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_ImportModelVersion.go b/service/lookoutequipment/api_op_ImportModelVersion.go index 245d165304b..6c694249669 100644 --- a/service/lookoutequipment/api_op_ImportModelVersion.go +++ b/service/lookoutequipment/api_op_ImportModelVersion.go @@ -50,6 +50,15 @@ type ImportModelVersionInput struct { // This member is required. SourceModelVersionArn *string + // Indicates how to import the accumulated inference data when a model version is + // imported. The possible values are as follows: + // - NO_IMPORT – Don't import the data. + // - ADD_WHEN_EMPTY – Only import the data from the source model if there is no + // existing data in the target model. + // - OVERWRITE – Import the data from the source model and overwrite the + // existing data in the target model. + InferenceDataImportStrategy types.InferenceDataImportStrategy + // Contains the configuration information for the S3 location being used to hold // label data. LabelsInputConfiguration *types.LabelsInputConfiguration diff --git a/service/lookoutequipment/api_op_ListInferenceSchedulers.go b/service/lookoutequipment/api_op_ListInferenceSchedulers.go index 924015b0c69..1f44934a2e5 100644 --- a/service/lookoutequipment/api_op_ListInferenceSchedulers.go +++ b/service/lookoutequipment/api_op_ListInferenceSchedulers.go @@ -41,7 +41,8 @@ type ListInferenceSchedulersInput struct { // Specifies the maximum number of inference schedulers to list. MaxResults *int32 - // The name of the ML model used by the inference scheduler to be listed. + // The name of the machine learning model used by the inference scheduler to be + // listed. ModelName *string // An opaque pagination token indicating where to continue the listing of diff --git a/service/lookoutequipment/api_op_ListModels.go b/service/lookoutequipment/api_op_ListModels.go index e0ae96e5a1c..c05bba9488a 100644 --- a/service/lookoutequipment/api_op_ListModels.go +++ b/service/lookoutequipment/api_op_ListModels.go @@ -35,20 +35,21 @@ func (c *Client) ListModels(ctx context.Context, params *ListModelsInput, optFns type ListModelsInput struct { - // The beginning of the name of the dataset of the ML models to be listed. + // The beginning of the name of the dataset of the machine learning models to be + // listed. DatasetNameBeginsWith *string - // Specifies the maximum number of ML models to list. + // Specifies the maximum number of machine learning models to list. MaxResults *int32 - // The beginning of the name of the ML models being listed. + // The beginning of the name of the machine learning models being listed. ModelNameBeginsWith *string - // An opaque pagination token indicating where to continue the listing of ML - // models. + // An opaque pagination token indicating where to continue the listing of machine + // learning models. NextToken *string - // The status of the ML model. + // The status of the machine learning model. Status types.ModelStatus noSmithyDocumentSerde @@ -60,8 +61,8 @@ type ListModelsOutput struct { // dataset ARNs, and status. ModelSummaries []types.ModelSummary - // An opaque pagination token indicating where to continue the listing of ML - // models. + // An opaque pagination token indicating where to continue the listing of machine + // learning models. NextToken *string // Metadata pertaining to the operation's result. @@ -151,7 +152,7 @@ var _ ListModelsAPIClient = (*Client)(nil) // ListModelsPaginatorOptions is the paginator options for ListModels type ListModelsPaginatorOptions struct { - // Specifies the maximum number of ML models to list. + // Specifies the maximum number of machine learning models to list. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/lookoutequipment/api_op_ListRetrainingSchedulers.go b/service/lookoutequipment/api_op_ListRetrainingSchedulers.go new file mode 100644 index 00000000000..6691c3b2ed0 --- /dev/null +++ b/service/lookoutequipment/api_op_ListRetrainingSchedulers.go @@ -0,0 +1,367 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all retraining schedulers in your account, filtering by model name prefix +// and status. +func (c *Client) ListRetrainingSchedulers(ctx context.Context, params *ListRetrainingSchedulersInput, optFns ...func(*Options)) (*ListRetrainingSchedulersOutput, error) { + if params == nil { + params = &ListRetrainingSchedulersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRetrainingSchedulers", params, optFns, c.addOperationListRetrainingSchedulersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRetrainingSchedulersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRetrainingSchedulersInput struct { + + // Specifies the maximum number of retraining schedulers to list. + MaxResults *int32 + + // Specify this field to only list retraining schedulers whose machine learning + // models begin with the value you specify. + ModelNameBeginsWith *string + + // If the number of results exceeds the maximum, a pagination token is returned. + // Use the token in the request to show the next page of retraining schedulers. + NextToken *string + + // Specify this field to only list retraining schedulers whose status matches the + // value you specify. + Status types.RetrainingSchedulerStatus + + noSmithyDocumentSerde +} + +type ListRetrainingSchedulersOutput struct { + + // If the number of results exceeds the maximum, this pagination token is + // returned. Use this token in the request to show the next page of retraining + // schedulers. + NextToken *string + + // Provides information on the specified retraining scheduler, including the model + // name, model ARN, status, and start date. + RetrainingSchedulerSummaries []types.RetrainingSchedulerSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRetrainingSchedulersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListRetrainingSchedulers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListRetrainingSchedulers{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addListRetrainingSchedulersResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRetrainingSchedulers(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// ListRetrainingSchedulersAPIClient is a client that implements the +// ListRetrainingSchedulers operation. +type ListRetrainingSchedulersAPIClient interface { + ListRetrainingSchedulers(context.Context, *ListRetrainingSchedulersInput, ...func(*Options)) (*ListRetrainingSchedulersOutput, error) +} + +var _ ListRetrainingSchedulersAPIClient = (*Client)(nil) + +// ListRetrainingSchedulersPaginatorOptions is the paginator options for +// ListRetrainingSchedulers +type ListRetrainingSchedulersPaginatorOptions struct { + // Specifies the maximum number of retraining schedulers to list. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRetrainingSchedulersPaginator is a paginator for ListRetrainingSchedulers +type ListRetrainingSchedulersPaginator struct { + options ListRetrainingSchedulersPaginatorOptions + client ListRetrainingSchedulersAPIClient + params *ListRetrainingSchedulersInput + nextToken *string + firstPage bool +} + +// NewListRetrainingSchedulersPaginator returns a new +// ListRetrainingSchedulersPaginator +func NewListRetrainingSchedulersPaginator(client ListRetrainingSchedulersAPIClient, params *ListRetrainingSchedulersInput, optFns ...func(*ListRetrainingSchedulersPaginatorOptions)) *ListRetrainingSchedulersPaginator { + if params == nil { + params = &ListRetrainingSchedulersInput{} + } + + options := ListRetrainingSchedulersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRetrainingSchedulersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRetrainingSchedulersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRetrainingSchedulers page. +func (p *ListRetrainingSchedulersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRetrainingSchedulersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListRetrainingSchedulers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListRetrainingSchedulers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "ListRetrainingSchedulers", + } +} + +type opListRetrainingSchedulersResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListRetrainingSchedulersResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListRetrainingSchedulersResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListRetrainingSchedulersResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListRetrainingSchedulersResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_StartInferenceScheduler.go b/service/lookoutequipment/api_op_StartInferenceScheduler.go index 013c3927577..c8a67351038 100644 --- a/service/lookoutequipment/api_op_StartInferenceScheduler.go +++ b/service/lookoutequipment/api_op_StartInferenceScheduler.go @@ -50,11 +50,11 @@ type StartInferenceSchedulerOutput struct { // The name of the inference scheduler being started. InferenceSchedulerName *string - // The Amazon Resource Name (ARN) of the ML model being used by the inference - // scheduler. + // The Amazon Resource Name (ARN) of the machine learning model being used by the + // inference scheduler. ModelArn *string - // The name of the ML model being used by the inference scheduler. + // The name of the machine learning model being used by the inference scheduler. ModelName *string // Indicates the status of the inference scheduler. diff --git a/service/lookoutequipment/api_op_StartRetrainingScheduler.go b/service/lookoutequipment/api_op_StartRetrainingScheduler.go new file mode 100644 index 00000000000..93149338f72 --- /dev/null +++ b/service/lookoutequipment/api_op_StartRetrainingScheduler.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a retraining scheduler. +func (c *Client) StartRetrainingScheduler(ctx context.Context, params *StartRetrainingSchedulerInput, optFns ...func(*Options)) (*StartRetrainingSchedulerOutput, error) { + if params == nil { + params = &StartRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartRetrainingScheduler", params, optFns, c.addOperationStartRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartRetrainingSchedulerInput struct { + + // The name of the model whose retraining scheduler you want to start. + // + // This member is required. + ModelName *string + + noSmithyDocumentSerde +} + +type StartRetrainingSchedulerOutput struct { + + // The ARN of the model whose retraining scheduler is being started. + ModelArn *string + + // The name of the model whose retraining scheduler is being started. + ModelName *string + + // The status of the retraining scheduler. + Status types.RetrainingSchedulerStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpStartRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStartRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addStartRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "StartRetrainingScheduler", + } +} + +type opStartRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opStartRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opStartRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addStartRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opStartRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_StopInferenceScheduler.go b/service/lookoutequipment/api_op_StopInferenceScheduler.go index ee815f4590d..aedd087a979 100644 --- a/service/lookoutequipment/api_op_StopInferenceScheduler.go +++ b/service/lookoutequipment/api_op_StopInferenceScheduler.go @@ -50,11 +50,12 @@ type StopInferenceSchedulerOutput struct { // The name of the inference scheduler being stopped. InferenceSchedulerName *string - // The Amazon Resource Name (ARN) of the ML model used by the inference scheduler - // being stopped. + // The Amazon Resource Name (ARN) of the machine learning model used by the + // inference scheduler being stopped. ModelArn *string - // The name of the ML model used by the inference scheduler being stopped. + // The name of the machine learning model used by the inference scheduler being + // stopped. ModelName *string // Indicates the status of the inference scheduler. diff --git a/service/lookoutequipment/api_op_StopRetrainingScheduler.go b/service/lookoutequipment/api_op_StopRetrainingScheduler.go new file mode 100644 index 00000000000..b90778072ca --- /dev/null +++ b/service/lookoutequipment/api_op_StopRetrainingScheduler.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Stops a retraining scheduler. +func (c *Client) StopRetrainingScheduler(ctx context.Context, params *StopRetrainingSchedulerInput, optFns ...func(*Options)) (*StopRetrainingSchedulerOutput, error) { + if params == nil { + params = &StopRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StopRetrainingScheduler", params, optFns, c.addOperationStopRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StopRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StopRetrainingSchedulerInput struct { + + // The name of the model whose retraining scheduler you want to stop. + // + // This member is required. + ModelName *string + + noSmithyDocumentSerde +} + +type StopRetrainingSchedulerOutput struct { + + // The ARN of the model whose retraining scheduler is being stopped. + ModelArn *string + + // The name of the model whose retraining scheduler is being stopped. + ModelName *string + + // The status of the retraining scheduler. + Status types.RetrainingSchedulerStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStopRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpStopRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpStopRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addStopRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpStopRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStopRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "StopRetrainingScheduler", + } +} + +type opStopRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opStopRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opStopRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addStopRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opStopRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_UpdateModel.go b/service/lookoutequipment/api_op_UpdateModel.go new file mode 100644 index 00000000000..5f9accb8db4 --- /dev/null +++ b/service/lookoutequipment/api_op_UpdateModel.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a model in the account. +func (c *Client) UpdateModel(ctx context.Context, params *UpdateModelInput, optFns ...func(*Options)) (*UpdateModelOutput, error) { + if params == nil { + params = &UpdateModelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateModel", params, optFns, c.addOperationUpdateModelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateModelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateModelInput struct { + + // The name of the model to update. + // + // This member is required. + ModelName *string + + // Contains the configuration information for the S3 location being used to hold + // label data. + LabelsInputConfiguration *types.LabelsInputConfiguration + + // The ARN of the model to update. + RoleArn *string + + noSmithyDocumentSerde +} + +type UpdateModelOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateModelMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateModel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateModel{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addUpdateModelResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateModelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateModel(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateModel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "UpdateModel", + } +} + +type opUpdateModelResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateModelResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateModelResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateModelResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateModelResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/api_op_UpdateRetrainingScheduler.go b/service/lookoutequipment/api_op_UpdateRetrainingScheduler.go new file mode 100644 index 00000000000..173823a374e --- /dev/null +++ b/service/lookoutequipment/api_op_UpdateRetrainingScheduler.go @@ -0,0 +1,282 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/lookoutequipment/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates a retraining scheduler. +func (c *Client) UpdateRetrainingScheduler(ctx context.Context, params *UpdateRetrainingSchedulerInput, optFns ...func(*Options)) (*UpdateRetrainingSchedulerOutput, error) { + if params == nil { + params = &UpdateRetrainingSchedulerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRetrainingScheduler", params, optFns, c.addOperationUpdateRetrainingSchedulerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRetrainingSchedulerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRetrainingSchedulerInput struct { + + // The name of the model whose retraining scheduler you want to update. + // + // This member is required. + ModelName *string + + // The number of past days of data that will be used for retraining. + LookbackWindow *string + + // Indicates how the service will use new models. In MANAGED mode, new models will + // automatically be used for inference if they have better performance than the + // current model. In MANUAL mode, the new models will not be used until they are + // manually activated (https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/versioning-model.html#model-activation) + // . + PromoteMode types.ModelPromoteMode + + // This parameter uses the ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601#Durations) + // standard to set the frequency at which you want retraining to occur in terms of + // Years, Months, and/or Days (note: other parameters like Time are not currently + // supported). The minimum value is 30 days (P30D) and the maximum value is 1 year + // (P1Y). For example, the following values are valid: + // - P3M15D – Every 3 months and 15 days + // - P2M – Every 2 months + // - P150D – Every 150 days + RetrainingFrequency *string + + // The start date for the retraining scheduler. Lookout for Equipment truncates + // the time you provide to the nearest UTC day. + RetrainingStartDate *time.Time + + noSmithyDocumentSerde +} + +type UpdateRetrainingSchedulerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRetrainingSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateRetrainingScheduler{}, middleware.After) + if err != nil { + return err + } + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.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 = addUpdateRetrainingSchedulerResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateRetrainingSchedulerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRetrainingScheduler(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRetrainingScheduler(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "lookoutequipment", + OperationName: "UpdateRetrainingScheduler", + } +} + +type opUpdateRetrainingSchedulerResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateRetrainingSchedulerResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateRetrainingSchedulerResolveEndpointMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "lookoutequipment" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "lookoutequipment" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("lookoutequipment") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateRetrainingSchedulerResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateRetrainingSchedulerResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/lookoutequipment/deserializers.go b/service/lookoutequipment/deserializers.go index eeefe6b57d8..2d43c633e9c 100644 --- a/service/lookoutequipment/deserializers.go +++ b/service/lookoutequipment/deserializers.go @@ -660,6 +660,132 @@ func awsAwsjson10_deserializeOpErrorCreateModel(response *smithyhttp.Response, m } } +type awsAwsjson10_deserializeOpCreateRetrainingScheduler struct { +} + +func (*awsAwsjson10_deserializeOpCreateRetrainingScheduler) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreateRetrainingScheduler) 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, awsAwsjson10_deserializeOpErrorCreateRetrainingScheduler(response, &metadata) + } + output := &CreateRetrainingSchedulerOutput{} + 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 = awsAwsjson10_deserializeOpDocumentCreateRetrainingSchedulerOutput(&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 awsAwsjson10_deserializeOpErrorCreateRetrainingScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDeleteDataset struct { } @@ -1284,6 +1410,110 @@ func awsAwsjson10_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re } } +type awsAwsjson10_deserializeOpDeleteRetrainingScheduler struct { +} + +func (*awsAwsjson10_deserializeOpDeleteRetrainingScheduler) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteRetrainingScheduler) 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, awsAwsjson10_deserializeOpErrorDeleteRetrainingScheduler(response, &metadata) + } + output := &DeleteRetrainingSchedulerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteRetrainingScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDescribeDataIngestionJob struct { } @@ -2268,14 +2498,14 @@ func awsAwsjson10_deserializeOpErrorDescribeResourcePolicy(response *smithyhttp. } } -type awsAwsjson10_deserializeOpImportDataset struct { +type awsAwsjson10_deserializeOpDescribeRetrainingScheduler struct { } -func (*awsAwsjson10_deserializeOpImportDataset) ID() string { +func (*awsAwsjson10_deserializeOpDescribeRetrainingScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpImportDataset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpDescribeRetrainingScheduler) 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) @@ -2289,9 +2519,9 @@ func (m *awsAwsjson10_deserializeOpImportDataset) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorImportDataset(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorDescribeRetrainingScheduler(response, &metadata) } - output := &ImportDatasetOutput{} + output := &DescribeRetrainingSchedulerOutput{} out.Result = output var buff [1024]byte @@ -2311,7 +2541,7 @@ func (m *awsAwsjson10_deserializeOpImportDataset) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentImportDatasetOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentDescribeRetrainingSchedulerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2325,7 +2555,7 @@ func (m *awsAwsjson10_deserializeOpImportDataset) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorImportDataset(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorDescribeRetrainingScheduler(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)} @@ -2369,18 +2599,12 @@ func awsAwsjson10_deserializeOpErrorImportDataset(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -2397,14 +2621,14 @@ func awsAwsjson10_deserializeOpErrorImportDataset(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpImportModelVersion struct { +type awsAwsjson10_deserializeOpImportDataset struct { } -func (*awsAwsjson10_deserializeOpImportModelVersion) ID() string { +func (*awsAwsjson10_deserializeOpImportDataset) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpImportModelVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpImportDataset) 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) @@ -2418,9 +2642,9 @@ func (m *awsAwsjson10_deserializeOpImportModelVersion) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorImportModelVersion(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorImportDataset(response, &metadata) } - output := &ImportModelVersionOutput{} + output := &ImportDatasetOutput{} out.Result = output var buff [1024]byte @@ -2440,7 +2664,7 @@ func (m *awsAwsjson10_deserializeOpImportModelVersion) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentImportModelVersionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentImportDatasetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2454,7 +2678,7 @@ func (m *awsAwsjson10_deserializeOpImportModelVersion) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorImportModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorImportDataset(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)} @@ -2526,14 +2750,14 @@ func awsAwsjson10_deserializeOpErrorImportModelVersion(response *smithyhttp.Resp } } -type awsAwsjson10_deserializeOpListDataIngestionJobs struct { +type awsAwsjson10_deserializeOpImportModelVersion struct { } -func (*awsAwsjson10_deserializeOpListDataIngestionJobs) ID() string { +func (*awsAwsjson10_deserializeOpImportModelVersion) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListDataIngestionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpImportModelVersion) 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) @@ -2547,9 +2771,9 @@ func (m *awsAwsjson10_deserializeOpListDataIngestionJobs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListDataIngestionJobs(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorImportModelVersion(response, &metadata) } - output := &ListDataIngestionJobsOutput{} + output := &ImportModelVersionOutput{} out.Result = output var buff [1024]byte @@ -2569,7 +2793,136 @@ func (m *awsAwsjson10_deserializeOpListDataIngestionJobs) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListDataIngestionJobsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentImportModelVersionOutput(&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 awsAwsjson10_deserializeOpErrorImportModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpListDataIngestionJobs struct { +} + +func (*awsAwsjson10_deserializeOpListDataIngestionJobs) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListDataIngestionJobs) 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, awsAwsjson10_deserializeOpErrorListDataIngestionJobs(response, &metadata) + } + output := &ListDataIngestionJobsOutput{} + 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 = awsAwsjson10_deserializeOpDocumentListDataIngestionJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3615,14 +3968,14 @@ func awsAwsjson10_deserializeOpErrorListModelVersions(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpListSensorStatistics struct { +type awsAwsjson10_deserializeOpListRetrainingSchedulers struct { } -func (*awsAwsjson10_deserializeOpListSensorStatistics) ID() string { +func (*awsAwsjson10_deserializeOpListRetrainingSchedulers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListSensorStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListRetrainingSchedulers) 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) @@ -3636,9 +3989,9 @@ func (m *awsAwsjson10_deserializeOpListSensorStatistics) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListSensorStatistics(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListRetrainingSchedulers(response, &metadata) } - output := &ListSensorStatisticsOutput{} + output := &ListRetrainingSchedulersOutput{} out.Result = output var buff [1024]byte @@ -3658,7 +4011,7 @@ func (m *awsAwsjson10_deserializeOpListSensorStatistics) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListSensorStatisticsOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListRetrainingSchedulersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3672,7 +4025,7 @@ func (m *awsAwsjson10_deserializeOpListSensorStatistics) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListSensorStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListRetrainingSchedulers(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)} @@ -3719,9 +4072,6 @@ func awsAwsjson10_deserializeOpErrorListSensorStatistics(response *smithyhttp.Re case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -3738,14 +4088,14 @@ func awsAwsjson10_deserializeOpErrorListSensorStatistics(response *smithyhttp.Re } } -type awsAwsjson10_deserializeOpListTagsForResource struct { +type awsAwsjson10_deserializeOpListSensorStatistics struct { } -func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson10_deserializeOpListSensorStatistics) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListSensorStatistics) 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) @@ -3759,9 +4109,9 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListSensorStatistics(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListSensorStatisticsOutput{} out.Result = output var buff [1024]byte @@ -3781,7 +4131,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListSensorStatisticsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3795,7 +4145,7 @@ func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListSensorStatistics(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)} @@ -3861,14 +4211,14 @@ func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpPutResourcePolicy struct { +type awsAwsjson10_deserializeOpListTagsForResource struct { } -func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { +func (*awsAwsjson10_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3882,9 +4232,9 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -3904,7 +4254,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3918,7 +4268,7 @@ func (m *awsAwsjson10_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3962,18 +4312,12 @@ func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -3990,14 +4334,14 @@ func awsAwsjson10_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -type awsAwsjson10_deserializeOpStartDataIngestionJob struct { +type awsAwsjson10_deserializeOpPutResourcePolicy struct { } -func (*awsAwsjson10_deserializeOpStartDataIngestionJob) ID() string { +func (*awsAwsjson10_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpStartDataIngestionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpPutResourcePolicy) 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) @@ -4011,9 +4355,9 @@ func (m *awsAwsjson10_deserializeOpStartDataIngestionJob) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorStartDataIngestionJob(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &StartDataIngestionJobOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -4033,7 +4377,7 @@ func (m *awsAwsjson10_deserializeOpStartDataIngestionJob) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentStartDataIngestionJobOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4047,7 +4391,7 @@ func (m *awsAwsjson10_deserializeOpStartDataIngestionJob) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson10_deserializeOpErrorStartDataIngestionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorPutResourcePolicy(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)} @@ -4119,14 +4463,14 @@ func awsAwsjson10_deserializeOpErrorStartDataIngestionJob(response *smithyhttp.R } } -type awsAwsjson10_deserializeOpStartInferenceScheduler struct { +type awsAwsjson10_deserializeOpStartDataIngestionJob struct { } -func (*awsAwsjson10_deserializeOpStartInferenceScheduler) ID() string { +func (*awsAwsjson10_deserializeOpStartDataIngestionJob) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpStartInferenceScheduler) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStartDataIngestionJob) 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) @@ -4140,9 +4484,9 @@ func (m *awsAwsjson10_deserializeOpStartInferenceScheduler) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorStartInferenceScheduler(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStartDataIngestionJob(response, &metadata) } - output := &StartInferenceSchedulerOutput{} + output := &StartDataIngestionJobOutput{} out.Result = output var buff [1024]byte @@ -4162,7 +4506,7 @@ func (m *awsAwsjson10_deserializeOpStartInferenceScheduler) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentStartInferenceSchedulerOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentStartDataIngestionJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4176,7 +4520,7 @@ func (m *awsAwsjson10_deserializeOpStartInferenceScheduler) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson10_deserializeOpErrorStartInferenceScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStartDataIngestionJob(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)} @@ -4229,6 +4573,9 @@ func awsAwsjson10_deserializeOpErrorStartInferenceScheduler(response *smithyhttp case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -4245,14 +4592,14 @@ func awsAwsjson10_deserializeOpErrorStartInferenceScheduler(response *smithyhttp } } -type awsAwsjson10_deserializeOpStopInferenceScheduler struct { +type awsAwsjson10_deserializeOpStartInferenceScheduler struct { } -func (*awsAwsjson10_deserializeOpStopInferenceScheduler) ID() string { +func (*awsAwsjson10_deserializeOpStartInferenceScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpStopInferenceScheduler) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStartInferenceScheduler) 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) @@ -4266,9 +4613,9 @@ func (m *awsAwsjson10_deserializeOpStopInferenceScheduler) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorStopInferenceScheduler(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStartInferenceScheduler(response, &metadata) } - output := &StopInferenceSchedulerOutput{} + output := &StartInferenceSchedulerOutput{} out.Result = output var buff [1024]byte @@ -4288,7 +4635,7 @@ func (m *awsAwsjson10_deserializeOpStopInferenceScheduler) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentStopInferenceSchedulerOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentStartInferenceSchedulerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4302,7 +4649,7 @@ func (m *awsAwsjson10_deserializeOpStopInferenceScheduler) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson10_deserializeOpErrorStopInferenceScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStartInferenceScheduler(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)} @@ -4371,14 +4718,14 @@ func awsAwsjson10_deserializeOpErrorStopInferenceScheduler(response *smithyhttp. } } -type awsAwsjson10_deserializeOpTagResource struct { +type awsAwsjson10_deserializeOpStartRetrainingScheduler struct { } -func (*awsAwsjson10_deserializeOpTagResource) ID() string { +func (*awsAwsjson10_deserializeOpStartRetrainingScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStartRetrainingScheduler) 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) @@ -4392,9 +4739,9 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStartRetrainingScheduler(response, &metadata) } - output := &TagResourceOutput{} + output := &StartRetrainingSchedulerOutput{} out.Result = output var buff [1024]byte @@ -4414,7 +4761,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentStartRetrainingSchedulerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4428,7 +4775,7 @@ func (m *awsAwsjson10_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStartRetrainingScheduler(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)} @@ -4472,15 +4819,15 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) @@ -4497,14 +4844,14 @@ func awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson10_deserializeOpUntagResource struct { +type awsAwsjson10_deserializeOpStopInferenceScheduler struct { } -func (*awsAwsjson10_deserializeOpUntagResource) ID() string { +func (*awsAwsjson10_deserializeOpStopInferenceScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStopInferenceScheduler) 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) @@ -4518,9 +4865,9 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStopInferenceScheduler(response, &metadata) } - output := &UntagResourceOutput{} + output := &StopInferenceSchedulerOutput{} out.Result = output var buff [1024]byte @@ -4540,7 +4887,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentStopInferenceSchedulerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4554,7 +4901,7 @@ func (m *awsAwsjson10_deserializeOpUntagResource) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStopInferenceScheduler(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)} @@ -4598,6 +4945,9 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) @@ -4620,14 +4970,14 @@ func awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsAwsjson10_deserializeOpUpdateActiveModelVersion struct { +type awsAwsjson10_deserializeOpStopRetrainingScheduler struct { } -func (*awsAwsjson10_deserializeOpUpdateActiveModelVersion) ID() string { +func (*awsAwsjson10_deserializeOpStopRetrainingScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateActiveModelVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpStopRetrainingScheduler) 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) @@ -4641,9 +4991,9 @@ func (m *awsAwsjson10_deserializeOpUpdateActiveModelVersion) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateActiveModelVersion(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorStopRetrainingScheduler(response, &metadata) } - output := &UpdateActiveModelVersionOutput{} + output := &StopRetrainingSchedulerOutput{} out.Result = output var buff [1024]byte @@ -4663,7 +5013,7 @@ func (m *awsAwsjson10_deserializeOpUpdateActiveModelVersion) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateActiveModelVersionOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentStopRetrainingSchedulerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4677,7 +5027,7 @@ func (m *awsAwsjson10_deserializeOpUpdateActiveModelVersion) HandleDeserialize(c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateActiveModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorStopRetrainingScheduler(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)} @@ -4746,14 +5096,597 @@ func awsAwsjson10_deserializeOpErrorUpdateActiveModelVersion(response *smithyhtt } } -type awsAwsjson10_deserializeOpUpdateInferenceScheduler struct { +type awsAwsjson10_deserializeOpTagResource struct { +} + +func (*awsAwsjson10_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpTagResource) 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, awsAwsjson10_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentTagResourceOutput(&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 awsAwsjson10_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson10_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUntagResource struct { +} + +func (*awsAwsjson10_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUntagResource) 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, awsAwsjson10_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUntagResourceOutput(&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 awsAwsjson10_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateActiveModelVersion struct { +} + +func (*awsAwsjson10_deserializeOpUpdateActiveModelVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateActiveModelVersion) 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, awsAwsjson10_deserializeOpErrorUpdateActiveModelVersion(response, &metadata) + } + output := &UpdateActiveModelVersionOutput{} + 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 = awsAwsjson10_deserializeOpDocumentUpdateActiveModelVersionOutput(&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 awsAwsjson10_deserializeOpErrorUpdateActiveModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateInferenceScheduler struct { +} + +func (*awsAwsjson10_deserializeOpUpdateInferenceScheduler) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateInferenceScheduler) 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, awsAwsjson10_deserializeOpErrorUpdateInferenceScheduler(response, &metadata) + } + output := &UpdateInferenceSchedulerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateInferenceScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpUpdateLabelGroup struct { +} + +func (*awsAwsjson10_deserializeOpUpdateLabelGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateLabelGroup) 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, awsAwsjson10_deserializeOpErrorUpdateLabelGroup(response, &metadata) + } + output := &UpdateLabelGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateLabelGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func (*awsAwsjson10_deserializeOpUpdateInferenceScheduler) ID() string { +type awsAwsjson10_deserializeOpUpdateModel struct { +} + +func (*awsAwsjson10_deserializeOpUpdateModel) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateInferenceScheduler) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateModel) 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) @@ -4767,9 +5700,9 @@ func (m *awsAwsjson10_deserializeOpUpdateInferenceScheduler) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateInferenceScheduler(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateModel(response, &metadata) } - output := &UpdateInferenceSchedulerOutput{} + output := &UpdateModelOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -4781,7 +5714,7 @@ func (m *awsAwsjson10_deserializeOpUpdateInferenceScheduler) HandleDeserialize(c return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateInferenceScheduler(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateModel(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)} @@ -4850,14 +5783,14 @@ func awsAwsjson10_deserializeOpErrorUpdateInferenceScheduler(response *smithyhtt } } -type awsAwsjson10_deserializeOpUpdateLabelGroup struct { +type awsAwsjson10_deserializeOpUpdateRetrainingScheduler struct { } -func (*awsAwsjson10_deserializeOpUpdateLabelGroup) ID() string { +func (*awsAwsjson10_deserializeOpUpdateRetrainingScheduler) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateLabelGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateRetrainingScheduler) 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) @@ -4871,9 +5804,9 @@ func (m *awsAwsjson10_deserializeOpUpdateLabelGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateLabelGroup(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateRetrainingScheduler(response, &metadata) } - output := &UpdateLabelGroupOutput{} + output := &UpdateRetrainingSchedulerOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -4885,7 +5818,7 @@ func (m *awsAwsjson10_deserializeOpUpdateLabelGroup) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateLabelGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateRetrainingScheduler(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)} @@ -6085,6 +7018,28 @@ func awsAwsjson10_deserializeDocumentInferenceExecutionSummary(v **types.Inferen sv.ModelName = ptr.String(jtv) } + case "ModelVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ModelVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ModelVersion = ptr.Int64(i64) + } + + case "ModelVersionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelVersionArn to be of type string, got %T instead", value) + } + sv.ModelVersionArn = ptr.String(jtv) + } + case "ScheduledStartTime": if value != nil { switch jtv := value.(type) { @@ -7485,6 +8440,44 @@ func awsAwsjson10_deserializeDocumentModelSummary(v **types.ModelSummary, value sv.DatasetName = ptr.String(jtv) } + case "LatestScheduledRetrainingModelVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ModelVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LatestScheduledRetrainingModelVersion = ptr.Int64(i64) + } + + case "LatestScheduledRetrainingStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LatestScheduledRetrainingStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "LatestScheduledRetrainingStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelVersionStatus to be of type string, got %T instead", value) + } + sv.LatestScheduledRetrainingStatus = types.ModelVersionStatus(jtv) + } + case "ModelArn": if value != nil { jtv, ok := value.(string) @@ -7503,6 +8496,31 @@ func awsAwsjson10_deserializeDocumentModelSummary(v **types.ModelSummary, value sv.ModelName = ptr.String(jtv) } + case "NextScheduledRetrainingStartDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextScheduledRetrainingStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "RetrainingSchedulerStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) + } + sv.RetrainingSchedulerStatus = types.RetrainingSchedulerStatus(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -7789,6 +8807,132 @@ func awsAwsjson10_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsAwsjson10_deserializeDocumentRetrainingSchedulerSummaries(v *[]types.RetrainingSchedulerSummary, 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.RetrainingSchedulerSummary + if *v == nil { + cv = []types.RetrainingSchedulerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RetrainingSchedulerSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentRetrainingSchedulerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentRetrainingSchedulerSummary(v **types.RetrainingSchedulerSummary, 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.RetrainingSchedulerSummary + if *v == nil { + sv = &types.RetrainingSchedulerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LookbackWindow": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LookbackWindow to be of type string, got %T instead", value) + } + sv.LookbackWindow = ptr.String(jtv) + } + + case "ModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "ModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) + } + sv.ModelName = ptr.String(jtv) + } + + case "RetrainingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingFrequency to be of type string, got %T instead", value) + } + sv.RetrainingFrequency = ptr.String(jtv) + } + + case "RetrainingStartDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RetrainingStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) + } + sv.Status = types.RetrainingSchedulerStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentS3Object(v **types.S3Object, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8478,15 +9622,64 @@ func awsAwsjson10_deserializeOpDocumentCreateLabelOutput(v **CreateLabelOutput, sv = *v } - for key, value := range shape { - switch key { - case "LabelId": + for key, value := range shape { + switch key { + case "LabelId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LabelId to be of type string, got %T instead", value) + } + sv.LabelId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentCreateModelOutput(v **CreateModelOutput, 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 *CreateModelOutput + if *v == nil { + sv = &CreateModelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LabelId to be of type string, got %T instead", value) + return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) } - sv.LabelId = ptr.String(jtv) + sv.Status = types.ModelStatus(jtv) } default: @@ -8498,7 +9691,7 @@ func awsAwsjson10_deserializeOpDocumentCreateLabelOutput(v **CreateLabelOutput, return nil } -func awsAwsjson10_deserializeOpDocumentCreateModelOutput(v **CreateModelOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentCreateRetrainingSchedulerOutput(v **CreateRetrainingSchedulerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8511,9 +9704,9 @@ func awsAwsjson10_deserializeOpDocumentCreateModelOutput(v **CreateModelOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateModelOutput + var sv *CreateRetrainingSchedulerOutput if *v == nil { - sv = &CreateModelOutput{} + sv = &CreateRetrainingSchedulerOutput{} } else { sv = *v } @@ -8529,13 +9722,22 @@ func awsAwsjson10_deserializeOpDocumentCreateModelOutput(v **CreateModelOutput, sv.ModelArn = ptr.String(jtv) } + case "ModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) + } + sv.ModelName = ptr.String(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) } - sv.Status = types.ModelStatus(jtv) + sv.Status = types.RetrainingSchedulerStatus(jtv) } default: @@ -9307,6 +10509,38 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelOutput(v **DescribeModelOutp for key, value := range shape { switch key { + case "AccumulatedInferenceDataEndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AccumulatedInferenceDataEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "AccumulatedInferenceDataStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.AccumulatedInferenceDataStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "ActiveModelVersion": if value != nil { jtv, ok := value.(json.Number) @@ -9462,6 +10696,66 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelOutput(v **DescribeModelOutp } } + case "LatestScheduledRetrainingAvailableDataInDays": + 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.LatestScheduledRetrainingAvailableDataInDays = ptr.Int32(int32(i64)) + } + + case "LatestScheduledRetrainingFailedReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BoundedLengthString to be of type string, got %T instead", value) + } + sv.LatestScheduledRetrainingFailedReason = ptr.String(jtv) + } + + case "LatestScheduledRetrainingModelVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ModelVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LatestScheduledRetrainingModelVersion = ptr.Int64(i64) + } + + case "LatestScheduledRetrainingStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LatestScheduledRetrainingStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "LatestScheduledRetrainingStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelVersionStatus to be of type string, got %T instead", value) + } + sv.LatestScheduledRetrainingStatus = types.ModelVersionStatus(jtv) + } + case "ModelArn": if value != nil { jtv, ok := value.(string) @@ -9505,6 +10799,22 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelOutput(v **DescribeModelOutp } } + case "NextScheduledRetrainingStartDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextScheduledRetrainingStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "OffCondition": if value != nil { jtv, ok := value.(string) @@ -9552,6 +10862,24 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelOutput(v **DescribeModelOutp } } + case "PriorModelMetrics": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SynthesizedJsonModelMetrics to be of type string, got %T instead", value) + } + sv.PriorModelMetrics = ptr.String(jtv) + } + + case "RetrainingSchedulerStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) + } + sv.RetrainingSchedulerStatus = types.RetrainingSchedulerStatus(jtv) + } + case "RoleArn": if value != nil { jtv, ok := value.(string) @@ -9692,6 +11020,24 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo for key, value := range shape { switch key { + case "AutoPromotionResult": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutoPromotionResult to be of type string, got %T instead", value) + } + sv.AutoPromotionResult = types.AutoPromotionResult(jtv) + } + + case "AutoPromotionResultReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutoPromotionResultReason to be of type string, got %T instead", value) + } + sv.AutoPromotionResultReason = ptr.String(jtv) + } + case "CreatedAt": if value != nil { switch jtv := value.(type) { @@ -9896,6 +11242,28 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo sv.OffCondition = ptr.String(jtv) } + case "PriorModelMetrics": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelMetrics to be of type string, got %T instead", value) + } + sv.PriorModelMetrics = ptr.String(jtv) + } + + case "RetrainingAvailableDataInDays": + 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.RetrainingAvailableDataInDays = ptr.Int32(int32(i64)) + } + case "RoleArn": if value != nil { jtv, ok := value.(string) @@ -9950,7 +11318,102 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo sv.Status = types.ModelVersionStatus(jtv) } - case "TrainingDataEndTime": + case "TrainingDataEndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TrainingDataEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "TrainingDataStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TrainingDataStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "TrainingExecutionEndTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TrainingExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "TrainingExecutionStartTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TrainingExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **DescribeResourcePolicyOutput, 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 *DescribeResourcePolicyOutput + if *v == nil { + sv = &DescribeResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -9958,7 +11421,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo if err != nil { return err } - sv.TrainingDataEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -9966,7 +11429,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo } } - case "TrainingDataStartTime": + case "LastModifiedTime": if value != nil { switch jtv := value.(type) { case json.Number: @@ -9974,7 +11437,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo if err != nil { return err } - sv.TrainingDataStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -9982,36 +11445,22 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo } } - case "TrainingExecutionEndTime": + case "PolicyRevisionId": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TrainingExecutionEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyRevisionId to be of type string, got %T instead", value) } + sv.PolicyRevisionId = ptr.String(jtv) } - case "TrainingExecutionStartTime": + case "ResourcePolicy": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TrainingExecutionStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Policy to be of type string, got %T instead", value) } + sv.ResourcePolicy = ptr.String(jtv) } default: @@ -10023,7 +11472,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeModelVersionOutput(v **DescribeMo return nil } -func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **DescribeResourcePolicyOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDescribeRetrainingSchedulerOutput(v **DescribeRetrainingSchedulerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10036,16 +11485,16 @@ func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **Describe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeResourcePolicyOutput + var sv *DescribeRetrainingSchedulerOutput if *v == nil { - sv = &DescribeResourcePolicyOutput{} + sv = &DescribeRetrainingSchedulerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CreationTime": + case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -10053,7 +11502,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **Describe if err != nil { return err } - sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -10061,7 +11510,52 @@ func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **Describe } } - case "LastModifiedTime": + case "LookbackWindow": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LookbackWindow to be of type string, got %T instead", value) + } + sv.LookbackWindow = ptr.String(jtv) + } + + case "ModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "ModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) + } + sv.ModelName = ptr.String(jtv) + } + + case "PromoteMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelPromoteMode to be of type string, got %T instead", value) + } + sv.PromoteMode = types.ModelPromoteMode(jtv) + } + + case "RetrainingFrequency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingFrequency to be of type string, got %T instead", value) + } + sv.RetrainingFrequency = ptr.String(jtv) + } + + case "RetrainingStartDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -10069,7 +11563,7 @@ func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **Describe if err != nil { return err } - sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.RetrainingStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) @@ -10077,22 +11571,29 @@ func awsAwsjson10_deserializeOpDocumentDescribeResourcePolicyOutput(v **Describe } } - case "PolicyRevisionId": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyRevisionId to be of type string, got %T instead", value) + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) } - sv.PolicyRevisionId = ptr.String(jtv) + sv.Status = types.RetrainingSchedulerStatus(jtv) } - case "ResourcePolicy": + case "UpdatedAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Policy to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } - sv.ResourcePolicy = ptr.String(jtv) } default: @@ -10656,6 +12157,51 @@ func awsAwsjson10_deserializeOpDocumentListModelVersionsOutput(v **ListModelVers return nil } +func awsAwsjson10_deserializeOpDocumentListRetrainingSchedulersOutput(v **ListRetrainingSchedulersOutput, 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 *ListRetrainingSchedulersOutput + if *v == nil { + sv = &ListRetrainingSchedulersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RetrainingSchedulerSummaries": + if err := awsAwsjson10_deserializeDocumentRetrainingSchedulerSummaries(&sv.RetrainingSchedulerSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListSensorStatisticsOutput(v **ListSensorStatisticsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10911,6 +12457,64 @@ func awsAwsjson10_deserializeOpDocumentStartInferenceSchedulerOutput(v **StartIn return nil } +func awsAwsjson10_deserializeOpDocumentStartRetrainingSchedulerOutput(v **StartRetrainingSchedulerOutput, 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 *StartRetrainingSchedulerOutput + if *v == nil { + sv = &StartRetrainingSchedulerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "ModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) + } + sv.ModelName = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) + } + sv.Status = types.RetrainingSchedulerStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentStopInferenceSchedulerOutput(v **StopInferenceSchedulerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10987,6 +12591,64 @@ func awsAwsjson10_deserializeOpDocumentStopInferenceSchedulerOutput(v **StopInfe return nil } +func awsAwsjson10_deserializeOpDocumentStopRetrainingSchedulerOutput(v **StopRetrainingSchedulerOutput, 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 *StopRetrainingSchedulerOutput + if *v == nil { + sv = &StopRetrainingSchedulerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ModelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelArn to be of type string, got %T instead", value) + } + sv.ModelArn = ptr.String(jtv) + } + + case "ModelName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) + } + sv.ModelName = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrainingSchedulerStatus to be of type string, got %T instead", value) + } + sv.Status = types.RetrainingSchedulerStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/lookoutequipment/generated.json b/service/lookoutequipment/generated.json index 11856e5d7b6..55948c6fae1 100644 --- a/service/lookoutequipment/generated.json +++ b/service/lookoutequipment/generated.json @@ -14,12 +14,14 @@ "api_op_CreateLabel.go", "api_op_CreateLabelGroup.go", "api_op_CreateModel.go", + "api_op_CreateRetrainingScheduler.go", "api_op_DeleteDataset.go", "api_op_DeleteInferenceScheduler.go", "api_op_DeleteLabel.go", "api_op_DeleteLabelGroup.go", "api_op_DeleteModel.go", "api_op_DeleteResourcePolicy.go", + "api_op_DeleteRetrainingScheduler.go", "api_op_DescribeDataIngestionJob.go", "api_op_DescribeDataset.go", "api_op_DescribeInferenceScheduler.go", @@ -28,6 +30,7 @@ "api_op_DescribeModel.go", "api_op_DescribeModelVersion.go", "api_op_DescribeResourcePolicy.go", + "api_op_DescribeRetrainingScheduler.go", "api_op_ImportDataset.go", "api_op_ImportModelVersion.go", "api_op_ListDataIngestionJobs.go", @@ -39,17 +42,22 @@ "api_op_ListLabels.go", "api_op_ListModelVersions.go", "api_op_ListModels.go", + "api_op_ListRetrainingSchedulers.go", "api_op_ListSensorStatistics.go", "api_op_ListTagsForResource.go", "api_op_PutResourcePolicy.go", "api_op_StartDataIngestionJob.go", "api_op_StartInferenceScheduler.go", + "api_op_StartRetrainingScheduler.go", "api_op_StopInferenceScheduler.go", + "api_op_StopRetrainingScheduler.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateActiveModelVersion.go", "api_op_UpdateInferenceScheduler.go", "api_op_UpdateLabelGroup.go", + "api_op_UpdateModel.go", + "api_op_UpdateRetrainingScheduler.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/lookoutequipment/serializers.go b/service/lookoutequipment/serializers.go index c0127aa6220..e09051c52e4 100644 --- a/service/lookoutequipment/serializers.go +++ b/service/lookoutequipment/serializers.go @@ -291,6 +291,61 @@ func (m *awsAwsjson10_serializeOpCreateModel) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpCreateRetrainingScheduler struct { +} + +func (*awsAwsjson10_serializeOpCreateRetrainingScheduler) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateRetrainingScheduler) 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.(*CreateRetrainingSchedulerInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.CreateRetrainingScheduler") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateRetrainingSchedulerInput(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 awsAwsjson10_serializeOpDeleteDataset struct { } @@ -621,6 +676,61 @@ func (m *awsAwsjson10_serializeOpDeleteResourcePolicy) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteRetrainingScheduler struct { +} + +func (*awsAwsjson10_serializeOpDeleteRetrainingScheduler) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteRetrainingScheduler) 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.(*DeleteRetrainingSchedulerInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.DeleteRetrainingScheduler") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteRetrainingSchedulerInput(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 awsAwsjson10_serializeOpDescribeDataIngestionJob struct { } @@ -1061,6 +1171,61 @@ func (m *awsAwsjson10_serializeOpDescribeResourcePolicy) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDescribeRetrainingScheduler struct { +} + +func (*awsAwsjson10_serializeOpDescribeRetrainingScheduler) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDescribeRetrainingScheduler) 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.(*DescribeRetrainingSchedulerInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.DescribeRetrainingScheduler") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDescribeRetrainingSchedulerInput(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 awsAwsjson10_serializeOpImportDataset struct { } @@ -1666,6 +1831,61 @@ func (m *awsAwsjson10_serializeOpListModelVersions) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListRetrainingSchedulers struct { +} + +func (*awsAwsjson10_serializeOpListRetrainingSchedulers) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListRetrainingSchedulers) 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.(*ListRetrainingSchedulersInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.ListRetrainingSchedulers") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListRetrainingSchedulersInput(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 awsAwsjson10_serializeOpListSensorStatistics struct { } @@ -1941,14 +2161,14 @@ func (m *awsAwsjson10_serializeOpStartInferenceScheduler) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpStopInferenceScheduler struct { +type awsAwsjson10_serializeOpStartRetrainingScheduler struct { } -func (*awsAwsjson10_serializeOpStopInferenceScheduler) ID() string { +func (*awsAwsjson10_serializeOpStartRetrainingScheduler) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpStopInferenceScheduler) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpStartRetrainingScheduler) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1956,7 +2176,7 @@ func (m *awsAwsjson10_serializeOpStopInferenceScheduler) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StopInferenceSchedulerInput) + input, ok := in.Parameters.(*StartRetrainingSchedulerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1977,10 +2197,10 @@ func (m *awsAwsjson10_serializeOpStopInferenceScheduler) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.StopInferenceScheduler") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.StartRetrainingScheduler") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentStopInferenceSchedulerInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentStartRetrainingSchedulerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1996,14 +2216,14 @@ func (m *awsAwsjson10_serializeOpStopInferenceScheduler) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpTagResource struct { +type awsAwsjson10_serializeOpStopInferenceScheduler struct { } -func (*awsAwsjson10_serializeOpTagResource) ID() string { +func (*awsAwsjson10_serializeOpStopInferenceScheduler) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpStopInferenceScheduler) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2011,7 +2231,7 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*TagResourceInput) + input, ok := in.Parameters.(*StopInferenceSchedulerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2032,10 +2252,10 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.TagResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.StopInferenceScheduler") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentStopInferenceSchedulerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2051,14 +2271,14 @@ func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUntagResource struct { +type awsAwsjson10_serializeOpStopRetrainingScheduler struct { } -func (*awsAwsjson10_serializeOpUntagResource) ID() string { +func (*awsAwsjson10_serializeOpStopRetrainingScheduler) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpStopRetrainingScheduler) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2066,7 +2286,7 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*StopRetrainingSchedulerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2087,10 +2307,10 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UntagResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.StopRetrainingScheduler") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentStopRetrainingSchedulerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2106,14 +2326,14 @@ func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateActiveModelVersion struct { +type awsAwsjson10_serializeOpTagResource struct { } -func (*awsAwsjson10_serializeOpUpdateActiveModelVersion) ID() string { +func (*awsAwsjson10_serializeOpTagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUpdateActiveModelVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2121,7 +2341,7 @@ func (m *awsAwsjson10_serializeOpUpdateActiveModelVersion) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateActiveModelVersionInput) + input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2142,10 +2362,10 @@ func (m *awsAwsjson10_serializeOpUpdateActiveModelVersion) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateActiveModelVersion") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.TagResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateActiveModelVersionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2161,14 +2381,14 @@ func (m *awsAwsjson10_serializeOpUpdateActiveModelVersion) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateInferenceScheduler struct { +type awsAwsjson10_serializeOpUntagResource struct { } -func (*awsAwsjson10_serializeOpUpdateInferenceScheduler) ID() string { +func (*awsAwsjson10_serializeOpUntagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUpdateInferenceScheduler) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2176,7 +2396,7 @@ func (m *awsAwsjson10_serializeOpUpdateInferenceScheduler) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateInferenceSchedulerInput) + input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2197,10 +2417,10 @@ func (m *awsAwsjson10_serializeOpUpdateInferenceScheduler) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateInferenceScheduler") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UntagResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateInferenceSchedulerInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2216,14 +2436,14 @@ func (m *awsAwsjson10_serializeOpUpdateInferenceScheduler) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateLabelGroup struct { +type awsAwsjson10_serializeOpUpdateActiveModelVersion struct { } -func (*awsAwsjson10_serializeOpUpdateLabelGroup) ID() string { +func (*awsAwsjson10_serializeOpUpdateActiveModelVersion) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUpdateLabelGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateActiveModelVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -2231,7 +2451,7 @@ func (m *awsAwsjson10_serializeOpUpdateLabelGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateLabelGroupInput) + input, ok := in.Parameters.(*UpdateActiveModelVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2252,10 +2472,230 @@ func (m *awsAwsjson10_serializeOpUpdateLabelGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateLabelGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateActiveModelVersion") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateLabelGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateActiveModelVersionInput(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 awsAwsjson10_serializeOpUpdateInferenceScheduler struct { +} + +func (*awsAwsjson10_serializeOpUpdateInferenceScheduler) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateInferenceScheduler) 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.(*UpdateInferenceSchedulerInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateInferenceScheduler") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateInferenceSchedulerInput(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 awsAwsjson10_serializeOpUpdateLabelGroup struct { +} + +func (*awsAwsjson10_serializeOpUpdateLabelGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateLabelGroup) 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.(*UpdateLabelGroupInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateLabelGroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateLabelGroupInput(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 awsAwsjson10_serializeOpUpdateModel struct { +} + +func (*awsAwsjson10_serializeOpUpdateModel) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateModel) 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.(*UpdateModelInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateModel") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateModelInput(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 awsAwsjson10_serializeOpUpdateRetrainingScheduler struct { +} + +func (*awsAwsjson10_serializeOpUpdateRetrainingScheduler) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateRetrainingScheduler) 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.(*UpdateRetrainingSchedulerInput) + _ = 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.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSLookoutEquipmentFrontendService.UpdateRetrainingScheduler") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateRetrainingSchedulerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2776,6 +3216,43 @@ func awsAwsjson10_serializeOpDocumentCreateModelInput(v *CreateModelInput, value return nil } +func awsAwsjson10_serializeOpDocumentCreateRetrainingSchedulerInput(v *CreateRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.LookbackWindow != nil { + ok := object.Key("LookbackWindow") + ok.String(*v.LookbackWindow) + } + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + if len(v.PromoteMode) > 0 { + ok := object.Key("PromoteMode") + ok.String(string(v.PromoteMode)) + } + + if v.RetrainingFrequency != nil { + ok := object.Key("RetrainingFrequency") + ok.String(*v.RetrainingFrequency) + } + + if v.RetrainingStartDate != nil { + ok := object.Key("RetrainingStartDate") + ok.Double(smithytime.FormatEpochSeconds(*v.RetrainingStartDate)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteDatasetInput(v *DeleteDatasetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2853,6 +3330,18 @@ func awsAwsjson10_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResource return nil } +func awsAwsjson10_serializeOpDocumentDeleteRetrainingSchedulerInput(v *DeleteRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDescribeDataIngestionJobInput(v *DescribeDataIngestionJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2959,6 +3448,18 @@ func awsAwsjson10_serializeOpDocumentDescribeResourcePolicyInput(v *DescribeReso return nil } +func awsAwsjson10_serializeOpDocumentDescribeRetrainingSchedulerInput(v *DescribeRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentImportDatasetInput(v *ImportDatasetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3007,6 +3508,11 @@ func awsAwsjson10_serializeOpDocumentImportModelVersionInput(v *ImportModelVersi ok.String(*v.DatasetName) } + if len(v.InferenceDataImportStrategy) > 0 { + ok := object.Key("InferenceDataImportStrategy") + ok.String(string(v.InferenceDataImportStrategy)) + } + if v.LabelsInputConfiguration != nil { ok := object.Key("LabelsInputConfiguration") if err := awsAwsjson10_serializeDocumentLabelsInputConfiguration(v.LabelsInputConfiguration, ok); err != nil { @@ -3342,6 +3848,33 @@ func awsAwsjson10_serializeOpDocumentListModelVersionsInput(v *ListModelVersions return nil } +func awsAwsjson10_serializeOpDocumentListRetrainingSchedulersInput(v *ListRetrainingSchedulersInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.ModelNameBeginsWith != nil { + ok := object.Key("ModelNameBeginsWith") + ok.String(*v.ModelNameBeginsWith) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListSensorStatisticsInput(v *ListSensorStatisticsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3449,6 +3982,18 @@ func awsAwsjson10_serializeOpDocumentStartInferenceSchedulerInput(v *StartInfere return nil } +func awsAwsjson10_serializeOpDocumentStartRetrainingSchedulerInput(v *StartRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentStopInferenceSchedulerInput(v *StopInferenceSchedulerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3461,6 +4006,18 @@ func awsAwsjson10_serializeOpDocumentStopInferenceSchedulerInput(v *StopInferenc return nil } +func awsAwsjson10_serializeOpDocumentStopRetrainingSchedulerInput(v *StopRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3575,3 +4132,59 @@ func awsAwsjson10_serializeOpDocumentUpdateLabelGroupInput(v *UpdateLabelGroupIn return nil } + +func awsAwsjson10_serializeOpDocumentUpdateModelInput(v *UpdateModelInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LabelsInputConfiguration != nil { + ok := object.Key("LabelsInputConfiguration") + if err := awsAwsjson10_serializeDocumentLabelsInputConfiguration(v.LabelsInputConfiguration, ok); err != nil { + return err + } + } + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + return nil +} + +func awsAwsjson10_serializeOpDocumentUpdateRetrainingSchedulerInput(v *UpdateRetrainingSchedulerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LookbackWindow != nil { + ok := object.Key("LookbackWindow") + ok.String(*v.LookbackWindow) + } + + if v.ModelName != nil { + ok := object.Key("ModelName") + ok.String(*v.ModelName) + } + + if len(v.PromoteMode) > 0 { + ok := object.Key("PromoteMode") + ok.String(string(v.PromoteMode)) + } + + if v.RetrainingFrequency != nil { + ok := object.Key("RetrainingFrequency") + ok.String(*v.RetrainingFrequency) + } + + if v.RetrainingStartDate != nil { + ok := object.Key("RetrainingStartDate") + ok.Double(smithytime.FormatEpochSeconds(*v.RetrainingStartDate)) + } + + return nil +} diff --git a/service/lookoutequipment/types/enums.go b/service/lookoutequipment/types/enums.go index f13786fe883..9e8a079848f 100644 --- a/service/lookoutequipment/types/enums.go +++ b/service/lookoutequipment/types/enums.go @@ -2,6 +2,30 @@ package types +type AutoPromotionResult string + +// Enum values for AutoPromotionResult +const ( + AutoPromotionResultModelPromoted AutoPromotionResult = "MODEL_PROMOTED" + AutoPromotionResultModelNotPromoted AutoPromotionResult = "MODEL_NOT_PROMOTED" + AutoPromotionResultRetrainingInternalError AutoPromotionResult = "RETRAINING_INTERNAL_ERROR" + AutoPromotionResultRetrainingCustomerError AutoPromotionResult = "RETRAINING_CUSTOMER_ERROR" + AutoPromotionResultRetrainingCancelled AutoPromotionResult = "RETRAINING_CANCELLED" +) + +// Values returns all known values for AutoPromotionResult. 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 (AutoPromotionResult) Values() []AutoPromotionResult { + return []AutoPromotionResult{ + "MODEL_PROMOTED", + "MODEL_NOT_PROMOTED", + "RETRAINING_INTERNAL_ERROR", + "RETRAINING_CUSTOMER_ERROR", + "RETRAINING_CANCELLED", + } +} + type DatasetStatus string // Enum values for DatasetStatus @@ -48,6 +72,26 @@ func (DataUploadFrequency) Values() []DataUploadFrequency { } } +type InferenceDataImportStrategy string + +// Enum values for InferenceDataImportStrategy +const ( + InferenceDataImportStrategyNoImport InferenceDataImportStrategy = "NO_IMPORT" + InferenceDataImportStrategyAddWhenEmpty InferenceDataImportStrategy = "ADD_WHEN_EMPTY" + InferenceDataImportStrategyOverwrite InferenceDataImportStrategy = "OVERWRITE" +) + +// Values returns all known values for InferenceDataImportStrategy. 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 (InferenceDataImportStrategy) Values() []InferenceDataImportStrategy { + return []InferenceDataImportStrategy{ + "NO_IMPORT", + "ADD_WHEN_EMPTY", + "OVERWRITE", + } +} + type InferenceExecutionStatus string // Enum values for InferenceExecutionStatus @@ -150,6 +194,24 @@ func (LatestInferenceResult) Values() []LatestInferenceResult { } } +type ModelPromoteMode string + +// Enum values for ModelPromoteMode +const ( + ModelPromoteModeManaged ModelPromoteMode = "MANAGED" + ModelPromoteModeManual ModelPromoteMode = "MANUAL" +) + +// Values returns all known values for ModelPromoteMode. 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 (ModelPromoteMode) Values() []ModelPromoteMode { + return []ModelPromoteMode{ + "MANAGED", + "MANUAL", + } +} + type ModelStatus string // Enum values for ModelStatus @@ -236,6 +298,28 @@ func (Monotonicity) Values() []Monotonicity { } } +type RetrainingSchedulerStatus string + +// Enum values for RetrainingSchedulerStatus +const ( + RetrainingSchedulerStatusPending RetrainingSchedulerStatus = "PENDING" + RetrainingSchedulerStatusRunning RetrainingSchedulerStatus = "RUNNING" + RetrainingSchedulerStatusStopping RetrainingSchedulerStatus = "STOPPING" + RetrainingSchedulerStatusStopped RetrainingSchedulerStatus = "STOPPED" +) + +// Values returns all known values for RetrainingSchedulerStatus. 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 (RetrainingSchedulerStatus) Values() []RetrainingSchedulerStatus { + return []RetrainingSchedulerStatus{ + "PENDING", + "RUNNING", + "STOPPING", + "STOPPED", + } +} + type StatisticalIssueStatus string // Enum values for StatisticalIssueStatus diff --git a/service/lookoutequipment/types/types.go b/service/lookoutequipment/types/types.go index fd94bff9aaa..6900ed86a7c 100644 --- a/service/lookoutequipment/types/types.go +++ b/service/lookoutequipment/types/types.go @@ -123,7 +123,7 @@ type DataQualitySummary struct { // Provides information about the data schema used with the given dataset. type DatasetSchema struct { - // + // The data schema used within the given dataset. // // This value conforms to the media type: application/json InlineDataSchema *string @@ -193,7 +193,7 @@ type InferenceEventSummary struct { // on. type InferenceExecutionSummary struct { - // + // The S3 object that the inference execution results were uploaded to. CustomerResultObject *S3Object // Indicates the time reference in the dataset at which the inference execution @@ -222,12 +222,20 @@ type InferenceExecutionSummary struct { // The name of the inference scheduler being used for the inference execution. InferenceSchedulerName *string - // The Amazon Resource Name (ARN) of the ML model used for the inference execution. + // The Amazon Resource Name (ARN) of the machine learning model used for the + // inference execution. ModelArn *string - // The name of the ML model being used for the inference execution. + // The name of the machine learning model being used for the inference execution. ModelName *string + // The model version used for the inference execution. + ModelVersion *int64 + + // The Amazon Resource Number (ARN) of the model version used for the inference + // execution. + ModelVersionArn *string + // Indicates the start time at which the inference scheduler began the specific // inference execution. ScheduledStartTime *time.Time @@ -349,10 +357,11 @@ type InferenceSchedulerSummary struct { // Anomalous (anomalous events found) or Normal (no anomalous events found). LatestInferenceResult LatestInferenceResult - // The Amazon Resource Name (ARN) of the ML model used by the inference scheduler. + // The Amazon Resource Name (ARN) of the machine learning model used by the + // inference scheduler. ModelArn *string - // The name of the ML model used for the inference scheduler. + // The name of the machine learning model used for the inference scheduler. ModelName *string // Indicates the status of the inference scheduler. @@ -584,8 +593,8 @@ type MissingSensorData struct { noSmithyDocumentSerde } -// Provides information about the specified ML model, including dataset and model -// names and ARNs, as well as status. +// Provides information about the specified machine learning model, including +// dataset and model names and ARNs, as well as status. type ModelSummary struct { // The model version that the inference scheduler uses to run an inference @@ -603,16 +612,33 @@ type ModelSummary struct { // The Amazon Resource Name (ARN) of the dataset used to create the model. DatasetArn *string - // The name of the dataset being used for the ML model. + // The name of the dataset being used for the machine learning model. DatasetName *string - // The Amazon Resource Name (ARN) of the ML model. + // Indicates the most recent model version that was generated by retraining. + LatestScheduledRetrainingModelVersion *int64 + + // Indicates the start time of the most recent scheduled retraining run. + LatestScheduledRetrainingStartTime *time.Time + + // Indicates the status of the most recent scheduled retraining run. + LatestScheduledRetrainingStatus ModelVersionStatus + + // The Amazon Resource Name (ARN) of the machine learning model. ModelArn *string - // The name of the ML model. + // The name of the machine learning model. ModelName *string - // Indicates the status of the ML model. + // Indicates the date that the next scheduled retraining run will start on. + // Lookout for Equipment truncates the time you provide to the nearest UTC day (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp) + // . + NextScheduledRetrainingStartDate *time.Time + + // Indicates the status of the retraining scheduler. + RetrainingSchedulerStatus RetrainingSchedulerStatus + + // Indicates the status of the machine learning model. Status ModelStatus noSmithyDocumentSerde @@ -673,6 +699,33 @@ type MultipleOperatingModes struct { noSmithyDocumentSerde } +// Provides information about the specified retraining scheduler, including model +// name, status, start date, frequency, and lookback window. +type RetrainingSchedulerSummary struct { + + // The number of past days of data used for retraining. + LookbackWindow *string + + // The ARN of the model that the retraining scheduler is attached to. + ModelArn *string + + // The name of the model that the retraining scheduler is attached to. + ModelName *string + + // The frequency at which the model retraining is set. This follows the ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601#Durations) + // guidelines. + RetrainingFrequency *string + + // The start date for the retraining scheduler. Lookout for Equipment truncates + // the time you provide to the nearest UTC day. + RetrainingStartDate *time.Time + + // The status of the retraining scheduler. + Status RetrainingSchedulerStatus + + noSmithyDocumentSerde +} + // Contains information about an S3 bucket. type S3Object struct { diff --git a/service/lookoutequipment/validators.go b/service/lookoutequipment/validators.go index e00ad79b643..675a77eca57 100644 --- a/service/lookoutequipment/validators.go +++ b/service/lookoutequipment/validators.go @@ -110,6 +110,26 @@ func (m *validateOpCreateModel) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateRetrainingScheduler struct { +} + +func (*validateOpCreateRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDataset struct { } @@ -230,6 +250,26 @@ func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpDeleteRetrainingScheduler struct { +} + +func (*validateOpDeleteRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeDataIngestionJob struct { } @@ -390,6 +430,26 @@ func (m *validateOpDescribeResourcePolicy) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpDescribeRetrainingScheduler struct { +} + +func (*validateOpDescribeRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpImportDataset struct { } @@ -610,6 +670,26 @@ func (m *validateOpStartInferenceScheduler) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpStartRetrainingScheduler struct { +} + +func (*validateOpStartRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStopInferenceScheduler struct { } @@ -630,6 +710,26 @@ func (m *validateOpStopInferenceScheduler) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpStopRetrainingScheduler struct { +} + +func (*validateOpStopRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStopRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StopRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStopRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -730,6 +830,46 @@ func (m *validateOpUpdateLabelGroup) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUpdateModel struct { +} + +func (*validateOpUpdateModel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateModelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateModelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRetrainingScheduler struct { +} + +func (*validateOpUpdateRetrainingScheduler) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRetrainingScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRetrainingSchedulerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRetrainingSchedulerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpCreateDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataset{}, middleware.After) } @@ -750,6 +890,10 @@ func addOpCreateModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateModel{}, middleware.After) } +func addOpCreateRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRetrainingScheduler{}, middleware.After) +} + func addOpDeleteDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataset{}, middleware.After) } @@ -774,6 +918,10 @@ func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) } +func addOpDeleteRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRetrainingScheduler{}, middleware.After) +} + func addOpDescribeDataIngestionJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDataIngestionJob{}, middleware.After) } @@ -806,6 +954,10 @@ func addOpDescribeResourcePolicyValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpDescribeResourcePolicy{}, middleware.After) } +func addOpDescribeRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeRetrainingScheduler{}, middleware.After) +} + func addOpImportDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportDataset{}, middleware.After) } @@ -850,10 +1002,18 @@ func addOpStartInferenceSchedulerValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpStartInferenceScheduler{}, middleware.After) } +func addOpStartRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartRetrainingScheduler{}, middleware.After) +} + func addOpStopInferenceSchedulerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopInferenceScheduler{}, middleware.After) } +func addOpStopRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStopRetrainingScheduler{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -874,6 +1034,14 @@ func addOpUpdateLabelGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateLabelGroup{}, middleware.After) } +func addOpUpdateModelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateModel{}, middleware.After) +} + +func addOpUpdateRetrainingSchedulerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRetrainingScheduler{}, middleware.After) +} + func validateInferenceInputConfiguration(v *types.InferenceInputConfiguration) error { if v == nil { return nil @@ -1191,6 +1359,30 @@ func validateOpCreateModelInput(v *CreateModelInput) error { } } +func validateOpCreateRetrainingSchedulerInput(v *CreateRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if v.RetrainingFrequency == nil { + invalidParams.Add(smithy.NewErrParamRequired("RetrainingFrequency")) + } + if v.LookbackWindow == nil { + invalidParams.Add(smithy.NewErrParamRequired("LookbackWindow")) + } + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDatasetInput(v *DeleteDatasetInput) error { if v == nil { return nil @@ -1284,6 +1476,21 @@ func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { } } +func validateOpDeleteRetrainingSchedulerInput(v *DeleteRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeDataIngestionJobInput(v *DescribeDataIngestionJobInput) error { if v == nil { return nil @@ -1410,6 +1617,21 @@ func validateOpDescribeResourcePolicyInput(v *DescribeResourcePolicyInput) error } } +func validateOpDescribeRetrainingSchedulerInput(v *DescribeRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpImportDatasetInput(v *ImportDatasetInput) error { if v == nil { return nil @@ -1624,6 +1846,21 @@ func validateOpStartInferenceSchedulerInput(v *StartInferenceSchedulerInput) err } } +func validateOpStartRetrainingSchedulerInput(v *StartRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStopInferenceSchedulerInput(v *StopInferenceSchedulerInput) error { if v == nil { return nil @@ -1639,6 +1876,21 @@ func validateOpStopInferenceSchedulerInput(v *StopInferenceSchedulerInput) error } } +func validateOpStopRetrainingSchedulerInput(v *StopRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StopRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -1736,3 +1988,38 @@ func validateOpUpdateLabelGroupInput(v *UpdateLabelGroupInput) error { return nil } } + +func validateOpUpdateModelInput(v *UpdateModelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateModelInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if v.LabelsInputConfiguration != nil { + if err := validateLabelsInputConfiguration(v.LabelsInputConfiguration); err != nil { + invalidParams.AddNested("LabelsInputConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRetrainingSchedulerInput(v *UpdateRetrainingSchedulerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRetrainingSchedulerInput"} + if v.ModelName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ModelName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +}