func IsDeleteEndpoint404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DeleteEndpoint404Code && strings.HasPrefix(requestFailure.Message(), DeleteEndpoint404MessagePrefix)
	}
	return false
}
IsDeleteEndpoint404Error determines whether the given error is equivalent to an HTTP 404 status code.
package clientwrapper
import (
	"context"
	"strings"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	awsrequest "github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/service/sagemaker"
	"github.com/aws/aws-sdk-go/service/sagemaker/sagemakeriface"
	"github.com/pkg/errors"
	"github.com/aws/amazon-sagemaker-operator-for-k8s/controllers"
)
const (
	DescribeTrainingJob404Code          = "ValidationException"
	DescribeTrainingJob404MessagePrefix = "Requested resource not found"
	StopTrainingJob404Code              = "ValidationException"
	StopTrainingJob404MessagePrefix     = "Requested resource not found"
	DescribeProcessingJob404Code          = "ValidationException"
	DescribeProcessingJob404MessagePrefix = "Could not find requested job"
	DescribeHyperParameterTuningJob404Code          = "ResourceNotFound"
	DescribeHyperParameterTuningJob404MessagePrefix = "Amazon SageMaker can't find a tuning job"
	StopHyperParameterTuningJob404Code              = "ResourceNotFound"
	StopHyperParameterTuningJob404MessagePrefix     = "Amazon SageMaker can't find a tuning job"
	DeleteEndpoint404MessagePrefix                        = "Could not find endpoint"
	DeleteEndpoint404Code                                 = "ValidationException"
	DeleteEndpointInProgressMessagePrefix                 = "Cannot update in-progress endpoint"
	DeleteEndpointInProgressCode                          = "ValidationException"
	DescribeEndpoint404MessagePrefix                      = "Could not find endpoint"
	DescribeEndpoint404Code                               = "ValidationException"
	UpdateEndpoint404MessagePrefix                        = "Could not find endpoint"
	UpdateEndpoint404Code                                 = "ValidationException"
	UpdateEndpointUnableToFindEndpointConfigMessagePrefix = "Could not find endpoint configuration"
	UpdateEndpointUnableToFindEndpointConfigCode          = "ValidationException"
	DescribeEndpointConfig404MessagePrefix = "Could not find endpoint configuration"
	DescribeEndpointConfig404Code          = "ValidationException"
	DeleteEndpointConfig404MessagePrefix   = "Could not find endpoint configuration"
	DeleteEndpointConfig404Code            = "ValidationException"
	DescribeModel404MessagePrefix = "Could not find model"
	DescribeModel404Code          = "ValidationException"
	DeleteModel404MessagePrefix   = "Could not find model"
	DeleteModel404Code            = "ValidationException"
)
type SageMakerClientWrapper interface {
	DescribeTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.DescribeTrainingJobOutput, error)
	CreateTrainingJob(ctx context.Context, trainingJob *sagemaker.CreateTrainingJobInput) (*sagemaker.CreateTrainingJobOutput, error)
	StopTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.StopTrainingJobOutput, error)
	DescribeProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.DescribeProcessingJobOutput, error)
	CreateProcessingJob(ctx context.Context, processingJob *sagemaker.CreateProcessingJobInput) (*sagemaker.CreateProcessingJobOutput, error)
	StopProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.StopProcessingJobOutput, error)
	DescribeHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.DescribeHyperParameterTuningJobOutput, error)
	CreateHyperParameterTuningJob(ctx context.Context, tuningJob *sagemaker.CreateHyperParameterTuningJobInput) (*sagemaker.CreateHyperParameterTuningJobOutput, error)
	StopHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.StopHyperParameterTuningJobOutput, error)
	ListTrainingJobsForHyperParameterTuningJob(ctx context.Context, tuningJobName string, nextToken *string) (*sagemaker.ListTrainingJobsForHyperParameterTuningJobOutput, error)
	DescribeEndpoint(ctx context.Context, endpointName string) (*sagemaker.DescribeEndpointOutput, error)
	CreateEndpoint(ctx context.Context, endpoint *sagemaker.CreateEndpointInput) (*sagemaker.CreateEndpointOutput, error)
	DeleteEndpoint(ctx context.Context, endpointName *string) (*sagemaker.DeleteEndpointOutput, error)
	UpdateEndpoint(ctx context.Context, endpointName, endpointConfigName string, retainAllVariantProperties *bool, excludeRetainedVariantProperties []*sagemaker.VariantProperty) (*sagemaker.UpdateEndpointOutput, error)
	DescribeModel(ctx context.Context, modelName string) (*sagemaker.DescribeModelOutput, error)
	CreateModel(ctx context.Context, model *sagemaker.CreateModelInput) (*sagemaker.CreateModelOutput, error)
	DeleteModel(ctx context.Context, model *sagemaker.DeleteModelInput) (*sagemaker.DeleteModelOutput, error)
	DescribeEndpointConfig(ctx context.Context, endpointConfigName string) (*sagemaker.DescribeEndpointConfigOutput, error)
	CreateEndpointConfig(ctx context.Context, endpointConfig *sagemaker.CreateEndpointConfigInput) (*sagemaker.CreateEndpointConfigOutput, error)
	DeleteEndpointConfig(ctx context.Context, endpointConfig *sagemaker.DeleteEndpointConfigInput) (*sagemaker.DeleteEndpointConfigOutput, error)
}
func NewSageMakerClientWrapper(innerClient sagemakeriface.SageMakerAPI) SageMakerClientWrapper {
	return &sageMakerClientWrapper{
		innerClient: innerClient,
	}
}
type SageMakerClientWrapperProvider func(aws.Config) SageMakerClientWrapper
type sageMakerClientWrapper struct {
	SageMakerClientWrapper
	innerClient sagemakeriface.SageMakerAPI
}
func (c *sageMakerClientWrapper) DescribeTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.DescribeTrainingJobOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeTrainingJobRequest(&sagemaker.DescribeTrainingJobInput{
		TrainingJobName: &trainingJobName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeTrainingJob404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) CreateTrainingJob(ctx context.Context, trainingJob *sagemaker.CreateTrainingJobInput) (*sagemaker.CreateTrainingJobOutput, error) {
	createRequest, response := c.innerClient.CreateTrainingJobRequest(trainingJob)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err != nil {
		return nil, err
	}
	return response, nil
}
func (c *sageMakerClientWrapper) StopTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.StopTrainingJobOutput, error) {
	stopRequest, stopResponse := c.innerClient.StopTrainingJobRequest(&sagemaker.StopTrainingJobInput{
		TrainingJobName: &trainingJobName,
	})
	stopError := stopRequest.Send()
	if stopError != nil {
		return nil, stopError
	}
	return stopResponse, nil
}
func (c *sageMakerClientWrapper) isDescribeTrainingJob404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeTrainingJob404Code && strings.HasPrefix(requestFailure.Message(), DescribeTrainingJob404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) DescribeProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.DescribeProcessingJobOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeProcessingJobRequest(&sagemaker.DescribeProcessingJobInput{
		ProcessingJobName: &processingJobName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeProcessingJob404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) isDescribeProcessingJob404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeProcessingJob404Code && strings.HasPrefix(requestFailure.Message(), DescribeProcessingJob404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) CreateProcessingJob(ctx context.Context, processingJob *sagemaker.CreateProcessingJobInput) (*sagemaker.CreateProcessingJobOutput, error) {
	createRequest, response := c.innerClient.CreateProcessingJobRequest(processingJob)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err == nil {
		return response, nil
	}
	return nil, err
}
func (c *sageMakerClientWrapper) StopProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.StopProcessingJobOutput, error) {
	stopRequest, stopResponse := c.innerClient.StopProcessingJobRequest(&sagemaker.StopProcessingJobInput{
		ProcessingJobName: &processingJobName,
	})
	stopError := stopRequest.Send()
	if stopError != nil {
		return nil, stopError
	}
	return stopResponse, nil
}
func (c *sageMakerClientWrapper) DescribeHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.DescribeHyperParameterTuningJobOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeHyperParameterTuningJobRequest(&sagemaker.DescribeHyperParameterTuningJobInput{
		HyperParameterTuningJobName: &tuningJobName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeHyperParameterTuningJob404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) CreateHyperParameterTuningJob(ctx context.Context, tuningJob *sagemaker.CreateHyperParameterTuningJobInput) (*sagemaker.CreateHyperParameterTuningJobOutput, error) {
	createRequest, response := c.innerClient.CreateHyperParameterTuningJobRequest(tuningJob)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err != nil {
		return nil, err
	}
	return response, nil
}
func (c *sageMakerClientWrapper) StopHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.StopHyperParameterTuningJobOutput, error) {
	stopRequest, stopResponse := c.innerClient.StopHyperParameterTuningJobRequest(&sagemaker.StopHyperParameterTuningJobInput{
		HyperParameterTuningJobName: &tuningJobName,
	})
	stopError := stopRequest.Send()
	if stopError != nil {
		return nil, stopError
	}
	return stopResponse, nil
}
func (c *sageMakerClientWrapper) ListTrainingJobsForHyperParameterTuningJob(ctx context.Context, tuningJobName string, nextToken *string) (*sagemaker.ListTrainingJobsForHyperParameterTuningJobOutput, error) {
	req, hpoTrainingJobOutput := c.innerClient.ListTrainingJobsForHyperParameterTuningJobRequest(&sagemaker.ListTrainingJobsForHyperParameterTuningJobInput{
		HyperParameterTuningJobName: &tuningJobName,
		NextToken:                   nextToken,
	})
	err := req.Send()
	if err != nil {
		return nil, err
	}
	return hpoTrainingJobOutput, nil
}
func (c *sageMakerClientWrapper) isDescribeHyperParameterTuningJob404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeHyperParameterTuningJob404Code && strings.HasPrefix(requestFailure.Message(), DescribeHyperParameterTuningJob404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) DescribeEndpoint(ctx context.Context, endpointName string) (*sagemaker.DescribeEndpointOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeEndpointRequest(&sagemaker.DescribeEndpointInput{
		EndpointName: &endpointName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeEndpoint404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) isDescribeEndpoint404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeEndpoint404Code && strings.HasPrefix(requestFailure.Message(), DescribeEndpoint404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) CreateEndpoint(ctx context.Context, endpoint *sagemaker.CreateEndpointInput) (*sagemaker.CreateEndpointOutput, error) {
	createRequest, response := c.innerClient.CreateEndpointRequest(endpoint)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err != nil {
		return nil, err
	}
	return response, nil
}
func (c *sageMakerClientWrapper) DeleteEndpoint(ctx context.Context, endpointName *string) (*sagemaker.DeleteEndpointOutput, error) {
	deleteRequest, deleteResponse := c.innerClient.DeleteEndpointRequest(&sagemaker.DeleteEndpointInput{
		EndpointName: endpointName,
	})
	deleteError := deleteRequest.Send()
	if deleteError != nil {
		return nil, deleteError
	}
	return deleteResponse, nil
}
func (c *sageMakerClientWrapper) UpdateEndpoint(ctx context.Context, endpointName, endpointConfigName string, retainAllVariantProperties *bool, excludeRetainedVariantProperties []*sagemaker.VariantProperty) (*sagemaker.UpdateEndpointOutput, error) {
	updateRequest, updateResponse := c.innerClient.UpdateEndpointRequest(&sagemaker.UpdateEndpointInput{
		EndpointName:                     &endpointName,
		EndpointConfigName:               &endpointConfigName,
		RetainAllVariantProperties:       retainAllVariantProperties,
		ExcludeRetainedVariantProperties: excludeRetainedVariantProperties,
	})
	updateError := updateRequest.Send()
	if updateError != nil {
		return nil, updateError
	}
	return updateResponse, nil
}
func (c *sageMakerClientWrapper) DescribeModel(ctx context.Context, modelName string) (*sagemaker.DescribeModelOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeModelRequest(&sagemaker.DescribeModelInput{
		ModelName: &modelName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeModel404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) isDescribeModel404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeModel404Code && strings.HasPrefix(requestFailure.Message(), DescribeModel404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) CreateModel(ctx context.Context, model *sagemaker.CreateModelInput) (*sagemaker.CreateModelOutput, error) {
	createRequest, response := c.innerClient.CreateModelRequest(model)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err != nil {
		return nil, err
	}
	return response, nil
}
func (c *sageMakerClientWrapper) DeleteModel(ctx context.Context, model *sagemaker.DeleteModelInput) (*sagemaker.DeleteModelOutput, error) {
	deleteRequest, deleteResponse := c.innerClient.DeleteModelRequest(model)
	deleteError := deleteRequest.Send()
	if deleteError != nil {
		return nil, deleteError
	}
	return deleteResponse, deleteError
}
func (c *sageMakerClientWrapper) DescribeEndpointConfig(ctx context.Context, endpointconfigName string) (*sagemaker.DescribeEndpointConfigOutput, error) {
	describeRequest, describeResponse := c.innerClient.DescribeEndpointConfigRequest(&sagemaker.DescribeEndpointConfigInput{
		EndpointConfigName: &endpointconfigName,
	})
	describeError := describeRequest.Send()
	if describeError != nil {
		if c.isDescribeEndpointConfig404Error(describeError) {
			return nil, nil
		}
		return nil, describeError
	}
	return describeResponse, describeError
}
func (c *sageMakerClientWrapper) isDescribeEndpointConfig404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DescribeEndpointConfig404Code && strings.HasPrefix(requestFailure.Message(), DescribeEndpointConfig404MessagePrefix)
	}
	return false
}
func (c *sageMakerClientWrapper) CreateEndpointConfig(ctx context.Context, endpointconfig *sagemaker.CreateEndpointConfigInput) (*sagemaker.CreateEndpointConfigOutput, error) {
	createRequest, response := c.innerClient.CreateEndpointConfigRequest(endpointconfig)
	awsrequest.AddToUserAgent(createRequest, controllers.SagemakerOnKubernetesUserAgentAddition)
	err := createRequest.Send()
	if err != nil {
		return nil, err
	}
	return response, nil
}
func (c *sageMakerClientWrapper) DeleteEndpointConfig(ctx context.Context, endpointConfig *sagemaker.DeleteEndpointConfigInput) (*sagemaker.DeleteEndpointConfigOutput, error) {
	deleteRequest, deleteResponse := c.innerClient.DeleteEndpointConfigRequest(endpointConfig)
	deleteError := deleteRequest.Send()
	if deleteError != nil {
		return nil, deleteError
	}
	return deleteResponse, deleteError
}
func IsDeleteEndpointConfig404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DeleteEndpointConfig404Code && strings.HasPrefix(requestFailure.Message(), DeleteEndpointConfig404MessagePrefix)
	}
	return false
}
func IsDeleteModel404Error(err error) bool {
	if requestFailure, isRequestFailure := err.(awserr.RequestFailure); isRequestFailure {
		return requestFailure.Code() == DeleteModel404Code && strings.HasPrefix(requestFailure.Message(), DeleteModel404MessagePrefix)
	}
	return false
}