package s3shared

import (
	

	
)

// TODO: fix these error statements to be relevant to v2 sdk

const (
	invalidARNErrorErrCode    = "InvalidARNError"
	configurationErrorErrCode = "ConfigurationError"
)

// InvalidARNError denotes the error for Invalid ARN
type InvalidARNError struct {
	message  string
	resource arn.Resource
	origErr  error
}

// Error returns the InvalidARN error string
func ( InvalidARNError) () string {
	var  string
	if .resource != nil {
		 = "ARN: " + .resource.String()
	}
	 := invalidARNErrorErrCode + " : " + .message
	if  != "" {
		 =  + "\n\t" + 
	}

	return 
}

// OrigErr is the original error wrapped by Invalid ARN Error
func ( InvalidARNError) () error {
	return .origErr
}

// NewInvalidARNError denotes invalid arn error
func ( arn.Resource,  error) InvalidARNError {
	return InvalidARNError{
		message:  "invalid ARN",
		origErr:  ,
		resource: ,
	}
}

// NewInvalidARNWithUnsupportedPartitionError ARN not supported for the target partition
func ( arn.Resource,  error) InvalidARNError {
	return InvalidARNError{
		message:  "resource ARN not supported for the target ARN partition",
		origErr:  ,
		resource: ,
	}
}

// NewInvalidARNWithFIPSError ARN not supported for FIPS region
//
// Deprecated: FIPS will not appear in the ARN region component.
func ( arn.Resource,  error) InvalidARNError {
	return InvalidARNError{
		message:  "resource ARN not supported for FIPS region",
		resource: ,
		origErr:  ,
	}
}

// ConfigurationError is used to denote a client configuration error
type ConfigurationError struct {
	message           string
	resource          arn.Resource
	clientPartitionID string
	clientRegion      string
	origErr           error
}

// Error returns the Configuration error string
func ( ConfigurationError) () string {
	 := fmt.Sprintf("ARN: %s, client partition: %s, client region: %s",
		.resource, .clientPartitionID, .clientRegion)

	 := configurationErrorErrCode + " : " + .message
	if  != "" {
		 =  + "\n\t" + 
	}
	return 
}

// OrigErr is the original error wrapped by Configuration Error
func ( ConfigurationError) () error {
	return .origErr
}

// NewClientPartitionMismatchError  stub
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client partition does not match provided ARN partition",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewClientRegionMismatchError denotes cross region access error
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client region does not match provided ARN region",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewFailedToResolveEndpointError denotes endpoint resolving error
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "endpoint resolver failed to find an endpoint for the provided ARN region",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewClientConfiguredForFIPSError denotes client config error for unsupported cross region FIPS access
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client configured for fips but cross-region resource ARN provided",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewFIPSConfigurationError denotes a configuration error when a client or request is configured for FIPS
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "use of ARN is not supported when client or request is configured for FIPS",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewClientConfiguredForAccelerateError denotes client config error for unsupported S3 accelerate
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client configured for S3 Accelerate but is not supported with resource ARN",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewClientConfiguredForCrossRegionFIPSError denotes client config error for unsupported cross region FIPS request
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client configured for FIPS with cross-region enabled but is supported with cross-region resource ARN",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}

// NewClientConfiguredForDualStackError denotes client config error for unsupported S3 Dual-stack
func ( arn.Resource, ,  string,  error) ConfigurationError {
	return ConfigurationError{
		message:           "client configured for S3 Dual-stack but is not supported with resource ARN",
		origErr:           ,
		resource:          ,
		clientPartitionID: ,
		clientRegion:      ,
	}
}