Merge pull request #6385 from Ticketmaster/use-sts-GetCallerIdentity

provider/aws: Added sts:GetCallerIdentity to GetAccountId for federated logins
This commit is contained in:
Radek Simko 2016-05-05 17:35:32 +01:00
commit e32a8c1c5b
61 changed files with 27981 additions and 841 deletions

237
Godeps/Godeps.json generated
View File

@ -227,228 +227,228 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awserr",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/defaults",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/request",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws/session",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/restjson",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/restxml",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/apigateway",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudformation",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudfront",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudtrail",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatchevents",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatchlogs",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/codecommit",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/codedeploy",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/directoryservice",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/dynamodb",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ecr",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ecs",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/efs",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/elasticache",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/elasticbeanstalk",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/elasticsearchservice",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/elb",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/emr",
@ -457,68 +457,73 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/firehose",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/glacier",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/iam",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/kinesis",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/kms",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/lambda",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/opsworks",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/rds",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/redshift",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/route53",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/s3",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/sns",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/sqs",
"Comment": "v1.1.15",
"Rev": "e7cf1e5986499eea7d4a87868f1eb578c8f2045a"
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/sts",
"Comment": "v1.1.23",
"Rev": "2cc71659118a868dc7544a7ef0808eb42d487011"
},
{
"ImportPath": "github.com/bgentry/speakeasy",

View File

@ -14,10 +14,11 @@ import (
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/hashicorp/go-cleanhttp"
)
func GetAccountId(iamconn *iam.IAM, authProviderName string) (string, error) {
func GetAccountId(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, error) {
// If we have creds from instance profile, we can use metadata API
if authProviderName == ec2rolecreds.ProviderName {
log.Println("[DEBUG] Trying to get account ID via AWS Metadata API")
@ -42,16 +43,24 @@ func GetAccountId(iamconn *iam.IAM, authProviderName string) (string, error) {
return parseAccountIdFromArn(*outUser.User.Arn)
}
// Then try IAM ListRoles
awsErr, ok := err.(awserr.Error)
// AccessDenied and ValidationError can be raised
// if credentials belong to federated profile, so we ignore these
if !ok || (awsErr.Code() != "AccessDenied" && awsErr.Code() != "ValidationError") {
return "", fmt.Errorf("Failed getting account ID via 'iam:GetUser': %s", err)
}
log.Printf("[DEBUG] Getting account ID via iam:GetUser failed: %s", err)
log.Println("[DEBUG] Trying to get account ID via iam:ListRoles instead")
// Then try STS GetCallerIdentity
log.Println("[DEBUG] Trying to get account ID via sts:GetCallerIdentity")
outCallerIdentity, err := stsconn.GetCallerIdentity(&sts.GetCallerIdentityInput{})
if err == nil {
return *outCallerIdentity.Account, nil
}
log.Printf("[DEBUG] Getting account ID via sts:GetCallerIdentity failed: %s", err)
// Then try IAM ListRoles
log.Println("[DEBUG] Trying to get account ID via iam:ListRoles")
outRoles, err := iamconn.ListRoles(&iam.ListRolesInput{
MaxItems: aws.Int64(int64(1)),
})

View File

@ -18,6 +18,7 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/sts"
)
func TestAWSGetAccountId_shouldBeValid_fromEC2Role(t *testing.T) {
@ -28,10 +29,10 @@ func TestAWSGetAccountId_shouldBeValid_fromEC2Role(t *testing.T) {
defer awsTs()
iamEndpoints := []*iamEndpoint{}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, ec2rolecreds.ProviderName)
id, err := GetAccountId(iamConn, stsConn, ec2rolecreds.ProviderName)
if err != nil {
t.Fatalf("Getting account ID from EC2 metadata API failed: %s", err)
}
@ -55,10 +56,10 @@ func TestAWSGetAccountId_shouldBeValid_EC2RoleHasPriority(t *testing.T) {
Response: &iamResponse{200, iamResponse_GetUser_valid, "text/xml"},
},
}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, ec2rolecreds.ProviderName)
id, err := GetAccountId(iamConn, stsConn, ec2rolecreds.ProviderName)
if err != nil {
t.Fatalf("Getting account ID from EC2 metadata API failed: %s", err)
}
@ -76,10 +77,36 @@ func TestAWSGetAccountId_shouldBeValid_fromIamUser(t *testing.T) {
Response: &iamResponse{200, iamResponse_GetUser_valid, "text/xml"},
},
}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, "")
id, err := GetAccountId(iamConn, stsConn, "")
if err != nil {
t.Fatalf("Getting account ID via GetUser failed: %s", err)
}
expectedAccountId := "123456789012"
if id != expectedAccountId {
t.Fatalf("Expected account ID: %s, given: %s", expectedAccountId, id)
}
}
func TestAWSGetAccountId_shouldBeValid_fromGetCallerIdentity(t *testing.T) {
iamEndpoints := []*iamEndpoint{
&iamEndpoint{
Request: &iamRequest{"POST", "/", "Action=GetUser&Version=2010-05-08"},
Response: &iamResponse{403, iamResponse_GetUser_unauthorized, "text/xml"},
},
&iamEndpoint{
Request: &iamRequest{"POST", "/", "Action=GetCallerIdentity&Version=2011-06-15"},
Response: &iamResponse{200, stsResponse_GetCallerIdentity_valid, "text/xml"},
},
}
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, stsConn, "")
if err != nil {
t.Fatalf("Getting account ID via GetUser failed: %s", err)
}
@ -96,15 +123,19 @@ func TestAWSGetAccountId_shouldBeValid_fromIamListRoles(t *testing.T) {
Request: &iamRequest{"POST", "/", "Action=GetUser&Version=2010-05-08"},
Response: &iamResponse{403, iamResponse_GetUser_unauthorized, "text/xml"},
},
&iamEndpoint{
Request: &iamRequest{"POST", "/", "Action=GetCallerIdentity&Version=2011-06-15"},
Response: &iamResponse{403, stsResponse_GetCallerIdentity_unauthorized, "text/xml"},
},
&iamEndpoint{
Request: &iamRequest{"POST", "/", "Action=ListRoles&MaxItems=1&Version=2010-05-08"},
Response: &iamResponse{200, iamResponse_ListRoles_valid, "text/xml"},
},
}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, "")
id, err := GetAccountId(iamConn, stsConn, "")
if err != nil {
t.Fatalf("Getting account ID via ListRoles failed: %s", err)
}
@ -126,10 +157,10 @@ func TestAWSGetAccountId_shouldBeValid_federatedRole(t *testing.T) {
Response: &iamResponse{200, iamResponse_ListRoles_valid, "text/xml"},
},
}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, "")
id, err := GetAccountId(iamConn, stsConn, "")
if err != nil {
t.Fatalf("Getting account ID via ListRoles failed: %s", err)
}
@ -151,10 +182,10 @@ func TestAWSGetAccountId_shouldError_unauthorizedFromIam(t *testing.T) {
Response: &iamResponse{403, iamResponse_ListRoles_unauthorized, "text/xml"},
},
}
ts, iamConn := getMockedAwsIamApi(iamEndpoints)
ts, iamConn, stsConn := getMockedAwsIamStsApi(iamEndpoints)
defer ts()
id, err := GetAccountId(iamConn, "")
id, err := GetAccountId(iamConn, stsConn, "")
if err == nil {
t.Fatal("Expected error when getting account ID")
}
@ -586,15 +617,15 @@ func invalidAwsEnv(t *testing.T) func() {
return ts.Close
}
// getMockedAwsIamApi establishes a httptest server to simulate behaviour
// of a real AWS' IAM server
func getMockedAwsIamApi(endpoints []*iamEndpoint) (func(), *iam.IAM) {
// getMockedAwsIamStsApi establishes a httptest server to simulate behaviour
// of a real AWS' IAM & STS server
func getMockedAwsIamStsApi(endpoints []*iamEndpoint) (func(), *iam.IAM, *sts.STS) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
buf := new(bytes.Buffer)
buf.ReadFrom(r.Body)
requestBody := buf.String()
log.Printf("[DEBUG] Received IAM API %q request to %q: %s",
log.Printf("[DEBUG] Received API %q request to %q: %s",
r.Method, r.RequestURI, requestBody)
for _, e := range endpoints {
@ -624,8 +655,8 @@ func getMockedAwsIamApi(endpoints []*iamEndpoint) (func(), *iam.IAM) {
CredentialsChainVerboseErrors: aws.Bool(true),
})
iamConn := iam.New(sess)
return ts.Close, iamConn
stsConn := sts.New(sess)
return ts.Close, iamConn, stsConn
}
func getEnv() *currentEnv {
@ -718,6 +749,26 @@ const iamResponse_GetUser_unauthorized = `<ErrorResponse xmlns="https://iam.amaz
<RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId>
</ErrorResponse>`
const stsResponse_GetCallerIdentity_valid = `<GetCallerIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
<GetCallerIdentityResult>
<Arn>arn:aws:iam::123456789012:user/Alice</Arn>
<UserId>AKIAI44QH8DHBEXAMPLE</UserId>
<Account>123456789012</Account>
</GetCallerIdentityResult>
<ResponseMetadata>
<RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId>
</ResponseMetadata>
</GetCallerIdentityResponse>`
const stsResponse_GetCallerIdentity_unauthorized = `<ErrorResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
<Error>
<Type>Sender</Type>
<Code>AccessDenied</Code>
<Message>User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: sts:GetCallerIdentity</Message>
</Error>
<RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId>
</ErrorResponse>`
const iamResponse_GetUser_federatedFailure = `<ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
<Error>
<Type>Sender</Type>

View File

@ -51,6 +51,7 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/sns"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/aws/aws-sdk-go/service/sts"
)
type Config struct {
@ -94,8 +95,10 @@ type AWSClient struct {
s3conn *s3.S3
sqsconn *sqs.SQS
snsconn *sns.SNS
stsconn *sts.STS
redshiftconn *redshift.Redshift
r53conn *route53.Route53
accountid string
region string
rdsconn *rds.RDS
iamconn *iam.IAM
@ -174,6 +177,9 @@ func (c *Config) Client() (interface{}, error) {
awsIamSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.IamEndpoint)})
client.iamconn = iam.New(awsIamSess)
log.Println("[INFO] Initializing STS connection")
client.stsconn = sts.New(sess)
err = c.ValidateCredentials(client.iamconn)
if err != nil {
errs = append(errs, err)
@ -187,6 +193,11 @@ func (c *Config) Client() (interface{}, error) {
// http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html
usEast1Sess := sess.Copy(&aws.Config{Region: aws.String("us-east-1")})
accountId, err := GetAccountId(client.iamconn, client.stsconn, cp.ProviderName)
if err == nil {
client.accountid = accountId
}
log.Println("[INFO] Initializing DynamoDB connection")
dynamoSess := sess.Copy(&aws.Config{Endpoint: aws.String(c.DynamoDBEndpoint)})
client.dynamodbconn = dynamodb.New(dynamoSess)
@ -217,7 +228,7 @@ func (c *Config) Client() (interface{}, error) {
log.Println("[INFO] Initializing Elastic Beanstalk Connection")
client.elasticbeanstalkconn = elasticbeanstalk.New(sess)
authErr := c.ValidateAccountId(client.iamconn, cp.ProviderName)
authErr := c.ValidateAccountId(client.accountid)
if authErr != nil {
errs = append(errs, authErr)
}
@ -343,20 +354,16 @@ func (c *Config) ValidateCredentials(iamconn *iam.IAM) error {
// ValidateAccountId returns a context-specific error if the configured account
// id is explicitly forbidden or not authorised; and nil if it is authorised.
func (c *Config) ValidateAccountId(iamconn *iam.IAM, authProviderName string) error {
func (c *Config) ValidateAccountId(accountId string) error {
if c.AllowedAccountIds == nil && c.ForbiddenAccountIds == nil {
return nil
}
log.Printf("[INFO] Validating account ID")
account_id, err := GetAccountId(iamconn, authProviderName)
if err != nil {
return err
}
if c.ForbiddenAccountIds != nil {
for _, id := range c.ForbiddenAccountIds {
if id == account_id {
if id == accountId {
return fmt.Errorf("Forbidden account ID (%s)", id)
}
}
@ -364,11 +371,11 @@ func (c *Config) ValidateAccountId(iamconn *iam.IAM, authProviderName string) er
if c.AllowedAccountIds != nil {
for _, id := range c.AllowedAccountIds {
if id == account_id {
if id == accountId {
return nil
}
}
return fmt.Errorf("Account ID not allowed (%s)", account_id)
return fmt.Errorf("Account ID not allowed (%s)", accountId)
}
return nil

View File

@ -2,6 +2,7 @@ package client
import (
"math/rand"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws/request"
@ -29,13 +30,15 @@ func (d DefaultRetryer) MaxRetries() int {
return d.NumMaxRetries
}
var seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
// RetryRules returns the delay duration before retrying this request again
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
// Set the upper limit of delay in retrying at ~five minutes
minTime := 30
throttle := d.shouldThrottle(r)
if throttle {
minTime = 1000
minTime = 500
}
retryCount := r.RetryCount
@ -45,7 +48,7 @@ func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
retryCount = 8
}
delay := (1 << uint(retryCount)) * (rand.Intn(30) + minTime)
delay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime)
return time.Duration(delay) * time.Millisecond
}
@ -66,3 +69,22 @@ func (d DefaultRetryer) shouldThrottle(r *request.Request) bool {
}
return r.IsErrorThrottle()
}
// lockedSource is a thread-safe implementation of rand.Source
type lockedSource struct {
lk sync.Mutex
src rand.Source
}
func (r *lockedSource) Int63() (n int64) {
r.lk.Lock()
n = r.src.Int63()
r.lk.Unlock()
return
}
func (r *lockedSource) Seed(seed int64) {
r.lk.Lock()
r.src.Seed(seed)
r.lk.Unlock()
}

View File

@ -100,6 +100,31 @@ type Config struct {
// Amazon S3: Virtual Hosting of Buckets
S3ForcePathStyle *bool
// Set this to `true` to disable the SDK adding the `Expect: 100-Continue`
// header to PUT requests over 2MB of content. 100-Continue instructs the
// HTTP client not to send the body until the service responds with a
// `continue` status. This is useful to prevent sending the request body
// until after the request is authenticated, and validated.
//
// http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html
//
// 100-Continue is only enabled for Go 1.6 and above. See `http.Transport`'s
// `ExpectContinueTimeout` for information on adjusting the continue wait timeout.
// https://golang.org/pkg/net/http/#Transport
//
// You should use this flag to disble 100-Continue if you experiance issues
// with proxies or thrid party S3 compatible services.
S3Disable100Continue *bool
// Set this to `true` to enable S3 Accelerate feature. For all operations compatible
// with S3 Accelerate will use the accelerate endpoint for requests. Requests not compatible
// will fall back to normal S3 requests.
//
// The bucket must be enable for accelerate to be used with S3 client with accelerate
// enabled. If the bucket is not enabled for accelerate an error will be returned.
// The bucket name must be DNS compatible to also work with accelerate.
S3UseAccelerate *bool
// Set this to `true` to disable the EC2Metadata client from overriding the
// default http.Client's Timeout. This is helpful if you do not want the EC2Metadata
// client to create a new http.Client. This options is only meaningful if you're not
@ -210,6 +235,20 @@ func (c *Config) WithS3ForcePathStyle(force bool) *Config {
return c
}
// WithS3Disable100Continue sets a config S3Disable100Continue value returning
// a Config pointer for chaining.
func (c *Config) WithS3Disable100Continue(disable bool) *Config {
c.S3Disable100Continue = &disable
return c
}
// WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config
// pointer for chaining.
func (c *Config) WithS3UseAccelerate(enable bool) *Config {
c.S3UseAccelerate = &enable
return c
}
// WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value
// returning a Config pointer for chaining.
func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config {
@ -288,6 +327,14 @@ func mergeInConfig(dst *Config, other *Config) {
dst.S3ForcePathStyle = other.S3ForcePathStyle
}
if other.S3Disable100Continue != nil {
dst.S3Disable100Continue = other.S3Disable100Continue
}
if other.S3UseAccelerate != nil {
dst.S3UseAccelerate = other.S3UseAccelerate
}
if other.EC2MetadataDisableTimeoutOverride != nil {
dst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride
}

View File

@ -24,30 +24,38 @@ type lener interface {
// BuildContentLengthHandler builds the content length of a request based on the body,
// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable
// to determine request body length and no "Content-Length" was specified it will panic.
//
// The Content-Length will only be aded to the request if the length of the body
// is greater than 0. If the body is empty or the current `Content-Length`
// header is <= 0, the header will also be stripped.
var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) {
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
length, _ := strconv.ParseInt(slength, 10, 64)
r.HTTPRequest.ContentLength = length
return
}
var length int64
switch body := r.Body.(type) {
case nil:
length = 0
case lener:
length = int64(body.Len())
case io.Seeker:
r.BodyStart, _ = body.Seek(0, 1)
end, _ := body.Seek(0, 2)
body.Seek(r.BodyStart, 0) // make sure to seek back to original location
length = end - r.BodyStart
default:
panic("Cannot get length of body, must provide `ContentLength`")
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
length, _ = strconv.ParseInt(slength, 10, 64)
} else {
switch body := r.Body.(type) {
case nil:
length = 0
case lener:
length = int64(body.Len())
case io.Seeker:
r.BodyStart, _ = body.Seek(0, 1)
end, _ := body.Seek(0, 2)
body.Seek(r.BodyStart, 0) // make sure to seek back to original location
length = end - r.BodyStart
default:
panic("Cannot get length of body, must provide `ContentLength`")
}
}
r.HTTPRequest.ContentLength = length
r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length))
if length > 0 {
r.HTTPRequest.ContentLength = length
r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length))
} else {
r.HTTPRequest.ContentLength = 0
r.HTTPRequest.Header.Del("Content-Length")
}
}}
// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.

View File

@ -1,153 +1,17 @@
package corehandlers
import (
"fmt"
"reflect"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
)
import "github.com/aws/aws-sdk-go/aws/request"
// ValidateParametersHandler is a request handler to validate the input parameters.
// Validating parameters only has meaning if done prior to the request being sent.
var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) {
if r.ParamsFilled() {
v := validator{errors: []string{}}
v.validateAny(reflect.ValueOf(r.Params), "")
if count := len(v.errors); count > 0 {
format := "%d validation errors:\n- %s"
msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- "))
r.Error = awserr.New("InvalidParameter", msg, nil)
}
}
}}
// A validator validates values. Collects validations errors which occurs.
type validator struct {
errors []string
}
// There's no validation to be done on the contents of []byte values. Prepare
// to check validateAny arguments against that type so we can quickly skip
// them.
var byteSliceType = reflect.TypeOf([]byte(nil))
// validateAny will validate any struct, slice or map type. All validations
// are also performed recursively for nested types.
func (v *validator) validateAny(value reflect.Value, path string) {
value = reflect.Indirect(value)
if !value.IsValid() {
if !r.ParamsFilled() {
return
}
switch value.Kind() {
case reflect.Struct:
v.validateStruct(value, path)
case reflect.Slice:
if value.Type() == byteSliceType {
// We don't need to validate the contents of []byte.
return
}
for i := 0; i < value.Len(); i++ {
v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i))
}
case reflect.Map:
for _, n := range value.MapKeys() {
v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String()))
if v, ok := r.Params.(request.Validator); ok {
if err := v.Validate(); err != nil {
r.Error = err
}
}
}
// validateStruct will validate the struct value's fields. If the structure has
// nested types those types will be validated also.
func (v *validator) validateStruct(value reflect.Value, path string) {
prefix := "."
if path == "" {
prefix = ""
}
for i := 0; i < value.Type().NumField(); i++ {
f := value.Type().Field(i)
if strings.ToLower(f.Name[0:1]) == f.Name[0:1] {
continue
}
fvalue := value.FieldByName(f.Name)
err := validateField(f, fvalue, validateFieldRequired, validateFieldMin)
if err != nil {
v.errors = append(v.errors, fmt.Sprintf("%s: %s", err.Error(), path+prefix+f.Name))
continue
}
v.validateAny(fvalue, path+prefix+f.Name)
}
}
type validatorFunc func(f reflect.StructField, fvalue reflect.Value) error
func validateField(f reflect.StructField, fvalue reflect.Value, funcs ...validatorFunc) error {
for _, fn := range funcs {
if err := fn(f, fvalue); err != nil {
return err
}
}
return nil
}
// Validates that a field has a valid value provided for required fields.
func validateFieldRequired(f reflect.StructField, fvalue reflect.Value) error {
if f.Tag.Get("required") == "" {
return nil
}
switch fvalue.Kind() {
case reflect.Ptr, reflect.Slice, reflect.Map:
if fvalue.IsNil() {
return fmt.Errorf("missing required parameter")
}
default:
if !fvalue.IsValid() {
return fmt.Errorf("missing required parameter")
}
}
return nil
}
// Validates that if a value is provided for a field, that value must be at
// least a minimum length.
func validateFieldMin(f reflect.StructField, fvalue reflect.Value) error {
minStr := f.Tag.Get("min")
if minStr == "" {
return nil
}
min, _ := strconv.ParseInt(minStr, 10, 64)
kind := fvalue.Kind()
if kind == reflect.Ptr {
if fvalue.IsNil() {
return nil
}
fvalue = fvalue.Elem()
}
switch fvalue.Kind() {
case reflect.String:
if int64(fvalue.Len()) < min {
return fmt.Errorf("field too short, minimum length %d", min)
}
case reflect.Slice, reflect.Map:
if fvalue.IsNil() {
return nil
}
if int64(fvalue.Len()) < min {
return fmt.Errorf("field too short, minimum length %d", min)
}
// TODO min can also apply to number minimum value.
}
return nil
}
}}

View File

@ -0,0 +1,26 @@
// +build go1.5
package request
import (
"io"
"net/http"
)
func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request {
return &http.Request{
URL: r.URL,
Header: r.Header,
Close: r.Close,
Form: r.Form,
PostForm: r.PostForm,
Body: body,
MultipartForm: r.MultipartForm,
Host: r.Host,
Method: r.Method,
Proto: r.Proto,
ContentLength: r.ContentLength,
// Cancel will be deprecated in 1.7 and will be replaced with Context
Cancel: r.Cancel,
}
}

View File

@ -0,0 +1,24 @@
// +build !go1.5
package request
import (
"io"
"net/http"
)
func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request {
return &http.Request{
URL: r.URL,
Header: r.Header,
Close: r.Close,
Form: r.Form,
PostForm: r.PostForm,
Body: body,
MultipartForm: r.MultipartForm,
Host: r.Host,
Method: r.Method,
Proto: r.Proto,
ContentLength: r.ContentLength,
}
}

View File

@ -221,6 +221,13 @@ func (r *Request) Sign() error {
//
// Send will sign the request prior to sending. All Send Handlers will
// be executed in the order they were set.
//
// Canceling a request is non-deterministic. If a request has been canceled,
// then the transport will choose, randomly, one of the state channels during
// reads or getting the connection.
//
// readLoop() and getConn(req *Request, cm connectMethod)
// https://github.com/golang/go/blob/master/src/net/http/transport.go
func (r *Request) Send() error {
for {
if aws.BoolValue(r.Retryable) {
@ -240,22 +247,12 @@ func (r *Request) Send() error {
body = ioutil.NopCloser(r.Body)
}
r.HTTPRequest = &http.Request{
URL: r.HTTPRequest.URL,
Header: r.HTTPRequest.Header,
Close: r.HTTPRequest.Close,
Form: r.HTTPRequest.Form,
PostForm: r.HTTPRequest.PostForm,
Body: body,
MultipartForm: r.HTTPRequest.MultipartForm,
Host: r.HTTPRequest.Host,
Method: r.HTTPRequest.Method,
Proto: r.HTTPRequest.Proto,
ContentLength: r.HTTPRequest.ContentLength,
r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, body)
if r.HTTPResponse != nil && r.HTTPResponse.Body != nil {
// Closing response body. Since we are setting a new request to send off, this
// response will get squashed and leaked.
r.HTTPResponse.Body.Close()
}
// Closing response body. Since we are setting a new request to send off, this
// response will get squashed and leaked.
r.HTTPResponse.Body.Close()
}
r.Sign()
@ -267,6 +264,10 @@ func (r *Request) Send() error {
r.Handlers.Send.Run(r)
if r.Error != nil {
if strings.Contains(r.Error.Error(), "net/http: request canceled") {
return r.Error
}
err := r.Error
r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r)

View File

@ -0,0 +1,234 @@
package request
import (
"bytes"
"fmt"
"github.com/aws/aws-sdk-go/aws/awserr"
)
const (
// InvalidParameterErrCode is the error code for invalid parameters errors
InvalidParameterErrCode = "InvalidParameter"
// ParamRequiredErrCode is the error code for required parameter errors
ParamRequiredErrCode = "ParamRequiredError"
// ParamMinValueErrCode is the error code for fields with too low of a
// number value.
ParamMinValueErrCode = "ParamMinValueError"
// ParamMinLenErrCode is the error code for fields without enough elements.
ParamMinLenErrCode = "ParamMinLenError"
)
// Validator provides a way for types to perform validation logic on their
// input values that external code can use to determine if a type's values
// are valid.
type Validator interface {
Validate() error
}
// An ErrInvalidParams provides wrapping of invalid parameter errors found when
// validating API operation input parameters.
type ErrInvalidParams struct {
// Context is the base context of the invalid parameter group.
Context string
errs []ErrInvalidParam
}
// Add adds a new invalid parameter error to the collection of invalid
// parameters. The context of the invalid parameter will be updated to reflect
// this collection.
func (e *ErrInvalidParams) Add(err ErrInvalidParam) {
err.SetContext(e.Context)
e.errs = append(e.errs, err)
}
// AddNested adds the invalid parameter errors from another ErrInvalidParams
// value into this collection. The nested errors will have their nested context
// updated and base context to reflect the merging.
//
// Use for nested validations errors.
func (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) {
for _, err := range nested.errs {
err.SetContext(e.Context)
err.AddNestedContext(nestedCtx)
e.errs = append(e.errs, err)
}
}
// Len returns the number of invalid parameter errors
func (e ErrInvalidParams) Len() int {
return len(e.errs)
}
// Code returns the code of the error
func (e ErrInvalidParams) Code() string {
return InvalidParameterErrCode
}
// Message returns the message of the error
func (e ErrInvalidParams) Message() string {
return fmt.Sprintf("%d validation error(s) found.", len(e.errs))
}
// Error returns the string formatted form of the invalid parameters.
func (e ErrInvalidParams) Error() string {
w := &bytes.Buffer{}
fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message())
for _, err := range e.errs {
fmt.Fprintf(w, "- %s\n", err.Message())
}
return w.String()
}
// OrigErr returns the invalid parameters as a awserr.BatchedErrors value
func (e ErrInvalidParams) OrigErr() error {
return awserr.NewBatchError(
InvalidParameterErrCode, e.Message(), e.OrigErrs())
}
// OrigErrs returns a slice of the invalid parameters
func (e ErrInvalidParams) OrigErrs() []error {
errs := make([]error, len(e.errs))
for i := 0; i < len(errs); i++ {
errs[i] = e.errs[i]
}
return errs
}
// An ErrInvalidParam represents an invalid parameter error type.
type ErrInvalidParam interface {
awserr.Error
// Field name the error occurred on.
Field() string
// SetContext updates the context of the error.
SetContext(string)
// AddNestedContext updates the error's context to include a nested level.
AddNestedContext(string)
}
type errInvalidParam struct {
context string
nestedContext string
field string
code string
msg string
}
// Code returns the error code for the type of invalid parameter.
func (e *errInvalidParam) Code() string {
return e.code
}
// Message returns the reason the parameter was invalid, and its context.
func (e *errInvalidParam) Message() string {
return fmt.Sprintf("%s, %s.", e.msg, e.Field())
}
// Error returns the string version of the invalid parameter error.
func (e *errInvalidParam) Error() string {
return fmt.Sprintf("%s: %s", e.code, e.Message())
}
// OrigErr returns nil, Implemented for awserr.Error interface.
func (e *errInvalidParam) OrigErr() error {
return nil
}
// Field Returns the field and context the error occurred.
func (e *errInvalidParam) Field() string {
field := e.context
if len(field) > 0 {
field += "."
}
if len(e.nestedContext) > 0 {
field += fmt.Sprintf("%s.", e.nestedContext)
}
field += e.field
return field
}
// SetContext updates the base context of the error.
func (e *errInvalidParam) SetContext(ctx string) {
e.context = ctx
}
// AddNestedContext prepends a context to the field's path.
func (e *errInvalidParam) AddNestedContext(ctx string) {
if len(e.nestedContext) == 0 {
e.nestedContext = ctx
} else {
e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext)
}
}
// An ErrParamRequired represents an required parameter error.
type ErrParamRequired struct {
errInvalidParam
}
// NewErrParamRequired creates a new required parameter error.
func NewErrParamRequired(field string) *ErrParamRequired {
return &ErrParamRequired{
errInvalidParam{
code: ParamRequiredErrCode,
field: field,
msg: fmt.Sprintf("missing required field"),
},
}
}
// An ErrParamMinValue represents a minimum value parameter error.
type ErrParamMinValue struct {
errInvalidParam
min float64
}
// NewErrParamMinValue creates a new minimum value parameter error.
func NewErrParamMinValue(field string, min float64) *ErrParamMinValue {
return &ErrParamMinValue{
errInvalidParam: errInvalidParam{
code: ParamMinValueErrCode,
field: field,
msg: fmt.Sprintf("minimum field value of %v", min),
},
min: min,
}
}
// MinValue returns the field's require minimum value.
//
// float64 is returned for both int and float min values.
func (e *ErrParamMinValue) MinValue() float64 {
return e.min
}
// An ErrParamMinLen represents a minimum length parameter error.
type ErrParamMinLen struct {
errInvalidParam
min int
}
// NewErrParamMinLen creates a new minimum length parameter error.
func NewErrParamMinLen(field string, min int) *ErrParamMinLen {
return &ErrParamMinLen{
errInvalidParam: errInvalidParam{
code: ParamMinValueErrCode,
field: field,
msg: fmt.Sprintf("minimum field size of %v", min),
},
min: min,
}
}
// MinLen returns the field's required minimum length.
func (e *ErrParamMinLen) MinLen() int {
return e.min
}

View File

@ -86,7 +86,7 @@ func initHandlers(s *Session) {
//
// Example:
// // Create a copy of the current session, configured for the us-west-2 region.
// sess.Copy(&aws.Config{Region: aws.String("us-west-2"})
// sess.Copy(&aws.Config{Region: aws.String("us-west-2")})
func (s *Session) Copy(cfgs ...*aws.Config) *Session {
newSession := &Session{
Config: s.Config.Copy(cfgs...),

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.1.15"
const SDKVersion = "1.1.23"

View File

@ -120,7 +120,8 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
name = locName
}
fmt.Fprintf(buf, "%q:", name)
writeString(name, buf)
buf.WriteString(`:`)
err := buildAny(member, buf, field.Tag)
if err != nil {
@ -167,7 +168,9 @@ func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) err
buf.WriteByte(',')
}
fmt.Fprintf(buf, "%q:", k)
writeString(k.String(), buf)
buf.WriteString(`:`)
buildAny(value.MapIndex(k), buf, "")
}

View File

@ -29,8 +29,8 @@ const (
var ignoredHeaders = rules{
blacklist{
mapRule{
"Content-Length": struct{}{},
"User-Agent": struct{}{},
"Authorization": struct{}{},
"User-Agent": struct{}{},
},
},
}
@ -153,6 +153,7 @@ func Sign(req *request.Request) {
}
req.Error = s.sign()
req.Time = s.Time
req.SignedHeaderVals = s.signedHeaderVals
}
@ -162,11 +163,12 @@ func (v4 *signer) sign() error {
}
if v4.isRequestSigned() {
if !v4.Credentials.IsExpired() {
if !v4.Credentials.IsExpired() && time.Now().Before(v4.Time.Add(10*time.Minute)) {
// If the request is already signed, and the credentials have not
// expired yet ignore the signing request.
// expired, and the request is not too old ignore the signing request.
return nil
}
v4.Time = time.Now()
// The credentials have expired for this request. The current signing
// is invalid, and needs to be request because the request will fail.
@ -303,13 +305,18 @@ func (v4 *signer) buildCanonicalHeaders(r rule, header http.Header) {
if !r.IsValid(canonicalKey) {
continue // ignored header
}
lowerCaseKey := strings.ToLower(k)
headers = append(headers, lowerCaseKey)
if v4.signedHeaderVals == nil {
v4.signedHeaderVals = make(http.Header)
}
lowerCaseKey := strings.ToLower(k)
if _, ok := v4.signedHeaderVals[lowerCaseKey]; ok {
// include additional values
v4.signedHeaderVals[lowerCaseKey] = append(v4.signedHeaderVals[lowerCaseKey], v...)
continue
}
headers = append(headers, lowerCaseKey)
v4.signedHeaderVals[lowerCaseKey] = v
}
sort.Strings(headers)
@ -326,11 +333,11 @@ func (v4 *signer) buildCanonicalHeaders(r rule, header http.Header) {
headerValues[i] = "host:" + v4.Request.URL.Host
} else {
headerValues[i] = k + ":" +
strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",")
strings.Join(v4.signedHeaderVals[k], ",")
}
}
v4.canonicalHeaders = strings.Join(headerValues, "\n")
v4.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n")
}
func (v4 *signer) buildCanonicalString() {
@ -436,3 +443,23 @@ func makeSha256Reader(reader io.ReadSeeker) []byte {
io.Copy(hash, reader)
return hash.Sum(nil)
}
func stripExcessSpaces(headerVals []string) []string {
vals := make([]string, len(headerVals))
for i, str := range headerVals {
stripped := ""
found := false
str = strings.TrimSpace(str)
for _, c := range str {
if !found && c == ' ' {
stripped += string(c)
found = true
} else if c != ' ' {
stripped += string(c)
found = false
}
}
vals[i] = stripped
}
return vals
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -879,6 +879,19 @@ func (s CancelUpdateStackInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CancelUpdateStackInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CancelUpdateStackInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CancelUpdateStackOutput struct {
_ struct{} `type:"structure"`
}
@ -978,6 +991,22 @@ func (s ContinueUpdateRollbackInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ContinueUpdateRollbackInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ContinueUpdateRollbackInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a ContinueUpdateRollback action.
type ContinueUpdateRollbackOutput struct {
_ struct{} `type:"structure"`
@ -1098,6 +1127,40 @@ func (s CreateChangeSetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateChangeSetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateChangeSetInput"}
if s.ChangeSetName == nil {
invalidParams.Add(request.NewErrParamRequired("ChangeSetName"))
}
if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1))
}
if s.ClientToken != nil && len(*s.ClientToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1))
}
if s.Description != nil && len(*s.Description) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Description", 1))
}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the CreateChangeSet action.
type CreateChangeSetOutput struct {
_ struct{} `type:"structure"`
@ -1238,6 +1301,34 @@ func (s CreateStackInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateStackInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateStackInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1))
}
if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1))
}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if s.TimeoutInMinutes != nil && *s.TimeoutInMinutes < 1 {
invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a CreateStack action.
type CreateStackOutput struct {
_ struct{} `type:"structure"`
@ -1279,6 +1370,25 @@ func (s DeleteChangeSetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteChangeSetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteChangeSetInput"}
if s.ChangeSetName == nil {
invalidParams.Add(request.NewErrParamRequired("ChangeSetName"))
}
if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DeleteChangeSet action.
type DeleteChangeSetOutput struct {
_ struct{} `type:"structure"`
@ -1320,6 +1430,19 @@ func (s DeleteStackInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteStackInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteStackInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteStackOutput struct {
_ struct{} `type:"structure"`
}
@ -1352,6 +1475,19 @@ func (s DescribeAccountLimitsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeAccountLimitsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeAccountLimitsInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DescribeAccountLimits action.
type DescribeAccountLimitsOutput struct {
_ struct{} `type:"structure"`
@ -1402,6 +1538,28 @@ func (s DescribeChangeSetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeChangeSetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeChangeSetInput"}
if s.ChangeSetName == nil {
invalidParams.Add(request.NewErrParamRequired("ChangeSetName"))
}
if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DescribeChangeSet action.
type DescribeChangeSetOutput struct {
_ struct{} `type:"structure"`
@ -1495,6 +1653,19 @@ func (s DescribeStackEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeStackEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeStackEventsInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a DescribeStackEvents action.
type DescribeStackEventsOutput struct {
_ struct{} `type:"structure"`
@ -1545,6 +1716,22 @@ func (s DescribeStackResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeStackResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeStackResourceInput"}
if s.LogicalResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("LogicalResourceId"))
}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a DescribeStackResource action.
type DescribeStackResourceOutput struct {
_ struct{} `type:"structure"`
@ -1653,6 +1840,19 @@ func (s DescribeStacksInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeStacksInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeStacksInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a DescribeStacks action.
type DescribeStacksOutput struct {
_ struct{} `type:"structure"`
@ -1710,6 +1910,22 @@ func (s EstimateTemplateCostInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EstimateTemplateCostInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EstimateTemplateCostInput"}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a EstimateTemplateCost action.
type EstimateTemplateCostOutput struct {
_ struct{} `type:"structure"`
@ -1752,6 +1968,25 @@ func (s ExecuteChangeSetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ExecuteChangeSetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ExecuteChangeSetInput"}
if s.ChangeSetName == nil {
invalidParams.Add(request.NewErrParamRequired("ChangeSetName"))
}
if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the ExecuteChangeSet action.
type ExecuteChangeSetOutput struct {
_ struct{} `type:"structure"`
@ -1786,6 +2021,19 @@ func (s GetStackPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetStackPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetStackPolicyInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the GetStackPolicy action.
type GetStackPolicyOutput struct {
_ struct{} `type:"structure"`
@ -1829,6 +2077,19 @@ func (s GetTemplateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetTemplateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for GetTemplate action.
type GetTemplateOutput struct {
_ struct{} `type:"structure"`
@ -1891,6 +2152,25 @@ func (s GetTemplateSummaryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetTemplateSummaryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetTemplateSummaryInput"}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the GetTemplateSummary action.
type GetTemplateSummaryOutput struct {
_ struct{} `type:"structure"`
@ -1958,6 +2238,25 @@ func (s ListChangeSetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListChangeSetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListChangeSetsInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the ListChangeSets action.
type ListChangeSetsOutput struct {
_ struct{} `type:"structure"`
@ -2008,6 +2307,22 @@ func (s ListStackResourcesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListStackResourcesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListStackResourcesInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a ListStackResources action.
type ListStackResourcesOutput struct {
_ struct{} `type:"structure"`
@ -2053,6 +2368,19 @@ func (s ListStacksInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListStacksInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListStacksInput"}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for ListStacks action.
type ListStacksOutput struct {
_ struct{} `type:"structure"`
@ -2358,6 +2686,25 @@ func (s SetStackPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetStackPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetStackPolicyInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1))
}
if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetStackPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -2405,6 +2752,34 @@ func (s SignalResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SignalResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SignalResourceInput"}
if s.LogicalResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("LogicalResourceId"))
}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackName != nil && len(*s.StackName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackName", 1))
}
if s.Status == nil {
invalidParams.Add(request.NewErrParamRequired("Status"))
}
if s.UniqueId == nil {
invalidParams.Add(request.NewErrParamRequired("UniqueId"))
}
if s.UniqueId != nil && len(*s.UniqueId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("UniqueId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SignalResourceOutput struct {
_ struct{} `type:"structure"`
}
@ -2878,6 +3253,37 @@ func (s UpdateStackInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateStackInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateStackInput"}
if s.StackName == nil {
invalidParams.Add(request.NewErrParamRequired("StackName"))
}
if s.StackPolicyBody != nil && len(*s.StackPolicyBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyBody", 1))
}
if s.StackPolicyDuringUpdateBody != nil && len(*s.StackPolicyDuringUpdateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyDuringUpdateBody", 1))
}
if s.StackPolicyDuringUpdateURL != nil && len(*s.StackPolicyDuringUpdateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyDuringUpdateURL", 1))
}
if s.StackPolicyURL != nil && len(*s.StackPolicyURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StackPolicyURL", 1))
}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for a UpdateStack action.
type UpdateStackOutput struct {
_ struct{} `type:"structure"`
@ -2929,6 +3335,22 @@ func (s ValidateTemplateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ValidateTemplateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ValidateTemplateInput"}
if s.TemplateBody != nil && len(*s.TemplateBody) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1))
}
if s.TemplateURL != nil && len(*s.TemplateURL) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for ValidateTemplate action.
type ValidateTemplateOutput struct {
_ struct{} `type:"structure"`

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
package cloudtrail
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -408,6 +409,29 @@ func (s AddTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"}
if s.ResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceId"))
}
if s.TagsList != nil {
for i, v := range s.TagsList {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type AddTagsOutput struct {
@ -503,6 +527,22 @@ func (s CreateTrailInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateTrailInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.S3BucketName == nil {
invalidParams.Add(request.NewErrParamRequired("S3BucketName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type CreateTrailOutput struct {
@ -581,6 +621,19 @@ func (s DeleteTrailInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteTrailInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type DeleteTrailOutput struct {
@ -706,6 +759,19 @@ func (s GetTrailStatusInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetTrailStatusInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type GetTrailStatusOutput struct {
@ -871,6 +937,19 @@ func (s ListTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"}
if s.ResourceIdList == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceIdList"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type ListTagsOutput struct {
@ -914,6 +993,22 @@ func (s LookupAttribute) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LookupAttribute) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"}
if s.AttributeKey == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeKey"))
}
if s.AttributeValue == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains a request for LookupEvents.
type LookupEventsInput struct {
_ struct{} `type:"structure"`
@ -954,6 +1049,29 @@ func (s LookupEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LookupEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
}
if s.LookupAttributes != nil {
for i, v := range s.LookupAttributes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains a response to a LookupEvents action.
type LookupEventsOutput struct {
_ struct{} `type:"structure"`
@ -1032,6 +1150,29 @@ func (s RemoveTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"}
if s.ResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceId"))
}
if s.TagsList != nil {
for i, v := range s.TagsList {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type RemoveTagsOutput struct {
@ -1116,6 +1257,19 @@ func (s StartLoggingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StartLoggingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type StartLoggingOutput struct {
@ -1152,6 +1306,19 @@ func (s StopLoggingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StopLoggingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type StopLoggingOutput struct {
@ -1191,6 +1358,19 @@ func (s Tag) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Tag) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Tag"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The settings for a trail.
type Trail struct {
_ struct{} `type:"structure"`
@ -1338,6 +1518,19 @@ func (s UpdateTrailInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateTrailInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the objects or data listed below if successful. Otherwise, returns
// an error.
type UpdateTrailOutput struct {

View File

@ -4,6 +4,7 @@
package cloudwatch
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -546,6 +547,19 @@ func (s DeleteAlarmsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteAlarmsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmsInput"}
if s.AlarmNames == nil {
invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteAlarmsOutput struct {
_ struct{} `type:"structure"`
}
@ -593,6 +607,22 @@ func (s DescribeAlarmHistoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeAlarmHistoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmHistoryInput"}
if s.AlarmName != nil && len(*s.AlarmName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
}
if s.MaxRecords != nil && *s.MaxRecords < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DescribeAlarmHistory action.
type DescribeAlarmHistoryOutput struct {
_ struct{} `type:"structure"`
@ -648,6 +678,41 @@ func (s DescribeAlarmsForMetricInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeAlarmsForMetricInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsForMetricInput"}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
}
if s.Period != nil && *s.Period < 60 {
invalidParams.Add(request.NewErrParamMinValue("Period", 60))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DescribeAlarmsForMetric action.
type DescribeAlarmsForMetricOutput struct {
_ struct{} `type:"structure"`
@ -700,6 +765,25 @@ func (s DescribeAlarmsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeAlarmsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeAlarmsInput"}
if s.ActionPrefix != nil && len(*s.ActionPrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ActionPrefix", 1))
}
if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1))
}
if s.MaxRecords != nil && *s.MaxRecords < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the DescribeAlarms action.
type DescribeAlarmsOutput struct {
_ struct{} `type:"structure"`
@ -745,6 +829,28 @@ func (s Dimension) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Dimension) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Dimension"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if s.Value == nil {
invalidParams.Add(request.NewErrParamRequired("Value"))
}
if s.Value != nil && len(*s.Value) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Value", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The DimensionFilter data type is used to filter ListMetrics results.
type DimensionFilter struct {
_ struct{} `type:"structure"`
@ -769,6 +875,25 @@ func (s DimensionFilter) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DimensionFilter) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DimensionFilter"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if s.Value != nil && len(*s.Value) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Value", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableAlarmActionsInput struct {
_ struct{} `type:"structure"`
@ -786,6 +911,19 @@ func (s DisableAlarmActionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableAlarmActionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableAlarmActionsInput"}
if s.AlarmNames == nil {
invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableAlarmActionsOutput struct {
_ struct{} `type:"structure"`
}
@ -817,6 +955,19 @@ func (s EnableAlarmActionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableAlarmActionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableAlarmActionsInput"}
if s.AlarmNames == nil {
invalidParams.Add(request.NewErrParamRequired("AlarmNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableAlarmActionsOutput struct {
_ struct{} `type:"structure"`
}
@ -883,6 +1034,56 @@ func (s GetMetricStatisticsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetMetricStatisticsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetMetricStatisticsInput"}
if s.EndTime == nil {
invalidParams.Add(request.NewErrParamRequired("EndTime"))
}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
}
if s.Period == nil {
invalidParams.Add(request.NewErrParamRequired("Period"))
}
if s.Period != nil && *s.Period < 60 {
invalidParams.Add(request.NewErrParamMinValue("Period", 60))
}
if s.StartTime == nil {
invalidParams.Add(request.NewErrParamRequired("StartTime"))
}
if s.Statistics == nil {
invalidParams.Add(request.NewErrParamRequired("Statistics"))
}
if s.Statistics != nil && len(s.Statistics) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Statistics", 1))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the GetMetricStatistics action.
type GetMetricStatisticsOutput struct {
_ struct{} `type:"structure"`
@ -931,6 +1132,32 @@ func (s ListMetricsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListMetricsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListMetricsInput"}
if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
}
if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The output for the ListMetrics action.
type ListMetricsOutput struct {
_ struct{} `type:"structure"`
@ -1115,6 +1342,37 @@ func (s MetricDatum) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MetricDatum) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "MetricDatum"}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if s.StatisticValues != nil {
if err := s.StatisticValues.Validate(); err != nil {
invalidParams.AddNested("StatisticValues", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutMetricAlarmInput struct {
_ struct{} `type:"structure"`
@ -1228,6 +1486,65 @@ func (s PutMetricAlarmInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutMetricAlarmInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutMetricAlarmInput"}
if s.AlarmName == nil {
invalidParams.Add(request.NewErrParamRequired("AlarmName"))
}
if s.AlarmName != nil && len(*s.AlarmName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
}
if s.ComparisonOperator == nil {
invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
}
if s.EvaluationPeriods == nil {
invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods"))
}
if s.EvaluationPeriods != nil && *s.EvaluationPeriods < 1 {
invalidParams.Add(request.NewErrParamMinValue("EvaluationPeriods", 1))
}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricName != nil && len(*s.MetricName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricName", 1))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
}
if s.Period == nil {
invalidParams.Add(request.NewErrParamRequired("Period"))
}
if s.Period != nil && *s.Period < 60 {
invalidParams.Add(request.NewErrParamMinValue("Period", 60))
}
if s.Statistic == nil {
invalidParams.Add(request.NewErrParamRequired("Statistic"))
}
if s.Threshold == nil {
invalidParams.Add(request.NewErrParamRequired("Threshold"))
}
if s.Dimensions != nil {
for i, v := range s.Dimensions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Dimensions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutMetricAlarmOutput struct {
_ struct{} `type:"structure"`
}
@ -1266,6 +1583,35 @@ func (s PutMetricDataInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutMetricDataInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutMetricDataInput"}
if s.MetricData == nil {
invalidParams.Add(request.NewErrParamRequired("MetricData"))
}
if s.Namespace == nil {
invalidParams.Add(request.NewErrParamRequired("Namespace"))
}
if s.Namespace != nil && len(*s.Namespace) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Namespace", 1))
}
if s.MetricData != nil {
for i, v := range s.MetricData {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutMetricDataOutput struct {
_ struct{} `type:"structure"`
}
@ -1309,6 +1655,28 @@ func (s SetAlarmStateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetAlarmStateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetAlarmStateInput"}
if s.AlarmName == nil {
invalidParams.Add(request.NewErrParamRequired("AlarmName"))
}
if s.AlarmName != nil && len(*s.AlarmName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AlarmName", 1))
}
if s.StateReason == nil {
invalidParams.Add(request.NewErrParamRequired("StateReason"))
}
if s.StateValue == nil {
invalidParams.Add(request.NewErrParamRequired("StateValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetAlarmStateOutput struct {
_ struct{} `type:"structure"`
}
@ -1351,6 +1719,28 @@ func (s StatisticSet) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StatisticSet) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StatisticSet"}
if s.Maximum == nil {
invalidParams.Add(request.NewErrParamRequired("Maximum"))
}
if s.Minimum == nil {
invalidParams.Add(request.NewErrParamRequired("Minimum"))
}
if s.SampleCount == nil {
invalidParams.Add(request.NewErrParamRequired("SampleCount"))
}
if s.Sum == nil {
invalidParams.Add(request.NewErrParamRequired("Sum"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
const (
// @enum ComparisonOperator
ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold"

View File

@ -4,6 +4,7 @@
package cloudwatchevents
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -435,6 +436,22 @@ func (s DeleteRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteRuleOutput struct {
_ struct{} `type:"structure"`
}
@ -467,6 +484,22 @@ func (s DescribeRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the DescribeRule operation.
type DescribeRuleOutput struct {
_ struct{} `type:"structure"`
@ -521,6 +554,22 @@ func (s DisableRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableRuleOutput struct {
_ struct{} `type:"structure"`
}
@ -553,6 +602,22 @@ func (s EnableRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableRuleOutput struct {
_ struct{} `type:"structure"`
}
@ -593,6 +658,28 @@ func (s ListRuleNamesByTargetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListRuleNamesByTargetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListRuleNamesByTargetInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.TargetArn == nil {
invalidParams.Add(request.NewErrParamRequired("TargetArn"))
}
if s.TargetArn != nil && len(*s.TargetArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the ListRuleNamesByTarget operation.
type ListRuleNamesByTargetOutput struct {
_ struct{} `type:"structure"`
@ -639,6 +726,25 @@ func (s ListRulesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListRulesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NamePrefix != nil && len(*s.NamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the ListRules operation.
type ListRulesOutput struct {
_ struct{} `type:"structure"`
@ -685,6 +791,28 @@ func (s ListTargetsByRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTargetsByRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTargetsByRuleInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the ListTargetsByRule operation.
type ListTargetsByRuleOutput struct {
_ struct{} `type:"structure"`
@ -726,6 +854,22 @@ func (s PutEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"}
if s.Entries == nil {
invalidParams.Add(request.NewErrParamRequired("Entries"))
}
if s.Entries != nil && len(s.Entries) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Entries", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the PutEvents operation.
type PutEventsOutput struct {
_ struct{} `type:"structure"`
@ -841,6 +985,25 @@ func (s PutRuleInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutRuleInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutRuleInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if s.RoleArn != nil && len(*s.RoleArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the PutRule operation.
type PutRuleOutput struct {
_ struct{} `type:"structure"`
@ -880,6 +1043,35 @@ func (s PutTargetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutTargetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutTargetsInput"}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if s.Targets == nil {
invalidParams.Add(request.NewErrParamRequired("Targets"))
}
if s.Targets != nil {
for i, v := range s.Targets {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the PutTargets operation.
type PutTargetsOutput struct {
_ struct{} `type:"structure"`
@ -946,6 +1138,28 @@ func (s RemoveTargetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTargetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTargetsInput"}
if s.Ids == nil {
invalidParams.Add(request.NewErrParamRequired("Ids"))
}
if s.Ids != nil && len(s.Ids) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Ids", 1))
}
if s.Rule == nil {
invalidParams.Add(request.NewErrParamRequired("Rule"))
}
if s.Rule != nil && len(*s.Rule) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Rule", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the RemoveTargets operation.
type RemoveTargetsOutput struct {
_ struct{} `type:"structure"`
@ -1071,6 +1285,28 @@ func (s Target) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Target) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Target"}
if s.Arn == nil {
invalidParams.Add(request.NewErrParamRequired("Arn"))
}
if s.Arn != nil && len(*s.Arn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Arn", 1))
}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.Id != nil && len(*s.Id) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Id", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Container for the parameters to the TestEventPattern operation.
type TestEventPatternInput struct {
_ struct{} `type:"structure"`
@ -1092,6 +1328,22 @@ func (s TestEventPatternInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TestEventPatternInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TestEventPatternInput"}
if s.Event == nil {
invalidParams.Add(request.NewErrParamRequired("Event"))
}
if s.EventPattern == nil {
invalidParams.Add(request.NewErrParamRequired("EventPattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of the TestEventPattern operation.
type TestEventPatternOutput struct {
_ struct{} `type:"structure"`

View File

@ -4,6 +4,8 @@
package cloudwatchlogs
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
@ -968,6 +970,22 @@ func (s CancelExportTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CancelExportTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CancelExportTaskInput"}
if s.TaskId == nil {
invalidParams.Add(request.NewErrParamRequired("TaskId"))
}
if s.TaskId != nil && len(*s.TaskId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TaskId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CancelExportTaskOutput struct {
_ struct{} `type:"structure"`
}
@ -1025,6 +1043,40 @@ func (s CreateExportTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateExportTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateExportTaskInput"}
if s.Destination == nil {
invalidParams.Add(request.NewErrParamRequired("Destination"))
}
if s.Destination != nil && len(*s.Destination) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Destination", 1))
}
if s.From == nil {
invalidParams.Add(request.NewErrParamRequired("From"))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1))
}
if s.TaskName != nil && len(*s.TaskName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TaskName", 1))
}
if s.To == nil {
invalidParams.Add(request.NewErrParamRequired("To"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateExportTaskOutput struct {
_ struct{} `type:"structure"`
@ -1059,6 +1111,22 @@ func (s CreateLogGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLogGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLogGroupInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLogGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -1093,6 +1161,28 @@ func (s CreateLogStreamInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLogStreamInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLogStreamInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamName == nil {
invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
}
if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLogStreamOutput struct {
_ struct{} `type:"structure"`
}
@ -1124,6 +1214,22 @@ func (s DeleteDestinationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteDestinationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteDestinationInput"}
if s.DestinationName == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationName"))
}
if s.DestinationName != nil && len(*s.DestinationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteDestinationOutput struct {
_ struct{} `type:"structure"`
}
@ -1155,6 +1261,22 @@ func (s DeleteLogGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteLogGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteLogGroupInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLogGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -1189,6 +1311,28 @@ func (s DeleteLogStreamInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteLogStreamInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteLogStreamInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamName == nil {
invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
}
if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLogStreamOutput struct {
_ struct{} `type:"structure"`
}
@ -1223,6 +1367,28 @@ func (s DeleteMetricFilterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteMetricFilterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteMetricFilterInput"}
if s.FilterName == nil {
invalidParams.Add(request.NewErrParamRequired("FilterName"))
}
if s.FilterName != nil && len(*s.FilterName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteMetricFilterOutput struct {
_ struct{} `type:"structure"`
}
@ -1255,6 +1421,22 @@ func (s DeleteRetentionPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRetentionPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRetentionPolicyInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteRetentionPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -1290,6 +1472,28 @@ func (s DeleteSubscriptionFilterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteSubscriptionFilterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionFilterInput"}
if s.FilterName == nil {
invalidParams.Add(request.NewErrParamRequired("FilterName"))
}
if s.FilterName != nil && len(*s.FilterName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteSubscriptionFilterOutput struct {
_ struct{} `type:"structure"`
}
@ -1330,6 +1534,25 @@ func (s DescribeDestinationsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeDestinationsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeDestinationsInput"}
if s.DestinationNamePrefix != nil && len(*s.DestinationNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationNamePrefix", 1))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeDestinationsOutput struct {
_ struct{} `type:"structure"`
@ -1382,6 +1605,25 @@ func (s DescribeExportTasksInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeExportTasksInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeExportTasksInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if s.TaskId != nil && len(*s.TaskId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TaskId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeExportTasksOutput struct {
_ struct{} `type:"structure"`
@ -1431,6 +1673,25 @@ func (s DescribeLogGroupsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeLogGroupsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeLogGroupsInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupNamePrefix != nil && len(*s.LogGroupNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupNamePrefix", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeLogGroupsOutput struct {
_ struct{} `type:"structure"`
@ -1493,6 +1754,31 @@ func (s DescribeLogStreamsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeLogStreamsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeLogStreamsInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamNamePrefix != nil && len(*s.LogStreamNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamNamePrefix", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeLogStreamsOutput struct {
_ struct{} `type:"structure"`
@ -1545,6 +1831,31 @@ func (s DescribeMetricFiltersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeMetricFiltersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeMetricFiltersInput"}
if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeMetricFiltersOutput struct {
_ struct{} `type:"structure"`
@ -1595,6 +1906,31 @@ func (s DescribeSubscriptionFiltersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeSubscriptionFiltersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeSubscriptionFiltersInput"}
if s.FilterNamePrefix != nil && len(*s.FilterNamePrefix) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterNamePrefix", 1))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeSubscriptionFiltersOutput struct {
_ struct{} `type:"structure"`
@ -1788,6 +2124,31 @@ func (s FilterLogEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *FilterLogEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "FilterLogEventsInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamNames != nil && len(s.LogStreamNames) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamNames", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type FilterLogEventsOutput struct {
_ struct{} `type:"structure"`
@ -1890,6 +2251,34 @@ func (s GetLogEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetLogEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetLogEventsInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamName == nil {
invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
}
if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
}
if s.NextToken != nil && len(*s.NextToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetLogEventsOutput struct {
_ struct{} `type:"structure"`
@ -1940,6 +2329,25 @@ func (s InputLogEvent) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InputLogEvent) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InputLogEvent"}
if s.Message == nil {
invalidParams.Add(request.NewErrParamRequired("Message"))
}
if s.Message != nil && len(*s.Message) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Message", 1))
}
if s.Timestamp == nil {
invalidParams.Add(request.NewErrParamRequired("Timestamp"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type LogGroup struct {
_ struct{} `type:"structure"`
@ -2093,6 +2501,25 @@ func (s MetricTransformation) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MetricTransformation) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "MetricTransformation"}
if s.MetricName == nil {
invalidParams.Add(request.NewErrParamRequired("MetricName"))
}
if s.MetricNamespace == nil {
invalidParams.Add(request.NewErrParamRequired("MetricNamespace"))
}
if s.MetricValue == nil {
invalidParams.Add(request.NewErrParamRequired("MetricValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type OutputLogEvent struct {
_ struct{} `type:"structure"`
@ -2141,6 +2568,34 @@ func (s PutDestinationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutDestinationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutDestinationInput"}
if s.DestinationName == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationName"))
}
if s.DestinationName != nil && len(*s.DestinationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
}
if s.RoleArn == nil {
invalidParams.Add(request.NewErrParamRequired("RoleArn"))
}
if s.RoleArn != nil && len(*s.RoleArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
}
if s.TargetArn == nil {
invalidParams.Add(request.NewErrParamRequired("TargetArn"))
}
if s.TargetArn != nil && len(*s.TargetArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutDestinationOutput struct {
_ struct{} `type:"structure"`
@ -2179,6 +2634,28 @@ func (s PutDestinationPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutDestinationPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutDestinationPolicyInput"}
if s.AccessPolicy == nil {
invalidParams.Add(request.NewErrParamRequired("AccessPolicy"))
}
if s.AccessPolicy != nil && len(*s.AccessPolicy) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AccessPolicy", 1))
}
if s.DestinationName == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationName"))
}
if s.DestinationName != nil && len(*s.DestinationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutDestinationPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -2220,6 +2697,47 @@ func (s PutLogEventsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutLogEventsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutLogEventsInput"}
if s.LogEvents == nil {
invalidParams.Add(request.NewErrParamRequired("LogEvents"))
}
if s.LogEvents != nil && len(s.LogEvents) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogEvents", 1))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.LogStreamName == nil {
invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
}
if s.LogStreamName != nil && len(*s.LogStreamName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1))
}
if s.SequenceToken != nil && len(*s.SequenceToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("SequenceToken", 1))
}
if s.LogEvents != nil {
for i, v := range s.LogEvents {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogEvents", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutLogEventsOutput struct {
_ struct{} `type:"structure"`
@ -2268,6 +2786,47 @@ func (s PutMetricFilterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutMetricFilterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutMetricFilterInput"}
if s.FilterName == nil {
invalidParams.Add(request.NewErrParamRequired("FilterName"))
}
if s.FilterName != nil && len(*s.FilterName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
}
if s.FilterPattern == nil {
invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.MetricTransformations == nil {
invalidParams.Add(request.NewErrParamRequired("MetricTransformations"))
}
if s.MetricTransformations != nil && len(s.MetricTransformations) < 1 {
invalidParams.Add(request.NewErrParamMinLen("MetricTransformations", 1))
}
if s.MetricTransformations != nil {
for i, v := range s.MetricTransformations {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricTransformations", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutMetricFilterOutput struct {
_ struct{} `type:"structure"`
}
@ -2304,6 +2863,25 @@ func (s PutRetentionPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutRetentionPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutRetentionPolicyInput"}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.RetentionInDays == nil {
invalidParams.Add(request.NewErrParamRequired("RetentionInDays"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutRetentionPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -2358,6 +2936,40 @@ func (s PutSubscriptionFilterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutSubscriptionFilterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutSubscriptionFilterInput"}
if s.DestinationArn == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationArn"))
}
if s.DestinationArn != nil && len(*s.DestinationArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationArn", 1))
}
if s.FilterName == nil {
invalidParams.Add(request.NewErrParamRequired("FilterName"))
}
if s.FilterName != nil && len(*s.FilterName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FilterName", 1))
}
if s.FilterPattern == nil {
invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
}
if s.LogGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
}
if s.LogGroupName != nil && len(*s.LogGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1))
}
if s.RoleArn != nil && len(*s.RoleArn) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutSubscriptionFilterOutput struct {
_ struct{} `type:"structure"`
}
@ -2471,6 +3083,25 @@ func (s TestMetricFilterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TestMetricFilterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TestMetricFilterInput"}
if s.FilterPattern == nil {
invalidParams.Add(request.NewErrParamRequired("FilterPattern"))
}
if s.LogEventMessages == nil {
invalidParams.Add(request.NewErrParamRequired("LogEventMessages"))
}
if s.LogEventMessages != nil && len(s.LogEventMessages) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LogEventMessages", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type TestMetricFilterOutput struct {
_ struct{} `type:"structure"`

View File

@ -512,6 +512,19 @@ func (s BatchGetRepositoriesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetRepositoriesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetRepositoriesInput"}
if s.RepositoryNames == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a batch get repositories operation.
type BatchGetRepositoriesOutput struct {
_ struct{} `type:"structure"`
@ -614,6 +627,31 @@ func (s CreateBranchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateBranchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateBranchInput"}
if s.BranchName == nil {
invalidParams.Add(request.NewErrParamRequired("BranchName"))
}
if s.BranchName != nil && len(*s.BranchName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("BranchName", 1))
}
if s.CommitId == nil {
invalidParams.Add(request.NewErrParamRequired("CommitId"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateBranchOutput struct {
_ struct{} `type:"structure"`
}
@ -661,6 +699,22 @@ func (s CreateRepositoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateRepositoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateRepositoryInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a create repository operation.
type CreateRepositoryOutput struct {
_ struct{} `type:"structure"`
@ -697,6 +751,22 @@ func (s DeleteRepositoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRepositoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a delete repository operation.
type DeleteRepositoryOutput struct {
_ struct{} `type:"structure"`
@ -737,6 +807,22 @@ func (s GetBranchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetBranchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetBranchInput"}
if s.BranchName != nil && len(*s.BranchName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("BranchName", 1))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get branch operation.
type GetBranchOutput struct {
_ struct{} `type:"structure"`
@ -776,6 +862,25 @@ func (s GetCommitInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetCommitInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetCommitInput"}
if s.CommitId == nil {
invalidParams.Add(request.NewErrParamRequired("CommitId"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get commit operation.
type GetCommitOutput struct {
_ struct{} `type:"structure"`
@ -812,6 +917,22 @@ func (s GetRepositoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetRepositoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetRepositoryInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get repository operation.
type GetRepositoryOutput struct {
_ struct{} `type:"structure"`
@ -848,6 +969,19 @@ func (s GetRepositoryTriggersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetRepositoryTriggersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetRepositoryTriggersInput"}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get repository triggers operation.
type GetRepositoryTriggersOutput struct {
_ struct{} `type:"structure"`
@ -890,6 +1024,22 @@ func (s ListBranchesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListBranchesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListBranchesInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a list branches operation.
type ListBranchesOutput struct {
_ struct{} `type:"structure"`
@ -983,6 +1133,19 @@ func (s PutRepositoryTriggersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutRepositoryTriggersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutRepositoryTriggersInput"}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a put repository triggers operation.
type PutRepositoryTriggersOutput struct {
_ struct{} `type:"structure"`
@ -1145,6 +1308,19 @@ func (s TestRepositoryTriggersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TestRepositoryTriggersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TestRepositoryTriggersInput"}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a test repository triggers operation.
type TestRepositoryTriggersOutput struct {
_ struct{} `type:"structure"`
@ -1189,6 +1365,28 @@ func (s UpdateDefaultBranchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateDefaultBranchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateDefaultBranchInput"}
if s.DefaultBranchName == nil {
invalidParams.Add(request.NewErrParamRequired("DefaultBranchName"))
}
if s.DefaultBranchName != nil && len(*s.DefaultBranchName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DefaultBranchName", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateDefaultBranchOutput struct {
_ struct{} `type:"structure"`
}
@ -1225,6 +1423,22 @@ func (s UpdateRepositoryDescriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateRepositoryDescriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateRepositoryDescriptionInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateRepositoryDescriptionOutput struct {
_ struct{} `type:"structure"`
}
@ -1260,6 +1474,28 @@ func (s UpdateRepositoryNameInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateRepositoryNameInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateRepositoryNameInput"}
if s.NewName == nil {
invalidParams.Add(request.NewErrParamRequired("NewName"))
}
if s.NewName != nil && len(*s.NewName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NewName", 1))
}
if s.OldName == nil {
invalidParams.Add(request.NewErrParamRequired("OldName"))
}
if s.OldName != nil && len(*s.OldName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("OldName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateRepositoryNameOutput struct {
_ struct{} `type:"structure"`
}

View File

@ -1092,6 +1092,22 @@ func (s AddTagsToOnPremisesInstancesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsToOnPremisesInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsToOnPremisesInstancesInput"}
if s.InstanceNames == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceNames"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsToOnPremisesInstancesOutput struct {
_ struct{} `type:"structure"`
}
@ -1176,6 +1192,25 @@ func (s BatchGetApplicationRevisionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetApplicationRevisionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetApplicationRevisionsInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.Revisions == nil {
invalidParams.Add(request.NewErrParamRequired("Revisions"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a batch get application revisions operation.
type BatchGetApplicationRevisionsOutput struct {
_ struct{} `type:"structure"`
@ -1258,6 +1293,25 @@ func (s BatchGetDeploymentGroupsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetDeploymentGroupsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetDeploymentGroupsInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentGroupNames == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentGroupNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a batch get deployment groups operation.
type BatchGetDeploymentGroupsOutput struct {
_ struct{} `type:"structure"`
@ -1300,6 +1354,22 @@ func (s BatchGetDeploymentInstancesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetDeploymentInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetDeploymentInstancesInput"}
if s.DeploymentId == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentId"))
}
if s.InstanceIds == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a batch get deployment instance operation.
type BatchGetDeploymentInstancesOutput struct {
_ struct{} `type:"structure"`
@ -1412,6 +1482,22 @@ func (s CreateApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateApplicationInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a create application operation.
type CreateApplicationOutput struct {
_ struct{} `type:"structure"`
@ -1466,6 +1552,22 @@ func (s CreateDeploymentConfigInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateDeploymentConfigInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentConfigInput"}
if s.DeploymentConfigName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName"))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a create deployment configuration operation.
type CreateDeploymentConfigOutput struct {
_ struct{} `type:"structure"`
@ -1576,6 +1678,34 @@ func (s CreateDeploymentGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateDeploymentGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentGroupInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if s.DeploymentGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName"))
}
if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1))
}
if s.ServiceRoleArn == nil {
invalidParams.Add(request.NewErrParamRequired("ServiceRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a create deployment group operation.
type CreateDeploymentGroupOutput struct {
_ struct{} `type:"structure"`
@ -1641,6 +1771,28 @@ func (s CreateDeploymentInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateDeploymentInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a create deployment operation.
type CreateDeploymentOutput struct {
_ struct{} `type:"structure"`
@ -1678,6 +1830,22 @@ func (s DeleteApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteApplicationOutput struct {
_ struct{} `type:"structure"`
}
@ -1711,6 +1879,22 @@ func (s DeleteDeploymentConfigInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteDeploymentConfigInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentConfigInput"}
if s.DeploymentConfigName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName"))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteDeploymentConfigOutput struct {
_ struct{} `type:"structure"`
}
@ -1747,6 +1931,28 @@ func (s DeleteDeploymentGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteDeploymentGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentGroupInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName"))
}
if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a delete deployment group operation.
type DeleteDeploymentGroupOutput struct {
_ struct{} `type:"structure"`
@ -1966,6 +2172,19 @@ func (s DeregisterOnPremisesInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeregisterOnPremisesInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeregisterOnPremisesInstanceInput"}
if s.InstanceName == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeregisterOnPremisesInstanceOutput struct {
_ struct{} `type:"structure"`
}
@ -2132,6 +2351,22 @@ func (s GetApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetApplicationInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get application operation.
type GetApplicationOutput struct {
_ struct{} `type:"structure"`
@ -2171,6 +2406,25 @@ func (s GetApplicationRevisionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetApplicationRevisionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetApplicationRevisionInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.Revision == nil {
invalidParams.Add(request.NewErrParamRequired("Revision"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get application revision operation.
type GetApplicationRevisionOutput struct {
_ struct{} `type:"structure"`
@ -2214,6 +2468,22 @@ func (s GetDeploymentConfigInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDeploymentConfigInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDeploymentConfigInput"}
if s.DeploymentConfigName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentConfigName"))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get deployment configuration operation.
type GetDeploymentConfigOutput struct {
_ struct{} `type:"structure"`
@ -2254,6 +2524,28 @@ func (s GetDeploymentGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDeploymentGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDeploymentGroupInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentGroupName"))
}
if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get deployment group operation.
type GetDeploymentGroupOutput struct {
_ struct{} `type:"structure"`
@ -2290,6 +2582,19 @@ func (s GetDeploymentInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDeploymentInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInput"}
if s.DeploymentId == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a get deployment instance operation.
type GetDeploymentInstanceInput struct {
_ struct{} `type:"structure"`
@ -2311,6 +2616,22 @@ func (s GetDeploymentInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDeploymentInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInstanceInput"}
if s.DeploymentId == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentId"))
}
if s.InstanceId == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get deployment instance operation.
type GetDeploymentInstanceOutput struct {
_ struct{} `type:"structure"`
@ -2365,6 +2686,19 @@ func (s GetOnPremisesInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetOnPremisesInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetOnPremisesInstanceInput"}
if s.InstanceName == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a get on-premises instance operation.
type GetOnPremisesInstanceOutput struct {
_ struct{} `type:"structure"`
@ -2571,6 +2905,22 @@ func (s ListApplicationRevisionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListApplicationRevisionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListApplicationRevisionsInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a list application revisions operation.
type ListApplicationRevisionsOutput struct {
_ struct{} `type:"structure"`
@ -2703,6 +3053,22 @@ func (s ListDeploymentGroupsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListDeploymentGroupsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListDeploymentGroupsInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a list deployment groups operation.
type ListDeploymentGroupsOutput struct {
_ struct{} `type:"structure"`
@ -2760,6 +3126,19 @@ func (s ListDeploymentInstancesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListDeploymentInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListDeploymentInstancesInput"}
if s.DeploymentId == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a list deployment instances operation.
type ListDeploymentInstancesOutput struct {
_ struct{} `type:"structure"`
@ -2821,6 +3200,22 @@ func (s ListDeploymentsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListDeploymentsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListDeploymentsInput"}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.DeploymentGroupName != nil && len(*s.DeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a list deployments operation.
type ListDeploymentsOutput struct {
_ struct{} `type:"structure"`
@ -2966,6 +3361,25 @@ func (s RegisterApplicationRevisionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RegisterApplicationRevisionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RegisterApplicationRevisionInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.Revision == nil {
invalidParams.Add(request.NewErrParamRequired("Revision"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RegisterApplicationRevisionOutput struct {
_ struct{} `type:"structure"`
}
@ -3001,6 +3415,22 @@ func (s RegisterOnPremisesInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RegisterOnPremisesInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RegisterOnPremisesInstanceInput"}
if s.IamUserArn == nil {
invalidParams.Add(request.NewErrParamRequired("IamUserArn"))
}
if s.InstanceName == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RegisterOnPremisesInstanceOutput struct {
_ struct{} `type:"structure"`
}
@ -3036,6 +3466,22 @@ func (s RemoveTagsFromOnPremisesInstancesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsFromOnPremisesInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromOnPremisesInstancesInput"}
if s.InstanceNames == nil {
invalidParams.Add(request.NewErrParamRequired("InstanceNames"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemoveTagsFromOnPremisesInstancesOutput struct {
_ struct{} `type:"structure"`
}
@ -3160,6 +3606,19 @@ func (s StopDeploymentInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StopDeploymentInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StopDeploymentInput"}
if s.DeploymentId == nil {
invalidParams.Add(request.NewErrParamRequired("DeploymentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a stop deployment operation.
type StopDeploymentOutput struct {
_ struct{} `type:"structure"`
@ -3307,6 +3766,22 @@ func (s UpdateApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationInput"}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.NewApplicationName != nil && len(*s.NewApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NewApplicationName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateApplicationOutput struct {
_ struct{} `type:"structure"`
}
@ -3371,6 +3846,34 @@ func (s UpdateDeploymentGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateDeploymentGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateDeploymentGroupInput"}
if s.ApplicationName == nil {
invalidParams.Add(request.NewErrParamRequired("ApplicationName"))
}
if s.ApplicationName != nil && len(*s.ApplicationName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ApplicationName", 1))
}
if s.CurrentDeploymentGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CurrentDeploymentGroupName"))
}
if s.CurrentDeploymentGroupName != nil && len(*s.CurrentDeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("CurrentDeploymentGroupName", 1))
}
if s.DeploymentConfigName != nil && len(*s.DeploymentConfigName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DeploymentConfigName", 1))
}
if s.NewDeploymentGroupName != nil && len(*s.NewDeploymentGroupName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NewDeploymentGroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of an update deployment group operation.
type UpdateDeploymentGroupOutput struct {
_ struct{} `type:"structure"`

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@
package dynamodb
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -785,6 +786,25 @@ func (s AttributeDefinition) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AttributeDefinition) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AttributeDefinition"}
if s.AttributeName == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeName"))
}
if s.AttributeName != nil && len(*s.AttributeName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1))
}
if s.AttributeType == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeType"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the data for an attribute. You can set one, and only one, of the
// elements.
//
@ -1049,6 +1069,32 @@ func (s BatchGetItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetItemInput"}
if s.RequestItems == nil {
invalidParams.Add(request.NewErrParamRequired("RequestItems"))
}
if s.RequestItems != nil && len(s.RequestItems) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1))
}
if s.RequestItems != nil {
for i, v := range s.RequestItems {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequestItems", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a BatchGetItem operation.
type BatchGetItemOutput struct {
_ struct{} `type:"structure"`
@ -1166,6 +1212,22 @@ func (s BatchWriteItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchWriteItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchWriteItemInput"}
if s.RequestItems == nil {
invalidParams.Add(request.NewErrParamRequired("RequestItems"))
}
if s.RequestItems != nil && len(s.RequestItems) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a BatchWriteItem operation.
type BatchWriteItemOutput struct {
_ struct{} `type:"structure"`
@ -1435,6 +1497,19 @@ func (s Condition) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Condition) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Condition"}
if s.ComparisonOperator == nil {
invalidParams.Add(request.NewErrParamRequired("ComparisonOperator"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The capacity units consumed by an operation. The data returned includes the
// total provisioned throughput consumed, along with statistics for the table
// and any indexes involved in the operation. ConsumedCapacity is only returned
@ -1504,6 +1579,54 @@ func (s CreateGlobalSecondaryIndexAction) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateGlobalSecondaryIndexAction) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateGlobalSecondaryIndexAction"}
if s.IndexName == nil {
invalidParams.Add(request.NewErrParamRequired("IndexName"))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.KeySchema == nil {
invalidParams.Add(request.NewErrParamRequired("KeySchema"))
}
if s.KeySchema != nil && len(s.KeySchema) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
}
if s.Projection == nil {
invalidParams.Add(request.NewErrParamRequired("Projection"))
}
if s.ProvisionedThroughput == nil {
invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
}
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
}
}
}
if s.Projection != nil {
if err := s.Projection.Validate(); err != nil {
invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
}
}
if s.ProvisionedThroughput != nil {
if err := s.ProvisionedThroughput.Validate(); err != nil {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a CreateTable operation.
type CreateTableInput struct {
_ struct{} `type:"structure"`
@ -1656,6 +1779,79 @@ func (s CreateTableInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateTableInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateTableInput"}
if s.AttributeDefinitions == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeDefinitions"))
}
if s.KeySchema == nil {
invalidParams.Add(request.NewErrParamRequired("KeySchema"))
}
if s.KeySchema != nil && len(s.KeySchema) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
}
if s.ProvisionedThroughput == nil {
invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if s.AttributeDefinitions != nil {
for i, v := range s.AttributeDefinitions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams))
}
}
}
if s.GlobalSecondaryIndexes != nil {
for i, v := range s.GlobalSecondaryIndexes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexes", i), err.(request.ErrInvalidParams))
}
}
}
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
}
}
}
if s.LocalSecondaryIndexes != nil {
for i, v := range s.LocalSecondaryIndexes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexes", i), err.(request.ErrInvalidParams))
}
}
}
if s.ProvisionedThroughput != nil {
if err := s.ProvisionedThroughput.Validate(); err != nil {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a CreateTable operation.
type CreateTableOutput struct {
_ struct{} `type:"structure"`
@ -1692,6 +1888,22 @@ func (s DeleteGlobalSecondaryIndexAction) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteGlobalSecondaryIndexAction) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteGlobalSecondaryIndexAction"}
if s.IndexName == nil {
invalidParams.Add(request.NewErrParamRequired("IndexName"))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a DeleteItem operation.
type DeleteItemInput struct {
_ struct{} `type:"structure"`
@ -2046,6 +2258,25 @@ func (s DeleteItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteItemInput"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a DeleteItem operation.
type DeleteItemOutput struct {
_ struct{} `type:"structure"`
@ -2133,6 +2364,22 @@ func (s DeleteTableInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteTableInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteTableInput"}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a DeleteTable operation.
type DeleteTableOutput struct {
_ struct{} `type:"structure"`
@ -2217,6 +2464,22 @@ func (s DescribeTableInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeTableInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeTableInput"}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a DescribeTable operation.
type DescribeTableOutput struct {
_ struct{} `type:"structure"`
@ -2564,6 +2827,28 @@ func (s GetItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetItemInput"}
if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a GetItem operation.
type GetItemOutput struct {
_ struct{} `type:"structure"`
@ -2639,6 +2924,54 @@ func (s GlobalSecondaryIndex) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GlobalSecondaryIndex) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndex"}
if s.IndexName == nil {
invalidParams.Add(request.NewErrParamRequired("IndexName"))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.KeySchema == nil {
invalidParams.Add(request.NewErrParamRequired("KeySchema"))
}
if s.KeySchema != nil && len(s.KeySchema) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
}
if s.Projection == nil {
invalidParams.Add(request.NewErrParamRequired("Projection"))
}
if s.ProvisionedThroughput == nil {
invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
}
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
}
}
}
if s.Projection != nil {
if err := s.Projection.Validate(); err != nil {
invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
}
}
if s.ProvisionedThroughput != nil {
if err := s.ProvisionedThroughput.Validate(); err != nil {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the properties of a global secondary index.
type GlobalSecondaryIndexDescription struct {
_ struct{} `type:"structure"`
@ -2759,6 +3092,31 @@ func (s GlobalSecondaryIndexUpdate) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GlobalSecondaryIndexUpdate) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndexUpdate"}
if s.Create != nil {
if err := s.Create.Validate(); err != nil {
invalidParams.AddNested("Create", err.(request.ErrInvalidParams))
}
}
if s.Delete != nil {
if err := s.Delete.Validate(); err != nil {
invalidParams.AddNested("Delete", err.(request.ErrInvalidParams))
}
}
if s.Update != nil {
if err := s.Update.Validate(); err != nil {
invalidParams.AddNested("Update", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Information about item collections, if any, that were affected by the operation.
// ItemCollectionMetrics is only returned if the request asked for it. If the
// table does not have any local secondary indexes, this information is not
@ -2836,6 +3194,25 @@ func (s KeySchemaElement) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *KeySchemaElement) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "KeySchemaElement"}
if s.AttributeName == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeName"))
}
if s.AttributeName != nil && len(*s.AttributeName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1))
}
if s.KeyType == nil {
invalidParams.Add(request.NewErrParamRequired("KeyType"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents a set of primary keys and, for each key, the attributes to retrieve
// from the table.
//
@ -2920,6 +3297,25 @@ func (s KeysAndAttributes) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *KeysAndAttributes) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "KeysAndAttributes"}
if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
}
if s.Keys == nil {
invalidParams.Add(request.NewErrParamRequired("Keys"))
}
if s.Keys != nil && len(s.Keys) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Keys", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a ListTables operation.
type ListTablesInput struct {
_ struct{} `type:"structure"`
@ -2944,6 +3340,22 @@ func (s ListTablesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTablesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTablesInput"}
if s.ExclusiveStartTableName != nil && len(*s.ExclusiveStartTableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartTableName", 3))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a ListTables operation.
type ListTablesOutput struct {
_ struct{} `type:"structure"`
@ -3016,6 +3428,46 @@ func (s LocalSecondaryIndex) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LocalSecondaryIndex) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LocalSecondaryIndex"}
if s.IndexName == nil {
invalidParams.Add(request.NewErrParamRequired("IndexName"))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.KeySchema == nil {
invalidParams.Add(request.NewErrParamRequired("KeySchema"))
}
if s.KeySchema != nil && len(s.KeySchema) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
}
if s.Projection == nil {
invalidParams.Add(request.NewErrParamRequired("Projection"))
}
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams))
}
}
}
if s.Projection != nil {
if err := s.Projection.Validate(); err != nil {
invalidParams.AddNested("Projection", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the properties of a local secondary index.
type LocalSecondaryIndexDescription struct {
_ struct{} `type:"structure"`
@ -3103,6 +3555,19 @@ func (s Projection) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Projection) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Projection"}
if s.NonKeyAttributes != nil && len(s.NonKeyAttributes) < 1 {
invalidParams.Add(request.NewErrParamMinLen("NonKeyAttributes", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the provisioned throughput settings for a specified table or index.
// The settings can be modified using the UpdateTable operation.
//
@ -3135,6 +3600,28 @@ func (s ProvisionedThroughput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ProvisionedThroughput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ProvisionedThroughput"}
if s.ReadCapacityUnits == nil {
invalidParams.Add(request.NewErrParamRequired("ReadCapacityUnits"))
}
if s.ReadCapacityUnits != nil && *s.ReadCapacityUnits < 1 {
invalidParams.Add(request.NewErrParamMinValue("ReadCapacityUnits", 1))
}
if s.WriteCapacityUnits == nil {
invalidParams.Add(request.NewErrParamRequired("WriteCapacityUnits"))
}
if s.WriteCapacityUnits != nil && *s.WriteCapacityUnits < 1 {
invalidParams.Add(request.NewErrParamMinValue("WriteCapacityUnits", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the provisioned throughput settings for the table, consisting
// of read and write capacity units, along with data about increases and decreases.
type ProvisionedThroughputDescription struct {
@ -3539,6 +4026,25 @@ func (s PutItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutItemInput"}
if s.Item == nil {
invalidParams.Add(request.NewErrParamRequired("Item"))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a PutItem operation.
type PutItemOutput struct {
_ struct{} `type:"structure"`
@ -4103,6 +4609,51 @@ func (s QueryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *QueryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "QueryInput"}
if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if s.KeyConditions != nil {
for i, v := range s.KeyConditions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeyConditions", i), err.(request.ErrInvalidParams))
}
}
}
if s.QueryFilter != nil {
for i, v := range s.QueryFilter {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueryFilter", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a Query operation.
type QueryOutput struct {
_ struct{} `type:"structure"`
@ -4460,6 +5011,44 @@ func (s ScanInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ScanInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ScanInput"}
if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if s.TotalSegments != nil && *s.TotalSegments < 1 {
invalidParams.Add(request.NewErrParamMinValue("TotalSegments", 1))
}
if s.ScanFilter != nil {
for i, v := range s.ScanFilter {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScanFilter", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a Scan operation.
type ScanOutput struct {
_ struct{} `type:"structure"`
@ -4793,6 +5382,30 @@ func (s UpdateGlobalSecondaryIndexAction) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateGlobalSecondaryIndexAction) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalSecondaryIndexAction"}
if s.IndexName == nil {
invalidParams.Add(request.NewErrParamRequired("IndexName"))
}
if s.IndexName != nil && len(*s.IndexName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("IndexName", 3))
}
if s.ProvisionedThroughput == nil {
invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
}
if s.ProvisionedThroughput != nil {
if err := s.ProvisionedThroughput.Validate(); err != nil {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of an UpdateItem operation.
type UpdateItemInput struct {
_ struct{} `type:"structure"`
@ -5326,6 +5939,25 @@ func (s UpdateItemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateItemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateItemInput"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of an UpdateItem operation.
type UpdateItemOutput struct {
_ struct{} `type:"structure"`
@ -5412,6 +6044,47 @@ func (s UpdateTableInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateTableInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateTableInput"}
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
if s.TableName != nil && len(*s.TableName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
}
if s.AttributeDefinitions != nil {
for i, v := range s.AttributeDefinitions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams))
}
}
}
if s.GlobalSecondaryIndexUpdates != nil {
for i, v := range s.GlobalSecondaryIndexUpdates {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexUpdates", i), err.(request.ErrInvalidParams))
}
}
}
if s.ProvisionedThroughput != nil {
if err := s.ProvisionedThroughput.Validate(); err != nil {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of an UpdateTable operation.
type UpdateTableOutput struct {
_ struct{} `type:"structure"`

File diff suppressed because it is too large Load Diff

View File

@ -493,7 +493,7 @@ func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) erro
State: "retry",
Matcher: "error",
Argument: "",
Expected: "InvalidNatGatewayIDNotFound",
Expected: "NatGatewayNotFound",
},
},
}
@ -522,7 +522,7 @@ func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterface
State: "failure",
Matcher: "error",
Argument: "",
Expected: "InvalidNetworkInterfaceIDNotFound",
Expected: "InvalidNetworkInterfaceID.NotFound",
},
},
}

View File

@ -489,7 +489,7 @@ type AuthorizationData struct {
// The registry URL to use for this authorization token in a docker login command.
// The Amazon ECR registry URL format is https://aws_account_id.dkr.ecr.region.amazonaws.com.
// For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com.
// For example, https://012345678910.dkr.ecr.us-east-1.amazonaws.com..
ProxyEndpoint *string `locationName:"proxyEndpoint" type:"string"`
}
@ -527,6 +527,28 @@ func (s BatchCheckLayerAvailabilityInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchCheckLayerAvailabilityInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchCheckLayerAvailabilityInput"}
if s.LayerDigests == nil {
invalidParams.Add(request.NewErrParamRequired("LayerDigests"))
}
if s.LayerDigests != nil && len(s.LayerDigests) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LayerDigests", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type BatchCheckLayerAvailabilityOutput struct {
_ struct{} `type:"structure"`
@ -575,6 +597,28 @@ func (s BatchDeleteImageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchDeleteImageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchDeleteImageInput"}
if s.ImageIds == nil {
invalidParams.Add(request.NewErrParamRequired("ImageIds"))
}
if s.ImageIds != nil && len(s.ImageIds) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ImageIds", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type BatchDeleteImageOutput struct {
_ struct{} `type:"structure"`
@ -620,6 +664,28 @@ func (s BatchGetImageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *BatchGetImageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "BatchGetImageInput"}
if s.ImageIds == nil {
invalidParams.Add(request.NewErrParamRequired("ImageIds"))
}
if s.ImageIds != nil && len(s.ImageIds) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ImageIds", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type BatchGetImageOutput struct {
_ struct{} `type:"structure"`
@ -668,6 +734,31 @@ func (s CompleteLayerUploadInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CompleteLayerUploadInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CompleteLayerUploadInput"}
if s.LayerDigests == nil {
invalidParams.Add(request.NewErrParamRequired("LayerDigests"))
}
if s.LayerDigests != nil && len(s.LayerDigests) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LayerDigests", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CompleteLayerUploadOutput struct {
_ struct{} `type:"structure"`
@ -713,6 +804,22 @@ func (s CreateRepositoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateRepositoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateRepositoryInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateRepositoryOutput struct {
_ struct{} `type:"structure"`
@ -754,6 +861,22 @@ func (s DeleteRepositoryInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRepositoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteRepositoryOutput struct {
_ struct{} `type:"structure"`
@ -794,6 +917,22 @@ func (s DeleteRepositoryPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteRepositoryPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteRepositoryPolicyInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteRepositoryPolicyOutput struct {
_ struct{} `type:"structure"`
@ -856,6 +995,22 @@ func (s DescribeRepositoriesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeRepositoriesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeRepositoriesInput"}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
}
if s.RepositoryNames != nil && len(s.RepositoryNames) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryNames", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeRepositoriesOutput struct {
_ struct{} `type:"structure"`
@ -898,6 +1053,19 @@ func (s GetAuthorizationTokenInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetAuthorizationTokenInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetAuthorizationTokenInput"}
if s.RegistryIds != nil && len(s.RegistryIds) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RegistryIds", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetAuthorizationTokenOutput struct {
_ struct{} `type:"structure"`
@ -940,6 +1108,25 @@ func (s GetDownloadUrlForLayerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDownloadUrlForLayerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDownloadUrlForLayerInput"}
if s.LayerDigest == nil {
invalidParams.Add(request.NewErrParamRequired("LayerDigest"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetDownloadUrlForLayerOutput struct {
_ struct{} `type:"structure"`
@ -981,6 +1168,22 @@ func (s GetRepositoryPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetRepositoryPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetRepositoryPolicyInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetRepositoryPolicyOutput struct {
_ struct{} `type:"structure"`
@ -1095,6 +1298,22 @@ func (s InitiateLayerUploadInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InitiateLayerUploadInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InitiateLayerUploadInput"}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type InitiateLayerUploadOutput struct {
_ struct{} `type:"structure"`
@ -1201,6 +1420,25 @@ func (s ListImagesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListImagesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListImagesInput"}
if s.MaxResults != nil && *s.MaxResults < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListImagesOutput struct {
_ struct{} `type:"structure"`
@ -1249,6 +1487,25 @@ func (s PutImageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutImageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutImageInput"}
if s.ImageManifest == nil {
invalidParams.Add(request.NewErrParamRequired("ImageManifest"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutImageOutput struct {
_ struct{} `type:"structure"`
@ -1281,6 +1538,10 @@ type Repository struct {
// The name of the repository.
RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"`
// The URI for the repository. You can use this URI for Docker push and pull
// operations.
RepositoryUri *string `locationName:"repositoryUri" type:"string"`
}
// String returns the string representation
@ -1322,6 +1583,25 @@ func (s SetRepositoryPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetRepositoryPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetRepositoryPolicyInput"}
if s.PolicyText == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyText"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetRepositoryPolicyOutput struct {
_ struct{} `type:"structure"`
@ -1381,6 +1661,34 @@ func (s UploadLayerPartInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UploadLayerPartInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UploadLayerPartInput"}
if s.LayerPartBlob == nil {
invalidParams.Add(request.NewErrParamRequired("LayerPartBlob"))
}
if s.PartFirstByte == nil {
invalidParams.Add(request.NewErrParamRequired("PartFirstByte"))
}
if s.PartLastByte == nil {
invalidParams.Add(request.NewErrParamRequired("PartLastByte"))
}
if s.RepositoryName == nil {
invalidParams.Add(request.NewErrParamRequired("RepositoryName"))
}
if s.RepositoryName != nil && len(*s.RepositoryName) < 2 {
invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 2))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UploadLayerPartOutput struct {
_ struct{} `type:"structure"`

View File

@ -4,6 +4,7 @@
package ecs
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -1034,6 +1035,19 @@ func (s Attribute) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Attribute) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Attribute"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A regional grouping of one or more container instances on which you can run
// task requests. Each account receives a default cluster the first time you
// use the Amazon ECS service, but you may also create other clusters. Clusters
@ -1392,6 +1406,41 @@ func (s ContainerDefinition) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ContainerDefinition) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ContainerDefinition"}
if s.ExtraHosts != nil {
for i, v := range s.ExtraHosts {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExtraHosts", i), err.(request.ErrInvalidParams))
}
}
}
if s.LogConfiguration != nil {
if err := s.LogConfiguration.Validate(); err != nil {
invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams))
}
}
if s.Ulimits != nil {
for i, v := range s.Ulimits {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Ulimits", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// An EC2 instance that is running the Amazon ECS agent and has been registered
// with a cluster.
type ContainerInstance struct {
@ -1569,6 +1618,25 @@ func (s CreateServiceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateServiceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateServiceInput"}
if s.DesiredCount == nil {
invalidParams.Add(request.NewErrParamRequired("DesiredCount"))
}
if s.ServiceName == nil {
invalidParams.Add(request.NewErrParamRequired("ServiceName"))
}
if s.TaskDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateServiceOutput struct {
_ struct{} `type:"structure"`
@ -1603,6 +1671,19 @@ func (s DeleteClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"}
if s.Cluster == nil {
invalidParams.Add(request.NewErrParamRequired("Cluster"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterOutput struct {
_ struct{} `type:"structure"`
@ -1641,6 +1722,19 @@ func (s DeleteServiceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteServiceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteServiceInput"}
if s.Service == nil {
invalidParams.Add(request.NewErrParamRequired("Service"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteServiceOutput struct {
_ struct{} `type:"structure"`
@ -1766,6 +1860,19 @@ func (s DeregisterContainerInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeregisterContainerInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeregisterContainerInstanceInput"}
if s.ContainerInstance == nil {
invalidParams.Add(request.NewErrParamRequired("ContainerInstance"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeregisterContainerInstanceOutput struct {
_ struct{} `type:"structure"`
@ -1802,6 +1909,19 @@ func (s DeregisterTaskDefinitionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeregisterTaskDefinitionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeregisterTaskDefinitionInput"}
if s.TaskDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeregisterTaskDefinitionOutput struct {
_ struct{} `type:"structure"`
@ -1880,6 +2000,19 @@ func (s DescribeContainerInstancesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeContainerInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeContainerInstancesInput"}
if s.ContainerInstances == nil {
invalidParams.Add(request.NewErrParamRequired("ContainerInstances"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeContainerInstancesOutput struct {
_ struct{} `type:"structure"`
@ -1921,6 +2054,19 @@ func (s DescribeServicesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeServicesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeServicesInput"}
if s.Services == nil {
invalidParams.Add(request.NewErrParamRequired("Services"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeServicesOutput struct {
_ struct{} `type:"structure"`
@ -1960,6 +2106,19 @@ func (s DescribeTaskDefinitionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeTaskDefinitionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeTaskDefinitionInput"}
if s.TaskDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeTaskDefinitionOutput struct {
_ struct{} `type:"structure"`
@ -1999,6 +2158,19 @@ func (s DescribeTasksInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeTasksInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeTasksInput"}
if s.Tasks == nil {
invalidParams.Add(request.NewErrParamRequired("Tasks"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeTasksOutput struct {
_ struct{} `type:"structure"`
@ -2106,6 +2278,22 @@ func (s HostEntry) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *HostEntry) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "HostEntry"}
if s.Hostname == nil {
invalidParams.Add(request.NewErrParamRequired("Hostname"))
}
if s.IpAddress == nil {
invalidParams.Add(request.NewErrParamRequired("IpAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Details on a container instance host volume.
type HostVolumeProperties struct {
_ struct{} `type:"structure"`
@ -2595,6 +2783,19 @@ func (s LogConfiguration) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LogConfiguration) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LogConfiguration"}
if s.LogDriver == nil {
invalidParams.Add(request.NewErrParamRequired("LogDriver"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Details on a volume mount point that is used in a container definition.
type MountPoint struct {
_ struct{} `type:"structure"`
@ -2745,6 +2946,26 @@ func (s RegisterContainerInstanceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RegisterContainerInstanceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RegisterContainerInstanceInput"}
if s.Attributes != nil {
for i, v := range s.Attributes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RegisterContainerInstanceOutput struct {
_ struct{} `type:"structure"`
@ -2791,6 +3012,32 @@ func (s RegisterTaskDefinitionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RegisterTaskDefinitionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RegisterTaskDefinitionInput"}
if s.ContainerDefinitions == nil {
invalidParams.Add(request.NewErrParamRequired("ContainerDefinitions"))
}
if s.Family == nil {
invalidParams.Add(request.NewErrParamRequired("Family"))
}
if s.ContainerDefinitions != nil {
for i, v := range s.ContainerDefinitions {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContainerDefinitions", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RegisterTaskDefinitionOutput struct {
_ struct{} `type:"structure"`
@ -2895,6 +3142,19 @@ func (s RunTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RunTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RunTaskInput"}
if s.TaskDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RunTaskOutput struct {
_ struct{} `type:"structure"`
@ -3062,6 +3322,22 @@ func (s StartTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StartTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StartTaskInput"}
if s.ContainerInstances == nil {
invalidParams.Add(request.NewErrParamRequired("ContainerInstances"))
}
if s.TaskDefinition == nil {
invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type StartTaskOutput struct {
_ struct{} `type:"structure"`
@ -3111,6 +3387,19 @@ func (s StopTaskInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *StopTaskInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "StopTaskInput"}
if s.Task == nil {
invalidParams.Add(request.NewErrParamRequired("Task"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type StopTaskOutput struct {
_ struct{} `type:"structure"`
@ -3374,6 +3663,25 @@ func (s Ulimit) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Ulimit) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Ulimit"}
if s.HardLimit == nil {
invalidParams.Add(request.NewErrParamRequired("HardLimit"))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.SoftLimit == nil {
invalidParams.Add(request.NewErrParamRequired("SoftLimit"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateContainerAgentInput struct {
_ struct{} `type:"structure"`
@ -3398,6 +3706,19 @@ func (s UpdateContainerAgentInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateContainerAgentInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateContainerAgentInput"}
if s.ContainerInstance == nil {
invalidParams.Add(request.NewErrParamRequired("ContainerInstance"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateContainerAgentOutput struct {
_ struct{} `type:"structure"`
@ -3453,6 +3774,19 @@ func (s UpdateServiceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateServiceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateServiceInput"}
if s.Service == nil {
invalidParams.Add(request.NewErrParamRequired("Service"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateServiceOutput struct {
_ struct{} `type:"structure"`

View File

@ -4,6 +4,7 @@
package efs
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -548,6 +549,22 @@ func (s CreateFileSystemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateFileSystemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateFileSystemInput"}
if s.CreationToken == nil {
invalidParams.Add(request.NewErrParamRequired("CreationToken"))
}
if s.CreationToken != nil && len(*s.CreationToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateMountTargetInput struct {
_ struct{} `type:"structure"`
@ -575,6 +592,22 @@ func (s CreateMountTargetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateMountTargetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateMountTargetInput"}
if s.FileSystemId == nil {
invalidParams.Add(request.NewErrParamRequired("FileSystemId"))
}
if s.SubnetId == nil {
invalidParams.Add(request.NewErrParamRequired("SubnetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateTagsInput struct {
_ struct{} `type:"structure"`
@ -596,6 +629,32 @@ func (s CreateTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateTagsInput"}
if s.FileSystemId == nil {
invalidParams.Add(request.NewErrParamRequired("FileSystemId"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if s.Tags != nil {
for i, v := range s.Tags {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -627,6 +686,19 @@ func (s DeleteFileSystemInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteFileSystemInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteFileSystemInput"}
if s.FileSystemId == nil {
invalidParams.Add(request.NewErrParamRequired("FileSystemId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteFileSystemOutput struct {
_ struct{} `type:"structure"`
}
@ -658,6 +730,19 @@ func (s DeleteMountTargetInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteMountTargetInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteMountTargetInput"}
if s.MountTargetId == nil {
invalidParams.Add(request.NewErrParamRequired("MountTargetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteMountTargetOutput struct {
_ struct{} `type:"structure"`
}
@ -692,6 +777,22 @@ func (s DeleteTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"}
if s.FileSystemId == nil {
invalidParams.Add(request.NewErrParamRequired("FileSystemId"))
}
if s.TagKeys == nil {
invalidParams.Add(request.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -740,6 +841,22 @@ func (s DescribeFileSystemsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeFileSystemsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeFileSystemsInput"}
if s.CreationToken != nil && len(*s.CreationToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1))
}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeFileSystemsOutput struct {
_ struct{} `type:"structure"`
@ -781,6 +898,19 @@ func (s DescribeMountTargetSecurityGroupsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeMountTargetSecurityGroupsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeMountTargetSecurityGroupsInput"}
if s.MountTargetId == nil {
invalidParams.Add(request.NewErrParamRequired("MountTargetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeMountTargetSecurityGroupsOutput struct {
_ struct{} `type:"structure"`
@ -829,6 +959,19 @@ func (s DescribeMountTargetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeMountTargetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeMountTargetsInput"}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeMountTargetsOutput struct {
_ struct{} `type:"structure"`
@ -882,6 +1025,22 @@ func (s DescribeTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"}
if s.FileSystemId == nil {
invalidParams.Add(request.NewErrParamRequired("FileSystemId"))
}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeTagsOutput struct {
_ struct{} `type:"structure"`
@ -1009,6 +1168,19 @@ func (s ModifyMountTargetSecurityGroupsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyMountTargetSecurityGroupsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyMountTargetSecurityGroupsInput"}
if s.MountTargetId == nil {
invalidParams.Add(request.NewErrParamRequired("MountTargetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyMountTargetSecurityGroupsOutput struct {
_ struct{} `type:"structure"`
}
@ -1083,6 +1255,25 @@ func (s Tag) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Tag) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Tag"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Key", 1))
}
if s.Value == nil {
invalidParams.Add(request.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
const (
// @enum LifeCycleState
LifeCycleStateCreating = "creating"

View File

@ -1379,6 +1379,22 @@ func (s AddTagsToResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsToResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsToResourceInput"}
if s.ResourceName == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceName"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of an AuthorizeCacheSecurityGroupIngress action.
type AuthorizeCacheSecurityGroupIngressInput struct {
_ struct{} `type:"structure"`
@ -1406,6 +1422,25 @@ func (s AuthorizeCacheSecurityGroupIngressInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AuthorizeCacheSecurityGroupIngressInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AuthorizeCacheSecurityGroupIngressInput"}
if s.CacheSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName"))
}
if s.EC2SecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupName"))
}
if s.EC2SecurityGroupOwnerId == nil {
invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupOwnerId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AuthorizeCacheSecurityGroupIngressOutput struct {
_ struct{} `type:"structure"`
@ -1898,6 +1933,22 @@ func (s CopySnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CopySnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CopySnapshotInput"}
if s.SourceSnapshotName == nil {
invalidParams.Add(request.NewErrParamRequired("SourceSnapshotName"))
}
if s.TargetSnapshotName == nil {
invalidParams.Add(request.NewErrParamRequired("TargetSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CopySnapshotOutput struct {
_ struct{} `type:"structure"`
@ -2126,6 +2177,19 @@ func (s CreateCacheClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateCacheClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateCacheClusterInput"}
if s.CacheClusterId == nil {
invalidParams.Add(request.NewErrParamRequired("CacheClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateCacheClusterOutput struct {
_ struct{} `type:"structure"`
@ -2170,6 +2234,25 @@ func (s CreateCacheParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateCacheParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateCacheParameterGroupInput"}
if s.CacheParameterGroupFamily == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupFamily"))
}
if s.CacheParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName"))
}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateCacheParameterGroupOutput struct {
_ struct{} `type:"structure"`
@ -2214,6 +2297,22 @@ func (s CreateCacheSecurityGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateCacheSecurityGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateCacheSecurityGroupInput"}
if s.CacheSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName"))
}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateCacheSecurityGroupOutput struct {
_ struct{} `type:"structure"`
@ -2261,6 +2360,25 @@ func (s CreateCacheSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateCacheSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateCacheSubnetGroupInput"}
if s.CacheSubnetGroupDescription == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupDescription"))
}
if s.CacheSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName"))
}
if s.SubnetIds == nil {
invalidParams.Add(request.NewErrParamRequired("SubnetIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateCacheSubnetGroupOutput struct {
_ struct{} `type:"structure"`
@ -2469,6 +2587,22 @@ func (s CreateReplicationGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateReplicationGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateReplicationGroupInput"}
if s.ReplicationGroupDescription == nil {
invalidParams.Add(request.NewErrParamRequired("ReplicationGroupDescription"))
}
if s.ReplicationGroupId == nil {
invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateReplicationGroupOutput struct {
_ struct{} `type:"structure"`
@ -2508,6 +2642,22 @@ func (s CreateSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"}
if s.CacheClusterId == nil {
invalidParams.Add(request.NewErrParamRequired("CacheClusterId"))
}
if s.SnapshotName == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -2550,6 +2700,19 @@ func (s DeleteCacheClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteCacheClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteCacheClusterInput"}
if s.CacheClusterId == nil {
invalidParams.Add(request.NewErrParamRequired("CacheClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteCacheClusterOutput struct {
_ struct{} `type:"structure"`
@ -2588,6 +2751,19 @@ func (s DeleteCacheParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteCacheParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteCacheParameterGroupInput"}
if s.CacheParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteCacheParameterGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -2622,6 +2798,19 @@ func (s DeleteCacheSecurityGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteCacheSecurityGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteCacheSecurityGroupInput"}
if s.CacheSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteCacheSecurityGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -2656,6 +2845,19 @@ func (s DeleteCacheSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteCacheSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteCacheSubnetGroupInput"}
if s.CacheSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteCacheSubnetGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -2699,6 +2901,19 @@ func (s DeleteReplicationGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteReplicationGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationGroupInput"}
if s.ReplicationGroupId == nil {
invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteReplicationGroupOutput struct {
_ struct{} `type:"structure"`
@ -2734,6 +2949,19 @@ func (s DeleteSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"}
if s.SnapshotName == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -2974,6 +3202,19 @@ func (s DescribeCacheParametersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeCacheParametersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeCacheParametersInput"}
if s.CacheParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the output of a DescribeCacheParameters action.
type DescribeCacheParametersOutput struct {
_ struct{} `type:"structure"`
@ -3140,6 +3381,19 @@ func (s DescribeEngineDefaultParametersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeEngineDefaultParametersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeEngineDefaultParametersInput"}
if s.CacheParameterGroupFamily == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupFamily"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeEngineDefaultParametersOutput struct {
_ struct{} `type:"structure"`
@ -3734,6 +3988,19 @@ func (s ListTagsForResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTagsForResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"}
if s.ResourceName == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a ModifyCacheCluster action.
type ModifyCacheClusterInput struct {
_ struct{} `type:"structure"`
@ -3940,6 +4207,19 @@ func (s ModifyCacheClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyCacheClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyCacheClusterInput"}
if s.CacheClusterId == nil {
invalidParams.Add(request.NewErrParamRequired("CacheClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyCacheClusterOutput struct {
_ struct{} `type:"structure"`
@ -3980,6 +4260,22 @@ func (s ModifyCacheParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyCacheParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyCacheParameterGroupInput"}
if s.CacheParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName"))
}
if s.ParameterNameValues == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterNameValues"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a ModifyCacheSubnetGroup action.
type ModifyCacheSubnetGroupInput struct {
_ struct{} `type:"structure"`
@ -4009,6 +4305,19 @@ func (s ModifyCacheSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyCacheSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyCacheSubnetGroupInput"}
if s.CacheSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSubnetGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyCacheSubnetGroupOutput struct {
_ struct{} `type:"structure"`
@ -4161,6 +4470,19 @@ func (s ModifyReplicationGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyReplicationGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyReplicationGroupInput"}
if s.ReplicationGroupId == nil {
invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyReplicationGroupOutput struct {
_ struct{} `type:"structure"`
@ -4420,6 +4742,19 @@ func (s PurchaseReservedCacheNodesOfferingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PurchaseReservedCacheNodesOfferingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedCacheNodesOfferingInput"}
if s.ReservedCacheNodesOfferingId == nil {
invalidParams.Add(request.NewErrParamRequired("ReservedCacheNodesOfferingId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PurchaseReservedCacheNodesOfferingOutput struct {
_ struct{} `type:"structure"`
@ -4460,6 +4795,22 @@ func (s RebootCacheClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RebootCacheClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RebootCacheClusterInput"}
if s.CacheClusterId == nil {
invalidParams.Add(request.NewErrParamRequired("CacheClusterId"))
}
if s.CacheNodeIdsToReboot == nil {
invalidParams.Add(request.NewErrParamRequired("CacheNodeIdsToReboot"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RebootCacheClusterOutput struct {
_ struct{} `type:"structure"`
@ -4527,6 +4878,22 @@ func (s RemoveTagsFromResourceInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsFromResourceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromResourceInput"}
if s.ResourceName == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceName"))
}
if s.TagKeys == nil {
invalidParams.Add(request.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains all of the attributes of a specific replication group.
type ReplicationGroup struct {
_ struct{} `type:"structure"`
@ -4754,6 +5121,22 @@ func (s ResetCacheParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ResetCacheParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ResetCacheParameterGroupInput"}
if s.CacheParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheParameterGroupName"))
}
if s.ParameterNameValues == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterNameValues"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Represents the input of a RevokeCacheSecurityGroupIngress action.
type RevokeCacheSecurityGroupIngressInput struct {
_ struct{} `type:"structure"`
@ -4780,6 +5163,25 @@ func (s RevokeCacheSecurityGroupIngressInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RevokeCacheSecurityGroupIngressInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RevokeCacheSecurityGroupIngressInput"}
if s.CacheSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("CacheSecurityGroupName"))
}
if s.EC2SecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupName"))
}
if s.EC2SecurityGroupOwnerId == nil {
invalidParams.Add(request.NewErrParamRequired("EC2SecurityGroupOwnerId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RevokeCacheSecurityGroupIngressOutput struct {
_ struct{} `type:"structure"`

File diff suppressed because it is too large Load Diff

View File

@ -11,15 +11,11 @@ import (
"github.com/aws/aws-sdk-go/private/signer/v4"
)
// This is the AWS Elastic Beanstalk API Reference. This guide provides detailed
// information about AWS Elastic Beanstalk actions, data types, parameters,
// and errors.
// AWS Elastic Beanstalk makes it easy for you to create, deploy, and manage
// scalable, fault-tolerant applications running on the Amazon Web Services
// cloud.
//
// AWS Elastic Beanstalk is a tool that makes it easy for you to create, deploy,
// and manage scalable, fault-tolerant applications running on Amazon Web Services
// cloud resources.
//
// For more information about this product, go to the AWS Elastic Beanstalk
// For more information about this product, go to the AWS Elastic Beanstalk
// (http://aws.amazon.com/elasticbeanstalk/) details page. The location of the
// latest AWS Elastic Beanstalk WSDL is http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl
// (http://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl).
@ -27,7 +23,7 @@ import (
// (IDE) Toolkits, and command line tools that enable you to access the API,
// go to Tools for Amazon Web Services (https://aws.amazon.com/tools/).
//
// Endpoints
// Endpoints
//
// For a list of region-specific endpoints that AWS Elastic Beanstalk supports,
// go to Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region)

View File

@ -4,6 +4,7 @@
package elasticsearchservice
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -346,6 +347,32 @@ func (s AddTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"}
if s.ARN == nil {
invalidParams.Add(request.NewErrParamRequired("ARN"))
}
if s.TagList == nil {
invalidParams.Add(request.NewErrParamRequired("TagList"))
}
if s.TagList != nil {
for i, v := range s.TagList {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagList", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -431,6 +458,22 @@ func (s CreateElasticsearchDomainInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateElasticsearchDomainInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateElasticsearchDomainInput"}
if s.DomainName == nil {
invalidParams.Add(request.NewErrParamRequired("DomainName"))
}
if s.DomainName != nil && len(*s.DomainName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a CreateElasticsearchDomain operation. Contains the status
// of the newly created Elasticsearch domain.
type CreateElasticsearchDomainOutput struct {
@ -469,6 +512,22 @@ func (s DeleteElasticsearchDomainInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteElasticsearchDomainInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteElasticsearchDomainInput"}
if s.DomainName == nil {
invalidParams.Add(request.NewErrParamRequired("DomainName"))
}
if s.DomainName != nil && len(*s.DomainName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a DeleteElasticsearchDomain request. Contains the status of
// the pending deletion, or no status if the domain and all of its resources
// have been deleted.
@ -508,6 +567,22 @@ func (s DescribeElasticsearchDomainConfigInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeElasticsearchDomainConfigInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainConfigInput"}
if s.DomainName == nil {
invalidParams.Add(request.NewErrParamRequired("DomainName"))
}
if s.DomainName != nil && len(*s.DomainName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a DescribeElasticsearchDomainConfig request. Contains the configuration
// information of the requested domain.
type DescribeElasticsearchDomainConfigOutput struct {
@ -546,6 +621,22 @@ func (s DescribeElasticsearchDomainInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeElasticsearchDomainInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainInput"}
if s.DomainName == nil {
invalidParams.Add(request.NewErrParamRequired("DomainName"))
}
if s.DomainName != nil && len(*s.DomainName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a DescribeElasticsearchDomain request. Contains the status
// of the domain specified in the request.
type DescribeElasticsearchDomainOutput struct {
@ -584,6 +675,19 @@ func (s DescribeElasticsearchDomainsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeElasticsearchDomainsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchDomainsInput"}
if s.DomainNames == nil {
invalidParams.Add(request.NewErrParamRequired("DomainNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a DescribeElasticsearchDomains request. Contains the status
// of the specified domains or all domains owned by the account.
type DescribeElasticsearchDomainsOutput struct {
@ -881,6 +985,19 @@ func (s ListTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"}
if s.ARN == nil {
invalidParams.Add(request.NewErrParamRequired("ARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of a ListTags operation. Contains tags for all requested Elasticsearch
// domains.
type ListTagsOutput struct {
@ -955,6 +1072,22 @@ func (s RemoveTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"}
if s.ARN == nil {
invalidParams.Add(request.NewErrParamRequired("ARN"))
}
if s.TagKeys == nil {
invalidParams.Add(request.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemoveTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -1035,6 +1168,25 @@ func (s Tag) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Tag) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Tag"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Key", 1))
}
if s.Value == nil {
invalidParams.Add(request.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Container for the parameters to the UpdateElasticsearchDomain operation.
// Specifies the type and number of instances in the domain cluster.
type UpdateElasticsearchDomainConfigInput struct {
@ -1073,6 +1225,22 @@ func (s UpdateElasticsearchDomainConfigInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateElasticsearchDomainConfigInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateElasticsearchDomainConfigInput"}
if s.DomainName == nil {
invalidParams.Add(request.NewErrParamRequired("DomainName"))
}
if s.DomainName != nil && len(*s.DomainName) < 3 {
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The result of an UpdateElasticsearchDomain request. Contains the status of
// the Elasticsearch domain being updated.
type UpdateElasticsearchDomainConfigOutput struct {

View File

@ -4,6 +4,7 @@
package elb
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
@ -999,6 +1000,19 @@ func (s AccessLog) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AccessLog) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AccessLog"}
if s.Enabled == nil {
invalidParams.Add(request.NewErrParamRequired("Enabled"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsInput struct {
_ struct{} `type:"structure"`
@ -1019,6 +1033,35 @@ func (s AddTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"}
if s.LoadBalancerNames == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if s.Tags != nil && len(s.Tags) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
}
if s.Tags != nil {
for i, v := range s.Tags {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -1097,6 +1140,22 @@ func (s ApplySecurityGroupsToLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ApplySecurityGroupsToLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToLoadBalancerInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.SecurityGroups == nil {
invalidParams.Add(request.NewErrParamRequired("SecurityGroups"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ApplySecurityGroupsToLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@ -1135,6 +1194,22 @@ func (s AttachLoadBalancerToSubnetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AttachLoadBalancerToSubnetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AttachLoadBalancerToSubnetsInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.Subnets == nil {
invalidParams.Add(request.NewErrParamRequired("Subnets"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AttachLoadBalancerToSubnetsOutput struct {
_ struct{} `type:"structure"`
@ -1193,6 +1268,27 @@ func (s ConfigureHealthCheckInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ConfigureHealthCheckInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ConfigureHealthCheckInput"}
if s.HealthCheck == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheck"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.HealthCheck != nil {
if err := s.HealthCheck.Validate(); err != nil {
invalidParams.AddNested("HealthCheck", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ConfigureHealthCheckOutput struct {
_ struct{} `type:"structure"`
@ -1232,6 +1328,19 @@ func (s ConnectionDraining) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ConnectionDraining) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ConnectionDraining"}
if s.Enabled == nil {
invalidParams.Add(request.NewErrParamRequired("Enabled"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Information about the ConnectionSettings attribute.
type ConnectionSettings struct {
_ struct{} `type:"structure"`
@ -1251,6 +1360,22 @@ func (s ConnectionSettings) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ConnectionSettings) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ConnectionSettings"}
if s.IdleTimeout == nil {
invalidParams.Add(request.NewErrParamRequired("IdleTimeout"))
}
if s.IdleTimeout != nil && *s.IdleTimeout < 1 {
invalidParams.Add(request.NewErrParamMinValue("IdleTimeout", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateAppCookieStickinessPolicyInput struct {
_ struct{} `type:"structure"`
@ -1276,6 +1401,25 @@ func (s CreateAppCookieStickinessPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateAppCookieStickinessPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateAppCookieStickinessPolicyInput"}
if s.CookieName == nil {
invalidParams.Add(request.NewErrParamRequired("CookieName"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateAppCookieStickinessPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -1317,6 +1461,22 @@ func (s CreateLBCookieStickinessPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLBCookieStickinessPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLBCookieStickinessPolicyInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLBCookieStickinessPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -1392,6 +1552,45 @@ func (s CreateLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerInput"}
if s.Listeners == nil {
invalidParams.Add(request.NewErrParamRequired("Listeners"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.Tags != nil && len(s.Tags) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
}
if s.Listeners != nil {
for i, v := range s.Listeners {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", i), err.(request.ErrInvalidParams))
}
}
}
if s.Tags != nil {
for i, v := range s.Tags {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLoadBalancerListenersInput struct {
_ struct{} `type:"structure"`
@ -1412,6 +1611,32 @@ func (s CreateLoadBalancerListenersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLoadBalancerListenersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerListenersInput"}
if s.Listeners == nil {
invalidParams.Add(request.NewErrParamRequired("Listeners"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.Listeners != nil {
for i, v := range s.Listeners {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Listeners", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLoadBalancerListenersOutput struct {
_ struct{} `type:"structure"`
}
@ -1470,6 +1695,25 @@ func (s CreateLoadBalancerPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateLoadBalancerPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateLoadBalancerPolicyInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if s.PolicyTypeName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyTypeName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateLoadBalancerPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -1502,6 +1746,19 @@ func (s CrossZoneLoadBalancing) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CrossZoneLoadBalancing) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CrossZoneLoadBalancing"}
if s.Enabled == nil {
invalidParams.Add(request.NewErrParamRequired("Enabled"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLoadBalancerInput struct {
_ struct{} `type:"structure"`
@ -1519,6 +1776,19 @@ func (s DeleteLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLoadBalancerListenersInput struct {
_ struct{} `type:"structure"`
@ -1539,6 +1809,22 @@ func (s DeleteLoadBalancerListenersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteLoadBalancerListenersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerListenersInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.LoadBalancerPorts == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerPorts"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLoadBalancerListenersOutput struct {
_ struct{} `type:"structure"`
}
@ -1588,6 +1874,22 @@ func (s DeleteLoadBalancerPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteLoadBalancerPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteLoadBalancerPolicyInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteLoadBalancerPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -1622,6 +1924,22 @@ func (s DeregisterInstancesFromLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeregisterInstancesFromLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeregisterInstancesFromLoadBalancerInput"}
if s.Instances == nil {
invalidParams.Add(request.NewErrParamRequired("Instances"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeregisterInstancesFromLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@ -1659,6 +1977,19 @@ func (s DescribeInstanceHealthInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeInstanceHealthInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceHealthInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeInstanceHealthOutput struct {
_ struct{} `type:"structure"`
@ -1693,6 +2024,19 @@ func (s DescribeLoadBalancerAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeLoadBalancerAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancerAttributesInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeLoadBalancerAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1807,6 +2151,19 @@ func (s DescribeLoadBalancersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeLoadBalancersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeLoadBalancersInput"}
if s.PageSize != nil && *s.PageSize < 1 {
invalidParams.Add(request.NewErrParamMinValue("PageSize", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeLoadBalancersOutput struct {
_ struct{} `type:"structure"`
@ -1845,6 +2202,22 @@ func (s DescribeTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"}
if s.LoadBalancerNames == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames"))
}
if s.LoadBalancerNames != nil && len(s.LoadBalancerNames) < 1 {
invalidParams.Add(request.NewErrParamMinLen("LoadBalancerNames", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeTagsOutput struct {
_ struct{} `type:"structure"`
@ -1882,6 +2255,22 @@ func (s DetachLoadBalancerFromSubnetsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DetachLoadBalancerFromSubnetsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DetachLoadBalancerFromSubnetsInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.Subnets == nil {
invalidParams.Add(request.NewErrParamRequired("Subnets"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DetachLoadBalancerFromSubnetsOutput struct {
_ struct{} `type:"structure"`
@ -1919,6 +2308,22 @@ func (s DisableAvailabilityZonesForLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableAvailabilityZonesForLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableAvailabilityZonesForLoadBalancerInput"}
if s.AvailabilityZones == nil {
invalidParams.Add(request.NewErrParamRequired("AvailabilityZones"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableAvailabilityZonesForLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@ -1956,6 +2361,22 @@ func (s EnableAvailabilityZonesForLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableAvailabilityZonesForLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableAvailabilityZonesForLoadBalancerInput"}
if s.AvailabilityZones == nil {
invalidParams.Add(request.NewErrParamRequired("AvailabilityZones"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableAvailabilityZonesForLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@ -2026,6 +2447,43 @@ func (s HealthCheck) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *HealthCheck) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "HealthCheck"}
if s.HealthyThreshold == nil {
invalidParams.Add(request.NewErrParamRequired("HealthyThreshold"))
}
if s.HealthyThreshold != nil && *s.HealthyThreshold < 2 {
invalidParams.Add(request.NewErrParamMinValue("HealthyThreshold", 2))
}
if s.Interval == nil {
invalidParams.Add(request.NewErrParamRequired("Interval"))
}
if s.Interval != nil && *s.Interval < 1 {
invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
}
if s.Target == nil {
invalidParams.Add(request.NewErrParamRequired("Target"))
}
if s.Timeout == nil {
invalidParams.Add(request.NewErrParamRequired("Timeout"))
}
if s.Timeout != nil && *s.Timeout < 1 {
invalidParams.Add(request.NewErrParamMinValue("Timeout", 1))
}
if s.UnhealthyThreshold == nil {
invalidParams.Add(request.NewErrParamRequired("UnhealthyThreshold"))
}
if s.UnhealthyThreshold != nil && *s.UnhealthyThreshold < 2 {
invalidParams.Add(request.NewErrParamMinValue("UnhealthyThreshold", 2))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The ID of a back-end instance.
type Instance struct {
_ struct{} `type:"structure"`
@ -2175,6 +2633,28 @@ func (s Listener) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Listener) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Listener"}
if s.InstancePort == nil {
invalidParams.Add(request.NewErrParamRequired("InstancePort"))
}
if s.InstancePort != nil && *s.InstancePort < 1 {
invalidParams.Add(request.NewErrParamMinValue("InstancePort", 1))
}
if s.LoadBalancerPort == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort"))
}
if s.Protocol == nil {
invalidParams.Add(request.NewErrParamRequired("Protocol"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The policies enabled for a listener.
type ListenerDescription struct {
_ struct{} `type:"structure"`
@ -2249,6 +2729,36 @@ func (s LoadBalancerAttributes) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *LoadBalancerAttributes) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "LoadBalancerAttributes"}
if s.AccessLog != nil {
if err := s.AccessLog.Validate(); err != nil {
invalidParams.AddNested("AccessLog", err.(request.ErrInvalidParams))
}
}
if s.ConnectionDraining != nil {
if err := s.ConnectionDraining.Validate(); err != nil {
invalidParams.AddNested("ConnectionDraining", err.(request.ErrInvalidParams))
}
}
if s.ConnectionSettings != nil {
if err := s.ConnectionSettings.Validate(); err != nil {
invalidParams.AddNested("ConnectionSettings", err.(request.ErrInvalidParams))
}
}
if s.CrossZoneLoadBalancing != nil {
if err := s.CrossZoneLoadBalancing.Validate(); err != nil {
invalidParams.AddNested("CrossZoneLoadBalancing", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Information about a load balancer.
type LoadBalancerDescription struct {
_ struct{} `type:"structure"`
@ -2346,6 +2856,27 @@ func (s ModifyLoadBalancerAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyLoadBalancerAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyLoadBalancerAttributesInput"}
if s.LoadBalancerAttributes == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerAttributes"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.LoadBalancerAttributes != nil {
if err := s.LoadBalancerAttributes.Validate(); err != nil {
invalidParams.AddNested("LoadBalancerAttributes", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyLoadBalancerAttributesOutput struct {
_ struct{} `type:"structure"`
@ -2537,6 +3068,22 @@ func (s RegisterInstancesWithLoadBalancerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RegisterInstancesWithLoadBalancerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RegisterInstancesWithLoadBalancerInput"}
if s.Instances == nil {
invalidParams.Add(request.NewErrParamRequired("Instances"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RegisterInstancesWithLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@ -2575,6 +3122,35 @@ func (s RemoveTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"}
if s.LoadBalancerNames == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerNames"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if s.Tags != nil && len(s.Tags) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
}
if s.Tags != nil {
for i, v := range s.Tags {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemoveTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -2612,6 +3188,25 @@ func (s SetLoadBalancerListenerSSLCertificateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetLoadBalancerListenerSSLCertificateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerListenerSSLCertificateInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.LoadBalancerPort == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort"))
}
if s.SSLCertificateId == nil {
invalidParams.Add(request.NewErrParamRequired("SSLCertificateId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetLoadBalancerListenerSSLCertificateOutput struct {
_ struct{} `type:"structure"`
}
@ -2650,6 +3245,25 @@ func (s SetLoadBalancerPoliciesForBackendServerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetLoadBalancerPoliciesForBackendServerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesForBackendServerInput"}
if s.InstancePort == nil {
invalidParams.Add(request.NewErrParamRequired("InstancePort"))
}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.PolicyNames == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetLoadBalancerPoliciesForBackendServerOutput struct {
_ struct{} `type:"structure"`
}
@ -2688,6 +3302,25 @@ func (s SetLoadBalancerPoliciesOfListenerInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetLoadBalancerPoliciesOfListenerInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetLoadBalancerPoliciesOfListenerInput"}
if s.LoadBalancerName == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerName"))
}
if s.LoadBalancerPort == nil {
invalidParams.Add(request.NewErrParamRequired("LoadBalancerPort"))
}
if s.PolicyNames == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetLoadBalancerPoliciesOfListenerOutput struct {
_ struct{} `type:"structure"`
}
@ -2744,6 +3377,22 @@ func (s Tag) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Tag) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "Tag"}
if s.Key == nil {
invalidParams.Add(request.NewErrParamRequired("Key"))
}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Key", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The tags associated with a load balancer.
type TagDescription struct {
_ struct{} `type:"structure"`
@ -2782,3 +3431,16 @@ func (s TagKeyOnly) String() string {
func (s TagKeyOnly) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *TagKeyOnly) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TagKeyOnly"}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Key", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,8 @@ import (
)
// Amazon Kinesis Firehose is a fully-managed service that delivers real-time
// streaming data to destinations such as Amazon S3 and Amazon Redshift.
// streaming data to destinations such as Amazon Simple Storage Service (Amazon
// S3), Amazon Elasticsearch Service (Amazon ES), and Amazon Redshift.
//The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
type Firehose struct {

View File

@ -1682,6 +1682,25 @@ func (s AbortMultipartUploadInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AbortMultipartUploadInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AbortMultipartUploadInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AbortMultipartUploadOutput struct {
_ struct{} `type:"structure"`
}
@ -1722,6 +1741,22 @@ func (s AbortVaultLockInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AbortVaultLockInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AbortVaultLockInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AbortVaultLockOutput struct {
_ struct{} `type:"structure"`
}
@ -1765,6 +1800,22 @@ func (s AddTagsToVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsToVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddTagsToVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsToVaultOutput struct {
_ struct{} `type:"structure"`
}
@ -1849,6 +1900,25 @@ func (s CompleteMultipartUploadInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CompleteMultipartUploadInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartUploadInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The input values for CompleteVaultLock.
type CompleteVaultLockInput struct {
_ struct{} `type:"structure"`
@ -1878,6 +1948,25 @@ func (s CompleteVaultLockInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CompleteVaultLockInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CompleteVaultLockInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.LockId == nil {
invalidParams.Add(request.NewErrParamRequired("LockId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CompleteVaultLockOutput struct {
_ struct{} `type:"structure"`
}
@ -1918,6 +2007,22 @@ func (s CreateVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type CreateVaultOutput struct {
_ struct{} `type:"structure"`
@ -2010,6 +2115,25 @@ func (s DeleteArchiveInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteArchiveInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteArchiveInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.ArchiveId == nil {
invalidParams.Add(request.NewErrParamRequired("ArchiveId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteArchiveOutput struct {
_ struct{} `type:"structure"`
}
@ -2049,6 +2173,22 @@ func (s DeleteVaultAccessPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteVaultAccessPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteVaultAccessPolicyInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteVaultAccessPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -2088,6 +2228,22 @@ func (s DeleteVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Provides options for deleting a vault notification configuration from an
// Amazon Glacier vault.
type DeleteVaultNotificationsInput struct {
@ -2114,6 +2270,22 @@ func (s DeleteVaultNotificationsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteVaultNotificationsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteVaultNotificationsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteVaultNotificationsOutput struct {
_ struct{} `type:"structure"`
}
@ -2170,6 +2342,25 @@ func (s DescribeJobInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeJobInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeJobInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.JobId == nil {
invalidParams.Add(request.NewErrParamRequired("JobId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Provides options for retrieving metadata for a specific vault in Amazon Glacier.
type DescribeVaultInput struct {
_ struct{} `type:"structure"`
@ -2195,6 +2386,22 @@ func (s DescribeVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type DescribeVaultOutput struct {
_ struct{} `type:"structure"`
@ -2257,6 +2464,19 @@ func (s GetDataRetrievalPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDataRetrievalPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetDataRetrievalPolicyInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to the GetDataRetrievalPolicy request.
type GetDataRetrievalPolicyOutput struct {
_ struct{} `type:"structure"`
@ -2308,6 +2528,25 @@ func (s GetJobOutputInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetJobOutputInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetJobOutputInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.JobId == nil {
invalidParams.Add(request.NewErrParamRequired("JobId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type GetJobOutputOutput struct {
_ struct{} `type:"structure" payload:"Body"`
@ -2386,6 +2625,22 @@ func (s GetVaultAccessPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetVaultAccessPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetVaultAccessPolicyInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Output for GetVaultAccessPolicy.
type GetVaultAccessPolicyOutput struct {
_ struct{} `type:"structure" payload:"Policy"`
@ -2429,6 +2684,22 @@ func (s GetVaultLockInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetVaultLockInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetVaultLockInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type GetVaultLockOutput struct {
_ struct{} `type:"structure"`
@ -2484,6 +2755,22 @@ func (s GetVaultNotificationsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetVaultNotificationsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetVaultNotificationsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type GetVaultNotificationsOutput struct {
_ struct{} `type:"structure" payload:"VaultNotificationConfig"`
@ -2530,6 +2817,22 @@ func (s InitiateJobInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InitiateJobInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InitiateJobInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type InitiateJobOutput struct {
_ struct{} `type:"structure"`
@ -2588,6 +2891,22 @@ func (s InitiateMultipartUploadInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InitiateMultipartUploadInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InitiateMultipartUploadInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The Amazon Glacier response to your request.
type InitiateMultipartUploadOutput struct {
_ struct{} `type:"structure"`
@ -2639,6 +2958,22 @@ func (s InitiateVaultLockInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InitiateVaultLockInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InitiateVaultLockInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type InitiateVaultLockOutput struct {
_ struct{} `type:"structure"`
@ -2924,6 +3259,22 @@ func (s ListJobsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListJobsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListJobsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type ListJobsOutput struct {
_ struct{} `type:"structure"`
@ -2984,6 +3335,22 @@ func (s ListMultipartUploadsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListMultipartUploadsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListMultipartUploadsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type ListMultipartUploadsOutput struct {
_ struct{} `type:"structure"`
@ -3047,6 +3414,25 @@ func (s ListPartsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListPartsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListPartsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type ListPartsOutput struct {
_ struct{} `type:"structure"`
@ -3112,6 +3498,22 @@ func (s ListTagsForVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListTagsForVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListTagsForVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type ListTagsForVaultOutput struct {
_ struct{} `type:"structure"`
@ -3162,6 +3564,19 @@ func (s ListVaultsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListVaultsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListVaultsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type ListVaultsOutput struct {
_ struct{} `type:"structure"`
@ -3234,6 +3649,22 @@ func (s RemoveTagsFromVaultInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemoveTagsFromVaultInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromVaultInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemoveTagsFromVaultOutput struct {
_ struct{} `type:"structure"`
}
@ -3274,6 +3705,19 @@ func (s SetDataRetrievalPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetDataRetrievalPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetDataRetrievalPolicyInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetDataRetrievalPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -3316,6 +3760,22 @@ func (s SetVaultAccessPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetVaultAccessPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetVaultAccessPolicyInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetVaultAccessPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -3359,6 +3819,22 @@ func (s SetVaultNotificationsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetVaultNotificationsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetVaultNotificationsInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetVaultNotificationsOutput struct {
_ struct{} `type:"structure"`
}
@ -3407,6 +3883,22 @@ func (s UploadArchiveInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UploadArchiveInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UploadArchiveInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A list of in-progress multipart uploads for a vault.
type UploadListElement struct {
_ struct{} `type:"structure"`
@ -3480,6 +3972,25 @@ func (s UploadMultipartPartInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UploadMultipartPartInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UploadMultipartPartInput"}
if s.AccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AccountId"))
}
if s.UploadId == nil {
invalidParams.Add(request.NewErrParamRequired("UploadId"))
}
if s.VaultName == nil {
invalidParams.Add(request.NewErrParamRequired("VaultName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the Amazon Glacier response to your request.
type UploadMultipartPartOutput struct {
_ struct{} `type:"structure"`

View File

@ -37,20 +37,16 @@ func addAccountID(r *request.Request) {
}
func addChecksum(r *request.Request) {
if r.Body == nil {
if r.Body == nil || r.HTTPRequest.Header.Get("X-Amz-Sha256-Tree-Hash") != "" {
return
}
h := ComputeHashes(r.Body)
hstr := hex.EncodeToString(h.TreeHash)
r.HTTPRequest.Header.Set("X-Amz-Sha256-Tree-Hash", hstr)
if r.HTTPRequest.Header.Get("X-Amz-Content-Sha256") == "" {
hstr := hex.EncodeToString(h.LinearHash)
r.HTTPRequest.Header.Set("X-Amz-Content-Sha256", hstr)
}
if r.HTTPRequest.Header.Get("X-Amz-Sha256-Tree-Hash") == "" {
hstr := hex.EncodeToString(h.TreeHash)
r.HTTPRequest.Header.Set("X-Amz-Sha256-Tree-Hash", hstr)
}
hLstr := hex.EncodeToString(h.LinearHash)
r.HTTPRequest.Header.Set("X-Amz-Content-Sha256", hLstr)
}
func addAPIVersion(r *request.Request) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,8 @@ import (
"github.com/aws/aws-sdk-go/private/signer/v4"
)
// Amazon Kinesis is a managed service that scales elastically for real time
// processing of streaming big data.
// Amazon Kinesis Streams is a managed service that scales elastically for real
// time processing of streaming big data.
//The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
type Kinesis struct {

View File

@ -1063,6 +1063,22 @@ func (s CancelKeyDeletionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CancelKeyDeletionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CancelKeyDeletionOutput struct {
_ struct{} `type:"structure"`
@ -1105,6 +1121,28 @@ func (s CreateAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"}
if s.AliasName == nil {
invalidParams.Add(request.NewErrParamRequired("AliasName"))
}
if s.AliasName != nil && len(*s.AliasName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
}
if s.TargetKeyId == nil {
invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
}
if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateAliasOutput struct {
_ struct{} `type:"structure"`
}
@ -1196,6 +1234,34 @@ func (s CreateGrantInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateGrantInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"}
if s.GranteePrincipal == nil {
invalidParams.Add(request.NewErrParamRequired("GranteePrincipal"))
}
if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 {
invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1))
}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateGrantOutput struct {
_ struct{} `type:"structure"`
@ -1247,6 +1313,19 @@ func (s CreateKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"}
if s.Policy != nil && len(*s.Policy) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateKeyOutput struct {
_ struct{} `type:"structure"`
@ -1294,6 +1373,22 @@ func (s DecryptInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DecryptInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DecryptInput"}
if s.CiphertextBlob == nil {
invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
}
if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DecryptOutput struct {
_ struct{} `type:"structure"`
@ -1336,6 +1431,22 @@ func (s DeleteAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"}
if s.AliasName == nil {
invalidParams.Add(request.NewErrParamRequired("AliasName"))
}
if s.AliasName != nil && len(*s.AliasName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteAliasOutput struct {
_ struct{} `type:"structure"`
}
@ -1378,6 +1489,22 @@ func (s DescribeKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeKeyOutput struct {
_ struct{} `type:"structure"`
@ -1415,6 +1542,22 @@ func (s DisableKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableKeyOutput struct {
_ struct{} `type:"structure"`
}
@ -1449,6 +1592,22 @@ func (s DisableKeyRotationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableKeyRotationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableKeyRotationOutput struct {
_ struct{} `type:"structure"`
}
@ -1483,6 +1642,22 @@ func (s EnableKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableKeyOutput struct {
_ struct{} `type:"structure"`
}
@ -1517,6 +1692,22 @@ func (s EnableKeyRotationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableKeyRotationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableKeyRotationOutput struct {
_ struct{} `type:"structure"`
}
@ -1570,6 +1761,28 @@ func (s EncryptInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EncryptInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EncryptInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.Plaintext == nil {
invalidParams.Add(request.NewErrParamRequired("Plaintext"))
}
if s.Plaintext != nil && len(s.Plaintext) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EncryptOutput struct {
_ struct{} `type:"structure"`
@ -1635,6 +1848,25 @@ func (s GenerateDataKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GenerateDataKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GenerateDataKeyOutput struct {
_ struct{} `type:"structure"`
@ -1712,6 +1944,25 @@ func (s GenerateDataKeyWithoutPlaintextInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GenerateDataKeyWithoutPlaintextOutput struct {
_ struct{} `type:"structure"`
@ -1757,6 +2008,19 @@ func (s GenerateRandomInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GenerateRandomInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"}
if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GenerateRandomOutput struct {
_ struct{} `type:"structure"`
@ -1800,6 +2064,28 @@ func (s GetKeyPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetKeyPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if s.PolicyName != nil && len(*s.PolicyName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetKeyPolicyOutput struct {
_ struct{} `type:"structure"`
@ -1837,6 +2123,22 @@ func (s GetKeyRotationStatusInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetKeyRotationStatusInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetKeyRotationStatusOutput struct {
_ struct{} `type:"structure"`
@ -2022,8 +2324,8 @@ type ListAliasesInput struct {
Limit *int64 `min:"1" type:"integer"`
// Use this parameter only when paginating results and only in a subsequent
// request after you've received a response with truncated results. Set it to
// the value of NextMarker from the response you just received.
// request after you receive a response with truncated results. Set it to the
// value of NextMarker from the response you just received.
Marker *string `min:"1" type:"string"`
}
@ -2037,6 +2339,22 @@ func (s ListAliasesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListAliasesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.Marker != nil && len(*s.Marker) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListAliasesOutput struct {
_ struct{} `type:"structure"`
@ -2081,8 +2399,8 @@ type ListGrantsInput struct {
Limit *int64 `min:"1" type:"integer"`
// Use this parameter only when paginating results and only in a subsequent
// request after you've received a response with truncated results. Set it to
// the value of NextMarker from the response you just received.
// request after you receive a response with truncated results. Set it to the
// value of NextMarker from the response you just received.
Marker *string `min:"1" type:"string"`
}
@ -2096,6 +2414,28 @@ func (s ListGrantsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListGrantsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.Marker != nil && len(*s.Marker) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListGrantsResponse struct {
_ struct{} `type:"structure"`
@ -2144,8 +2484,8 @@ type ListKeyPoliciesInput struct {
Limit *int64 `min:"1" type:"integer"`
// Use this parameter only when paginating results and only in a subsequent
// request after you've received a response with truncated results. Set it to
// the value of NextMarker from the response you just received.
// request after you receive a response with truncated results. Set it to the
// value of NextMarker from the response you just received.
Marker *string `min:"1" type:"string"`
}
@ -2159,6 +2499,28 @@ func (s ListKeyPoliciesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListKeyPoliciesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.Marker != nil && len(*s.Marker) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListKeyPoliciesOutput struct {
_ struct{} `type:"structure"`
@ -2198,8 +2560,8 @@ type ListKeysInput struct {
Limit *int64 `min:"1" type:"integer"`
// Use this parameter only when paginating results and only in a subsequent
// request after you've received a response with truncated results. Set it to
// the value of NextMarker from the response you just received.
// request after you receive a response with truncated results. Set it to the
// value of NextMarker from the response you just received.
Marker *string `min:"1" type:"string"`
}
@ -2213,6 +2575,22 @@ func (s ListKeysInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListKeysInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.Marker != nil && len(*s.Marker) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListKeysOutput struct {
_ struct{} `type:"structure"`
@ -2251,8 +2629,8 @@ type ListRetirableGrantsInput struct {
Limit *int64 `min:"1" type:"integer"`
// Use this parameter only when paginating results and only in a subsequent
// request after you've received a response with truncated results. Set it to
// the value of NextMarker from the response you just received.
// request after you receive a response with truncated results. Set it to the
// value of NextMarker from the response you just received.
Marker *string `min:"1" type:"string"`
// The retiring principal for which to list grants.
@ -2276,6 +2654,28 @@ func (s ListRetirableGrantsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListRetirableGrantsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"}
if s.Limit != nil && *s.Limit < 1 {
invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
}
if s.Marker != nil && len(*s.Marker) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
}
if s.RetiringPrincipal == nil {
invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal"))
}
if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutKeyPolicyInput struct {
_ struct{} `type:"structure"`
@ -2305,6 +2705,34 @@ func (s PutKeyPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PutKeyPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.Policy == nil {
invalidParams.Add(request.NewErrParamRequired("Policy"))
}
if s.Policy != nil && len(*s.Policy) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
}
if s.PolicyName == nil {
invalidParams.Add(request.NewErrParamRequired("PolicyName"))
}
if s.PolicyName != nil && len(*s.PolicyName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PutKeyPolicyOutput struct {
_ struct{} `type:"structure"`
}
@ -2360,6 +2788,28 @@ func (s ReEncryptInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ReEncryptInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"}
if s.CiphertextBlob == nil {
invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
}
if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
}
if s.DestinationKeyId == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationKeyId"))
}
if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ReEncryptOutput struct {
_ struct{} `type:"structure"`
@ -2413,6 +2863,25 @@ func (s RetireGrantInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RetireGrantInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"}
if s.GrantId != nil && len(*s.GrantId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
}
if s.GrantToken != nil && len(*s.GrantToken) < 1 {
invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RetireGrantOutput struct {
_ struct{} `type:"structure"`
}
@ -2450,6 +2919,28 @@ func (s RevokeGrantInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RevokeGrantInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"}
if s.GrantId == nil {
invalidParams.Add(request.NewErrParamRequired("GrantId"))
}
if s.GrantId != nil && len(*s.GrantId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RevokeGrantOutput struct {
_ struct{} `type:"structure"`
}
@ -2496,6 +2987,25 @@ func (s ScheduleKeyDeletionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ScheduleKeyDeletionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 {
invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ScheduleKeyDeletionOutput struct {
_ struct{} `type:"structure"`
@ -2545,6 +3055,28 @@ func (s UpdateAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"}
if s.AliasName == nil {
invalidParams.Add(request.NewErrParamRequired("AliasName"))
}
if s.AliasName != nil && len(*s.AliasName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
}
if s.TargetKeyId == nil {
invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
}
if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateAliasOutput struct {
_ struct{} `type:"structure"`
}
@ -2582,6 +3114,25 @@ func (s UpdateKeyDescriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateKeyDescriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if s.KeyId == nil {
invalidParams.Add(request.NewErrParamRequired("KeyId"))
}
if s.KeyId != nil && len(*s.KeyId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateKeyDescriptionOutput struct {
_ struct{} `type:"structure"`
}

View File

@ -911,6 +911,8 @@ type AddPermissionInput struct {
// permission for all AWS Lambda actions.
Action *string `type:"string" required:"true"`
EventSourceToken *string `type:"string"`
// Name of the Lambda function whose resource policy you are updating by adding
// a new permission.
//
@ -981,6 +983,37 @@ func (s AddPermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddPermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
if s.Action == nil {
invalidParams.Add(request.NewErrParamRequired("Action"))
}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Principal == nil {
invalidParams.Add(request.NewErrParamRequired("Principal"))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddPermissionOutput struct {
_ struct{} `type:"structure"`
@ -1055,6 +1088,34 @@ func (s CreateAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.FunctionVersion == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionVersion"))
}
if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateEventSourceMappingInput struct {
_ struct{} `type:"structure"`
@ -1107,6 +1168,31 @@ func (s CreateEventSourceMappingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateEventSourceMappingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateEventSourceMappingInput"}
if s.BatchSize != nil && *s.BatchSize < 1 {
invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1))
}
if s.EventSourceArn == nil {
invalidParams.Add(request.NewErrParamRequired("EventSourceArn"))
}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.StartingPosition == nil {
invalidParams.Add(request.NewErrParamRequired("StartingPosition"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateFunctionInput struct {
_ struct{} `type:"structure"`
@ -1170,6 +1256,45 @@ func (s CreateFunctionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateFunctionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateFunctionInput"}
if s.Code == nil {
invalidParams.Add(request.NewErrParamRequired("Code"))
}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Handler == nil {
invalidParams.Add(request.NewErrParamRequired("Handler"))
}
if s.MemorySize != nil && *s.MemorySize < 128 {
invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128))
}
if s.Role == nil {
invalidParams.Add(request.NewErrParamRequired("Role"))
}
if s.Runtime == nil {
invalidParams.Add(request.NewErrParamRequired("Runtime"))
}
if s.Timeout != nil && *s.Timeout < 1 {
invalidParams.Add(request.NewErrParamMinValue("Timeout", 1))
}
if s.Code != nil {
if err := s.Code.Validate(); err != nil {
invalidParams.AddNested("Code", err.(request.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteAliasInput struct {
_ struct{} `type:"structure"`
@ -1191,6 +1316,28 @@ func (s DeleteAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteAliasOutput struct {
_ struct{} `type:"structure"`
}
@ -1222,6 +1369,19 @@ func (s DeleteEventSourceMappingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteEventSourceMappingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteEventSourceMappingInput"}
if s.UUID == nil {
invalidParams.Add(request.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteFunctionInput struct {
_ struct{} `type:"structure"`
@ -1263,6 +1423,25 @@ func (s DeleteFunctionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteFunctionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteFunctionInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteFunctionOutput struct {
_ struct{} `type:"structure"`
}
@ -1356,6 +1535,25 @@ func (s FunctionCode) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *FunctionCode) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "FunctionCode"}
if s.S3Bucket != nil && len(*s.S3Bucket) < 3 {
invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3))
}
if s.S3Key != nil && len(*s.S3Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("S3Key", 1))
}
if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 {
invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The object for the Lambda function location.
type FunctionCodeLocation struct {
_ struct{} `type:"structure"`
@ -1458,6 +1656,28 @@ func (s GetAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetAliasInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetEventSourceMappingInput struct {
_ struct{} `type:"structure"`
@ -1475,6 +1695,19 @@ func (s GetEventSourceMappingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetEventSourceMappingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetEventSourceMappingInput"}
if s.UUID == nil {
invalidParams.Add(request.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetFunctionConfigurationInput struct {
_ struct{} `type:"structure"`
@ -1509,6 +1742,25 @@ func (s GetFunctionConfigurationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetFunctionConfigurationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetFunctionConfigurationInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetFunctionInput struct {
_ struct{} `type:"structure"`
@ -1541,6 +1793,25 @@ func (s GetFunctionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetFunctionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetFunctionInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// This response contains the object for the Lambda function location (see API_FunctionCodeLocation.
type GetFunctionOutput struct {
_ struct{} `type:"structure"`
@ -1594,6 +1865,25 @@ func (s GetPolicyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetPolicyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetPolicyOutput struct {
_ struct{} `type:"structure"`
@ -1633,6 +1923,25 @@ func (s InvokeAsyncInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InvokeAsyncInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InvokeAsyncInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.InvokeArgs == nil {
invalidParams.Add(request.NewErrParamRequired("InvokeArgs"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Upon success, it returns empty response. Otherwise, throws an exception.
type InvokeAsyncOutput struct {
_ struct{} `deprecated:"true" type:"structure"`
@ -1711,6 +2020,25 @@ func (s InvokeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *InvokeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "InvokeInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Upon success, returns an empty response. Otherwise, throws an exception.
type InvokeOutput struct {
_ struct{} `type:"structure" payload:"Payload"`
@ -1783,6 +2111,28 @@ func (s ListAliasesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListAliasesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListAliasesOutput struct {
_ struct{} `type:"structure"`
@ -1841,6 +2191,22 @@ func (s ListEventSourceMappingsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListEventSourceMappingsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListEventSourceMappingsInput"}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains a list of event sources (see API_EventSourceMappingConfiguration)
type ListEventSourceMappingsOutput struct {
_ struct{} `type:"structure"`
@ -1884,6 +2250,19 @@ func (s ListFunctionsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListFunctionsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListFunctionsInput"}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains a list of AWS Lambda function configurations (see FunctionConfiguration.
type ListFunctionsOutput struct {
_ struct{} `type:"structure"`
@ -1935,6 +2314,25 @@ func (s ListVersionsByFunctionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListVersionsByFunctionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListVersionsByFunctionInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.MaxItems != nil && *s.MaxItems < 1 {
invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ListVersionsByFunctionOutput struct {
_ struct{} `type:"structure"`
@ -1987,6 +2385,22 @@ func (s PublishVersionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PublishVersionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PublishVersionInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemovePermissionInput struct {
_ struct{} `type:"structure"`
@ -2019,6 +2433,31 @@ func (s RemovePermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemovePermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.Qualifier != nil && len(*s.Qualifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1))
}
if s.StatementId == nil {
invalidParams.Add(request.NewErrParamRequired("StatementId"))
}
if s.StatementId != nil && len(*s.StatementId) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StatementId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemovePermissionOutput struct {
_ struct{} `type:"structure"`
}
@ -2060,6 +2499,31 @@ func (s UpdateAliasInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateAliasInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.FunctionVersion != nil && len(*s.FunctionVersion) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionVersion", 1))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Name", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateEventSourceMappingInput struct {
_ struct{} `type:"structure"`
@ -2100,6 +2564,25 @@ func (s UpdateEventSourceMappingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateEventSourceMappingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateEventSourceMappingInput"}
if s.BatchSize != nil && *s.BatchSize < 1 {
invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.UUID == nil {
invalidParams.Add(request.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateFunctionCodeInput struct {
_ struct{} `type:"structure"`
@ -2143,6 +2626,31 @@ func (s UpdateFunctionCodeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateFunctionCodeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionCodeInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.S3Bucket != nil && len(*s.S3Bucket) < 3 {
invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3))
}
if s.S3Key != nil && len(*s.S3Key) < 1 {
invalidParams.Add(request.NewErrParamMinLen("S3Key", 1))
}
if s.S3ObjectVersion != nil && len(*s.S3ObjectVersion) < 1 {
invalidParams.Add(request.NewErrParamMinLen("S3ObjectVersion", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UpdateFunctionConfigurationInput struct {
_ struct{} `type:"structure"`
@ -2175,6 +2683,8 @@ type UpdateFunctionConfigurationInput struct {
// it executes your function.
Role *string `type:"string"`
Runtime *string `type:"string" enum:"Runtime"`
// The function execution time at which AWS Lambda should terminate the function.
// Because the execution time has cost implications, we recommend you set this
// value based on your expected execution time. The default is 3 seconds.
@ -2197,6 +2707,28 @@ func (s UpdateFunctionConfigurationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateFunctionConfigurationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionConfigurationInput"}
if s.FunctionName == nil {
invalidParams.Add(request.NewErrParamRequired("FunctionName"))
}
if s.FunctionName != nil && len(*s.FunctionName) < 1 {
invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1))
}
if s.MemorySize != nil && *s.MemorySize < 128 {
invalidParams.Add(request.NewErrParamMinValue("MemorySize", 128))
}
if s.Timeout != nil && *s.Timeout < 1 {
invalidParams.Add(request.NewErrParamMinValue("Timeout", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// If your Lambda function accesses resources in a VPC, you provide this parameter
// identifying the list of security group IDs and subnet IDs. These must belong
// to the same VPC. You must provide at least one security group and one subnet
@ -2272,6 +2804,8 @@ const (
// @enum Runtime
RuntimeNodejs = "nodejs"
// @enum Runtime
RuntimeNodejs43 = "nodejs4.3"
// @enum Runtime
RuntimeJava8 = "java8"
// @enum Runtime
RuntimePython27 = "python2.7"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2365,6 +2365,19 @@ func (s AuthorizeClusterSecurityGroupIngressInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AuthorizeClusterSecurityGroupIngressInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AuthorizeClusterSecurityGroupIngressInput"}
if s.ClusterSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AuthorizeClusterSecurityGroupIngressOutput struct {
_ struct{} `type:"structure"`
@ -2408,6 +2421,22 @@ func (s AuthorizeSnapshotAccessInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AuthorizeSnapshotAccessInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AuthorizeSnapshotAccessInput"}
if s.AccountWithRestoreAccess == nil {
invalidParams.Add(request.NewErrParamRequired("AccountWithRestoreAccess"))
}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AuthorizeSnapshotAccessOutput struct {
_ struct{} `type:"structure"`
@ -2925,6 +2954,22 @@ func (s CopyClusterSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CopyClusterSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CopyClusterSnapshotInput"}
if s.SourceSnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SourceSnapshotIdentifier"))
}
if s.TargetSnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("TargetSnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CopyClusterSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -3180,6 +3225,28 @@ func (s CreateClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.MasterUserPassword == nil {
invalidParams.Add(request.NewErrParamRequired("MasterUserPassword"))
}
if s.MasterUsername == nil {
invalidParams.Add(request.NewErrParamRequired("MasterUsername"))
}
if s.NodeType == nil {
invalidParams.Add(request.NewErrParamRequired("NodeType"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateClusterOutput struct {
_ struct{} `type:"structure"`
@ -3238,6 +3305,25 @@ func (s CreateClusterParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateClusterParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateClusterParameterGroupInput"}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if s.ParameterGroupFamily == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupFamily"))
}
if s.ParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateClusterParameterGroupOutput struct {
_ struct{} `type:"structure"`
@ -3285,6 +3371,22 @@ func (s CreateClusterSecurityGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateClusterSecurityGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateClusterSecurityGroupInput"}
if s.ClusterSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName"))
}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateClusterSecurityGroupOutput struct {
_ struct{} `type:"structure"`
@ -3332,6 +3434,22 @@ func (s CreateClusterSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateClusterSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateClusterSnapshotInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateClusterSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -3383,6 +3501,25 @@ func (s CreateClusterSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateClusterSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateClusterSubnetGroupInput"}
if s.ClusterSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName"))
}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if s.SubnetIds == nil {
invalidParams.Add(request.NewErrParamRequired("SubnetIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateClusterSubnetGroupOutput struct {
_ struct{} `type:"structure"`
@ -3468,6 +3605,22 @@ func (s CreateEventSubscriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateEventSubscriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateEventSubscriptionInput"}
if s.SnsTopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("SnsTopicArn"))
}
if s.SubscriptionName == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateEventSubscriptionOutput struct {
_ struct{} `type:"structure"`
@ -3506,6 +3659,19 @@ func (s CreateHsmClientCertificateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateHsmClientCertificateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateHsmClientCertificateInput"}
if s.HsmClientCertificateIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("HsmClientCertificateIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateHsmClientCertificateOutput struct {
_ struct{} `type:"structure"`
@ -3562,6 +3728,34 @@ func (s CreateHsmConfigurationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateHsmConfigurationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateHsmConfigurationInput"}
if s.Description == nil {
invalidParams.Add(request.NewErrParamRequired("Description"))
}
if s.HsmConfigurationIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("HsmConfigurationIdentifier"))
}
if s.HsmIpAddress == nil {
invalidParams.Add(request.NewErrParamRequired("HsmIpAddress"))
}
if s.HsmPartitionName == nil {
invalidParams.Add(request.NewErrParamRequired("HsmPartitionName"))
}
if s.HsmPartitionPassword == nil {
invalidParams.Add(request.NewErrParamRequired("HsmPartitionPassword"))
}
if s.HsmServerPublicCertificate == nil {
invalidParams.Add(request.NewErrParamRequired("HsmServerPublicCertificate"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateHsmConfigurationOutput struct {
_ struct{} `type:"structure"`
@ -3614,6 +3808,19 @@ func (s CreateSnapshotCopyGrantInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateSnapshotCopyGrantInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotCopyGrantInput"}
if s.SnapshotCopyGrantName == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotCopyGrantName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateSnapshotCopyGrantOutput struct {
_ struct{} `type:"structure"`
@ -3663,6 +3870,22 @@ func (s CreateTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateTagsInput"}
if s.ResourceName == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceName"))
}
if s.Tags == nil {
invalidParams.Add(request.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type CreateTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -3747,6 +3970,19 @@ func (s DeleteClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterOutput struct {
_ struct{} `type:"structure"`
@ -3786,6 +4022,19 @@ func (s DeleteClusterParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterParameterGroupInput"}
if s.ParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterParameterGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -3817,6 +4066,19 @@ func (s DeleteClusterSecurityGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterSecurityGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSecurityGroupInput"}
if s.ClusterSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterSecurityGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -3858,6 +4120,19 @@ func (s DeleteClusterSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSnapshotInput"}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -3892,6 +4167,19 @@ func (s DeleteClusterSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteClusterSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSubnetGroupInput"}
if s.ClusterSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteClusterSubnetGroupOutput struct {
_ struct{} `type:"structure"`
}
@ -3923,6 +4211,19 @@ func (s DeleteEventSubscriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteEventSubscriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteEventSubscriptionInput"}
if s.SubscriptionName == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteEventSubscriptionOutput struct {
_ struct{} `type:"structure"`
}
@ -3954,6 +4255,19 @@ func (s DeleteHsmClientCertificateInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteHsmClientCertificateInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteHsmClientCertificateInput"}
if s.HsmClientCertificateIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("HsmClientCertificateIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteHsmClientCertificateOutput struct {
_ struct{} `type:"structure"`
}
@ -3985,6 +4299,19 @@ func (s DeleteHsmConfigurationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteHsmConfigurationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteHsmConfigurationInput"}
if s.HsmConfigurationIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("HsmConfigurationIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteHsmConfigurationOutput struct {
_ struct{} `type:"structure"`
}
@ -4017,6 +4344,19 @@ func (s DeleteSnapshotCopyGrantInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteSnapshotCopyGrantInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotCopyGrantInput"}
if s.SnapshotCopyGrantName == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotCopyGrantName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteSnapshotCopyGrantOutput struct {
_ struct{} `type:"structure"`
}
@ -4053,6 +4393,22 @@ func (s DeleteTagsInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteTagsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"}
if s.ResourceName == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceName"))
}
if s.TagKeys == nil {
invalidParams.Add(request.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteTagsOutput struct {
_ struct{} `type:"structure"`
}
@ -4189,6 +4545,19 @@ func (s DescribeClusterParametersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeClusterParametersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeClusterParametersInput"}
if s.ParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Contains the output from the DescribeClusterParameters action.
type DescribeClusterParametersOutput struct {
_ struct{} `type:"structure"`
@ -4663,6 +5032,19 @@ func (s DescribeDefaultClusterParametersInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeDefaultClusterParametersInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeDefaultClusterParametersInput"}
if s.ParameterGroupFamily == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupFamily"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeDefaultClusterParametersOutput struct {
_ struct{} `type:"structure"`
@ -5054,6 +5436,19 @@ func (s DescribeLoggingStatusInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeLoggingStatusInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeLoggingStatusInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DescribeOrderableClusterOptionsInput struct {
_ struct{} `type:"structure"`
@ -5262,6 +5657,19 @@ func (s DescribeResizeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeResizeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeResizeInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Describes the result of a cluster resize operation.
type DescribeResizeOutput struct {
_ struct{} `type:"structure"`
@ -5572,6 +5980,19 @@ func (s DisableLoggingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableLoggingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableLoggingInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableSnapshotCopyInput struct {
_ struct{} `type:"structure"`
@ -5593,6 +6014,19 @@ func (s DisableSnapshotCopyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DisableSnapshotCopyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DisableSnapshotCopyInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DisableSnapshotCopyOutput struct {
_ struct{} `type:"structure"`
@ -5695,6 +6129,22 @@ func (s EnableLoggingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableLoggingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableLoggingInput"}
if s.BucketName == nil {
invalidParams.Add(request.NewErrParamRequired("BucketName"))
}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableSnapshotCopyInput struct {
_ struct{} `type:"structure"`
@ -5734,6 +6184,22 @@ func (s EnableSnapshotCopyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *EnableSnapshotCopyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "EnableSnapshotCopyInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.DestinationRegion == nil {
invalidParams.Add(request.NewErrParamRequired("DestinationRegion"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type EnableSnapshotCopyOutput struct {
_ struct{} `type:"structure"`
@ -6102,6 +6568,19 @@ func (s ModifyClusterIamRolesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyClusterIamRolesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyClusterIamRolesInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyClusterIamRolesOutput struct {
_ struct{} `type:"structure"`
@ -6300,6 +6779,19 @@ func (s ModifyClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyClusterInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyClusterOutput struct {
_ struct{} `type:"structure"`
@ -6344,6 +6836,22 @@ func (s ModifyClusterParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyClusterParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyClusterParameterGroupInput"}
if s.ParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupName"))
}
if s.Parameters == nil {
invalidParams.Add(request.NewErrParamRequired("Parameters"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyClusterSubnetGroupInput struct {
_ struct{} `type:"structure"`
@ -6368,6 +6876,22 @@ func (s ModifyClusterSubnetGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyClusterSubnetGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyClusterSubnetGroupInput"}
if s.ClusterSubnetGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSubnetGroupName"))
}
if s.SubnetIds == nil {
invalidParams.Add(request.NewErrParamRequired("SubnetIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyClusterSubnetGroupOutput struct {
_ struct{} `type:"structure"`
@ -6443,6 +6967,19 @@ func (s ModifyEventSubscriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyEventSubscriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyEventSubscriptionInput"}
if s.SubscriptionName == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifyEventSubscriptionOutput struct {
_ struct{} `type:"structure"`
@ -6492,6 +7029,22 @@ func (s ModifySnapshotCopyRetentionPeriodInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifySnapshotCopyRetentionPeriodInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifySnapshotCopyRetentionPeriodInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.RetentionPeriod == nil {
invalidParams.Add(request.NewErrParamRequired("RetentionPeriod"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ModifySnapshotCopyRetentionPeriodOutput struct {
_ struct{} `type:"structure"`
@ -6647,6 +7200,19 @@ func (s PurchaseReservedNodeOfferingInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PurchaseReservedNodeOfferingInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedNodeOfferingInput"}
if s.ReservedNodeOfferingId == nil {
invalidParams.Add(request.NewErrParamRequired("ReservedNodeOfferingId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PurchaseReservedNodeOfferingOutput struct {
_ struct{} `type:"structure"`
@ -6682,6 +7248,19 @@ func (s RebootClusterInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RebootClusterInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RebootClusterInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RebootClusterOutput struct {
_ struct{} `type:"structure"`
@ -6855,6 +7434,19 @@ func (s ResetClusterParameterGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ResetClusterParameterGroupInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ResetClusterParameterGroupInput"}
if s.ParameterGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ParameterGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RestoreFromClusterSnapshotInput struct {
_ struct{} `type:"structure"`
@ -7015,6 +7607,22 @@ func (s RestoreFromClusterSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RestoreFromClusterSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RestoreFromClusterSnapshotInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RestoreFromClusterSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -7111,6 +7719,31 @@ func (s RestoreTableFromClusterSnapshotInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RestoreTableFromClusterSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RestoreTableFromClusterSnapshotInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if s.NewTableName == nil {
invalidParams.Add(request.NewErrParamRequired("NewTableName"))
}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if s.SourceDatabaseName == nil {
invalidParams.Add(request.NewErrParamRequired("SourceDatabaseName"))
}
if s.SourceTableName == nil {
invalidParams.Add(request.NewErrParamRequired("SourceTableName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RestoreTableFromClusterSnapshotOutput struct {
_ struct{} `type:"structure"`
@ -7163,6 +7796,19 @@ func (s RevokeClusterSecurityGroupIngressInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RevokeClusterSecurityGroupIngressInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RevokeClusterSecurityGroupIngressInput"}
if s.ClusterSecurityGroupName == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterSecurityGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RevokeClusterSecurityGroupIngressOutput struct {
_ struct{} `type:"structure"`
@ -7206,6 +7852,22 @@ func (s RevokeSnapshotAccessInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RevokeSnapshotAccessInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RevokeSnapshotAccessInput"}
if s.AccountWithRestoreAccess == nil {
invalidParams.Add(request.NewErrParamRequired("AccountWithRestoreAccess"))
}
if s.SnapshotIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("SnapshotIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RevokeSnapshotAccessOutput struct {
_ struct{} `type:"structure"`
@ -7243,6 +7905,19 @@ func (s RotateEncryptionKeyInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RotateEncryptionKeyInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RotateEncryptionKeyInput"}
if s.ClusterIdentifier == nil {
invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RotateEncryptionKeyOutput struct {
_ struct{} `type:"structure"`

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,32 +6,41 @@ import (
)
func init() {
initClient = func(c *client.Client) {
// Support building custom host-style bucket endpoints
c.Handlers.Build.PushFront(updateHostWithBucket)
initClient = defaultInitClientFn
initRequest = defaultInitRequestFn
}
// Require SSL when using SSE keys
c.Handlers.Validate.PushBack(validateSSERequiresSSL)
c.Handlers.Build.PushBack(computeSSEKeys)
func defaultInitClientFn(c *client.Client) {
// Support building custom endpoints based on config
c.Handlers.Build.PushFront(updateEndpointForS3Config)
// S3 uses custom error unmarshaling logic
c.Handlers.UnmarshalError.Clear()
c.Handlers.UnmarshalError.PushBack(unmarshalError)
}
// Require SSL when using SSE keys
c.Handlers.Validate.PushBack(validateSSERequiresSSL)
c.Handlers.Build.PushBack(computeSSEKeys)
initRequest = func(r *request.Request) {
switch r.Operation.Name {
case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration:
// These S3 operations require Content-MD5 to be set
r.Handlers.Build.PushBack(contentMD5)
case opGetBucketLocation:
// GetBucketLocation has custom parsing logic
r.Handlers.Unmarshal.PushFront(buildGetBucketLocation)
case opCreateBucket:
// Auto-populate LocationConstraint with current region
r.Handlers.Validate.PushFront(populateLocationConstraint)
case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload:
r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError)
}
// S3 uses custom error unmarshaling logic
c.Handlers.UnmarshalError.Clear()
c.Handlers.UnmarshalError.PushBack(unmarshalError)
}
func defaultInitRequestFn(r *request.Request) {
// Add reuest handlers for specific platforms.
// e.g. 100-continue support for PUT requests using Go 1.6
platformRequestHandlers(r)
switch r.Operation.Name {
case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy,
opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration,
opPutBucketReplication:
// These S3 operations require Content-MD5 to be set
r.Handlers.Build.PushBack(contentMD5)
case opGetBucketLocation:
// GetBucketLocation has custom parsing logic
r.Handlers.Unmarshal.PushFront(buildGetBucketLocation)
case opCreateBucket:
// Auto-populate LocationConstraint with current region
r.Handlers.Validate.PushFront(populateLocationConstraint)
case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload:
r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError)
}
}

View File

@ -1,14 +1,124 @@
package s3
import (
"fmt"
"net/url"
"regexp"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
)
// an operationBlacklist is a list of operation names that should a
// request handler should not be executed with.
type operationBlacklist []string
// Continue will return true of the Request's operation name is not
// in the blacklist. False otherwise.
func (b operationBlacklist) Continue(r *request.Request) bool {
for i := 0; i < len(b); i++ {
if b[i] == r.Operation.Name {
return false
}
}
return true
}
var accelerateOpBlacklist = operationBlacklist{
opListBuckets, opCreateBucket, opDeleteBucket,
}
// Request handler to automatically add the bucket name to the endpoint domain
// if possible. This style of bucket is valid for all bucket names which are
// DNS compatible and do not contain "."
func updateEndpointForS3Config(r *request.Request) {
forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle)
accelerate := aws.BoolValue(r.Config.S3UseAccelerate)
if accelerate && accelerateOpBlacklist.Continue(r) {
if forceHostStyle {
if r.Config.Logger != nil {
r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.")
}
}
updateEndpointForAccelerate(r)
} else if !forceHostStyle && r.Operation.Name != opGetBucketLocation {
updateEndpointForHostStyle(r)
}
}
func updateEndpointForHostStyle(r *request.Request) {
bucket, ok := bucketNameFromReqParams(r.Params)
if !ok {
// Ignore operation requests if the bucketname was not provided
// if this is an input validation error the validation handler
// will report it.
return
}
if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) {
// bucket name must be valid to put into the host
return
}
moveBucketToHost(r.HTTPRequest.URL, bucket)
}
func updateEndpointForAccelerate(r *request.Request) {
bucket, ok := bucketNameFromReqParams(r.Params)
if !ok {
// Ignore operation requests if the bucketname was not provided
// if this is an input validation error the validation handler
// will report it.
return
}
if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) {
r.Error = awserr.New("InvalidParameterException",
fmt.Sprintf("bucket name %s is not compatibile with S3 Accelerate", bucket),
nil)
return
}
// Change endpoint from s3(-[a-z0-1-])?.amazonaws.com to s3-accelerate.amazonaws.com
r.HTTPRequest.URL.Host = replaceHostRegion(r.HTTPRequest.URL.Host, "accelerate")
moveBucketToHost(r.HTTPRequest.URL, bucket)
}
// Attempts to retrieve the bucket name from the request input parameters.
// If no bucket is found, or the field is empty "", false will be returned.
func bucketNameFromReqParams(params interface{}) (string, bool) {
b, _ := awsutil.ValuesAtPath(params, "Bucket")
if len(b) == 0 {
return "", false
}
if bucket, ok := b[0].(*string); ok {
if bucketStr := aws.StringValue(bucket); bucketStr != "" {
return bucketStr, true
}
}
return "", false
}
// hostCompatibleBucketName returns true if the request should
// put the bucket in the host. This is false if S3ForcePathStyle is
// explicitly set or if the bucket is not DNS compatible.
func hostCompatibleBucketName(u *url.URL, bucket string) bool {
// Bucket might be DNS compatible but dots in the hostname will fail
// certificate validation, so do not use host-style.
if u.Scheme == "https" && strings.Contains(bucket, ".") {
return false
}
// if the bucket is DNS compatible
return dnsCompatibleBucketName(bucket)
}
var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`)
var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`)
@ -20,41 +130,36 @@ func dnsCompatibleBucketName(bucket string) bool {
!strings.Contains(bucket, "..")
}
// hostStyleBucketName returns true if the request should put the bucket in
// the host. This is false if S3ForcePathStyle is explicitly set or if the
// bucket is not DNS compatible.
func hostStyleBucketName(r *request.Request, bucket string) bool {
if aws.BoolValue(r.Config.S3ForcePathStyle) {
return false
// moveBucketToHost moves the bucket name from the URI path to URL host.
func moveBucketToHost(u *url.URL, bucket string) {
u.Host = bucket + "." + u.Host
u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1)
if u.Path == "" {
u.Path = "/"
}
// Bucket might be DNS compatible but dots in the hostname will fail
// certificate validation, so do not use host-style.
if r.HTTPRequest.URL.Scheme == "https" && strings.Contains(bucket, ".") {
return false
}
// GetBucketLocation should be able to be called from any region within
// a partition, and return the associated region of the bucket.
if r.Operation.Name == opGetBucketLocation {
return false
}
// Use host-style if the bucket is DNS compatible
return dnsCompatibleBucketName(bucket)
}
func updateHostWithBucket(r *request.Request) {
b, _ := awsutil.ValuesAtPath(r.Params, "Bucket")
if len(b) == 0 {
return
const s3HostPrefix = "s3"
// replaceHostRegion replaces the S3 region string in the host with the
// value provided. If v is empty the host prefix returned will be s3.
func replaceHostRegion(host, v string) string {
if !strings.HasPrefix(host, s3HostPrefix) {
return host
}
if bucket := b[0].(*string); aws.StringValue(bucket) != "" && hostStyleBucketName(r, *bucket) {
r.HTTPRequest.URL.Host = *bucket + "." + r.HTTPRequest.URL.Host
r.HTTPRequest.URL.Path = strings.Replace(r.HTTPRequest.URL.Path, "/{Bucket}", "", -1)
if r.HTTPRequest.URL.Path == "" {
r.HTTPRequest.URL.Path = "/"
suffix := host[len(s3HostPrefix):]
for i := len(s3HostPrefix); i < len(host); i++ {
if host[i] == '.' {
// Trim until '.' leave the it in place.
suffix = host[i:]
break
}
}
if len(v) == 0 {
return fmt.Sprintf("s3%s", suffix)
}
return fmt.Sprintf("s3-%s%s", v, suffix)
}

View File

@ -0,0 +1,8 @@
// +build !go1.6
package s3
import "github.com/aws/aws-sdk-go/aws/request"
func platformRequestHandlers(r *request.Request) {
}

View File

@ -0,0 +1,28 @@
// +build go1.6
package s3
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
func platformRequestHandlers(r *request.Request) {
if r.Operation.HTTPMethod == "PUT" {
// 100-Continue should only be used on put requests.
r.Handlers.Sign.PushBack(add100Continue)
}
}
func add100Continue(r *request.Request) {
if aws.BoolValue(r.Config.S3Disable100Continue) {
return
}
if r.HTTPRequest.ContentLength < 1024*1024*2 {
// Ignore requests smaller than 2MB. This helps prevent delaying
// requests unnecessarily.
return
}
r.HTTPRequest.Header.Set("Expect", "100-Continue")
}

View File

@ -4,6 +4,8 @@
package sns
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
@ -893,6 +895,28 @@ func (s AddPermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddPermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
if s.AWSAccountId == nil {
invalidParams.Add(request.NewErrParamRequired("AWSAccountId"))
}
if s.ActionName == nil {
invalidParams.Add(request.NewErrParamRequired("ActionName"))
}
if s.Label == nil {
invalidParams.Add(request.NewErrParamRequired("Label"))
}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddPermissionOutput struct {
_ struct{} `type:"structure"`
}
@ -934,6 +958,22 @@ func (s ConfirmSubscriptionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ConfirmSubscriptionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ConfirmSubscriptionInput"}
if s.Token == nil {
invalidParams.Add(request.NewErrParamRequired("Token"))
}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for ConfirmSubscriptions action.
type ConfirmSubscriptionOutput struct {
_ struct{} `type:"structure"`
@ -979,6 +1019,25 @@ func (s CreatePlatformApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreatePlatformApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreatePlatformApplicationInput"}
if s.Attributes == nil {
invalidParams.Add(request.NewErrParamRequired("Attributes"))
}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if s.Platform == nil {
invalidParams.Add(request.NewErrParamRequired("Platform"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response from CreatePlatformApplication action.
type CreatePlatformApplicationOutput struct {
_ struct{} `type:"structure"`
@ -1030,6 +1089,22 @@ func (s CreatePlatformEndpointInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreatePlatformEndpointInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreatePlatformEndpointInput"}
if s.PlatformApplicationArn == nil {
invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
}
if s.Token == nil {
invalidParams.Add(request.NewErrParamRequired("Token"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response from CreateEndpoint action.
type CreatePlatformEndpointOutput struct {
_ struct{} `type:"structure"`
@ -1070,6 +1145,19 @@ func (s CreateTopicInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateTopicInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateTopicInput"}
if s.Name == nil {
invalidParams.Add(request.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response from CreateTopic action.
type CreateTopicOutput struct {
_ struct{} `type:"structure"`
@ -1106,6 +1194,19 @@ func (s DeleteEndpointInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteEndpointInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointInput"}
if s.EndpointArn == nil {
invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteEndpointOutput struct {
_ struct{} `type:"structure"`
}
@ -1138,6 +1239,19 @@ func (s DeletePlatformApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeletePlatformApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeletePlatformApplicationInput"}
if s.PlatformApplicationArn == nil {
invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeletePlatformApplicationOutput struct {
_ struct{} `type:"structure"`
}
@ -1169,6 +1283,19 @@ func (s DeleteTopicInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteTopicInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteTopicInput"}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteTopicOutput struct {
_ struct{} `type:"structure"`
}
@ -1222,6 +1349,19 @@ func (s GetEndpointAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetEndpointAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetEndpointAttributesInput"}
if s.EndpointArn == nil {
invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response from GetEndpointAttributes of the EndpointArn.
type GetEndpointAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1268,6 +1408,19 @@ func (s GetPlatformApplicationAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetPlatformApplicationAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetPlatformApplicationAttributesInput"}
if s.PlatformApplicationArn == nil {
invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for GetPlatformApplicationAttributes action.
type GetPlatformApplicationAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1312,6 +1465,19 @@ func (s GetSubscriptionAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetSubscriptionAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionAttributesInput"}
if s.SubscriptionArn == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for GetSubscriptionAttributes action.
type GetSubscriptionAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1357,6 +1523,19 @@ func (s GetTopicAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetTopicAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetTopicAttributesInput"}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for GetTopicAttributes action.
type GetTopicAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1409,6 +1588,19 @@ func (s ListEndpointsByPlatformApplicationInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListEndpointsByPlatformApplicationInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListEndpointsByPlatformApplicationInput"}
if s.PlatformApplicationArn == nil {
invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for ListEndpointsByPlatformApplication action.
type ListEndpointsByPlatformApplicationOutput struct {
_ struct{} `type:"structure"`
@ -1493,6 +1685,19 @@ func (s ListSubscriptionsByTopicInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListSubscriptionsByTopicInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionsByTopicInput"}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for ListSubscriptionsByTopic action.
type ListSubscriptionsByTopicOutput struct {
_ struct{} `type:"structure"`
@ -1631,6 +1836,19 @@ func (s MessageAttributeValue) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MessageAttributeValue) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"}
if s.DataType == nil {
invalidParams.Add(request.NewErrParamRequired("DataType"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Platform application object.
type PlatformApplication struct {
_ struct{} `type:"structure"`
@ -1729,6 +1947,29 @@ func (s PublishInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PublishInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PublishInput"}
if s.Message == nil {
invalidParams.Add(request.NewErrParamRequired("Message"))
}
if s.MessageAttributes != nil {
for i, v := range s.MessageAttributes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for Publish action.
type PublishOutput struct {
_ struct{} `type:"structure"`
@ -1770,6 +2011,22 @@ func (s RemovePermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemovePermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
if s.Label == nil {
invalidParams.Add(request.NewErrParamRequired("Label"))
}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemovePermissionOutput struct {
_ struct{} `type:"structure"`
}
@ -1815,6 +2072,22 @@ func (s SetEndpointAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetEndpointAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetEndpointAttributesInput"}
if s.Attributes == nil {
invalidParams.Add(request.NewErrParamRequired("Attributes"))
}
if s.EndpointArn == nil {
invalidParams.Add(request.NewErrParamRequired("EndpointArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetEndpointAttributesOutput struct {
_ struct{} `type:"structure"`
}
@ -1864,6 +2137,22 @@ func (s SetPlatformApplicationAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetPlatformApplicationAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetPlatformApplicationAttributesInput"}
if s.Attributes == nil {
invalidParams.Add(request.NewErrParamRequired("Attributes"))
}
if s.PlatformApplicationArn == nil {
invalidParams.Add(request.NewErrParamRequired("PlatformApplicationArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetPlatformApplicationAttributesOutput struct {
_ struct{} `type:"structure"`
}
@ -1905,6 +2194,22 @@ func (s SetSubscriptionAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetSubscriptionAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetSubscriptionAttributesInput"}
if s.AttributeName == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeName"))
}
if s.SubscriptionArn == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetSubscriptionAttributesOutput struct {
_ struct{} `type:"structure"`
}
@ -1946,6 +2251,22 @@ func (s SetTopicAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetTopicAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetTopicAttributesInput"}
if s.AttributeName == nil {
invalidParams.Add(request.NewErrParamRequired("AttributeName"))
}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetTopicAttributesOutput struct {
_ struct{} `type:"structure"`
}
@ -1999,6 +2320,22 @@ func (s SubscribeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SubscribeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SubscribeInput"}
if s.Protocol == nil {
invalidParams.Add(request.NewErrParamRequired("Protocol"))
}
if s.TopicArn == nil {
invalidParams.Add(request.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Response for Subscribe action.
type SubscribeOutput struct {
_ struct{} `type:"structure"`
@ -2085,6 +2422,19 @@ func (s UnsubscribeInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UnsubscribeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "UnsubscribeInput"}
if s.SubscriptionArn == nil {
invalidParams.Add(request.NewErrParamRequired("SubscriptionArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type UnsubscribeOutput struct {
_ struct{} `type:"structure"`
}

View File

@ -4,6 +4,8 @@
package sqs
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
@ -781,6 +783,28 @@ func (s AddPermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddPermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"}
if s.AWSAccountIds == nil {
invalidParams.Add(request.NewErrParamRequired("AWSAccountIds"))
}
if s.Actions == nil {
invalidParams.Add(request.NewErrParamRequired("Actions"))
}
if s.Label == nil {
invalidParams.Add(request.NewErrParamRequired("Label"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddPermissionOutput struct {
_ struct{} `type:"structure"`
}
@ -844,6 +868,32 @@ func (s ChangeMessageVisibilityBatchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ChangeMessageVisibilityBatchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchInput"}
if s.Entries == nil {
invalidParams.Add(request.NewErrParamRequired("Entries"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.Entries != nil {
for i, v := range s.Entries {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry
// tag if the message succeeds or a BatchResultErrorEntry tag if the message
// fails.
@ -902,6 +952,22 @@ func (s ChangeMessageVisibilityBatchRequestEntry) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ChangeMessageVisibilityBatchRequestEntry) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchRequestEntry"}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.ReceiptHandle == nil {
invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Encloses the id of an entry in ChangeMessageVisibilityBatch.
type ChangeMessageVisibilityBatchResultEntry struct {
_ struct{} `type:"structure"`
@ -945,6 +1011,25 @@ func (s ChangeMessageVisibilityInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ChangeMessageVisibilityInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.ReceiptHandle == nil {
invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
}
if s.VisibilityTimeout == nil {
invalidParams.Add(request.NewErrParamRequired("VisibilityTimeout"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type ChangeMessageVisibilityOutput struct {
_ struct{} `type:"structure"`
}
@ -1000,6 +1085,19 @@ func (s CreateQueueInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateQueueInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateQueueInput"}
if s.QueueName == nil {
invalidParams.Add(request.NewErrParamRequired("QueueName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Returns the QueueUrl element of the created queue.
type CreateQueueOutput struct {
_ struct{} `type:"structure"`
@ -1038,6 +1136,32 @@ func (s DeleteMessageBatchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteMessageBatchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchInput"}
if s.Entries == nil {
invalidParams.Add(request.NewErrParamRequired("Entries"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.Entries != nil {
for i, v := range s.Entries {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// For each message in the batch, the response contains a DeleteMessageBatchResultEntry
// tag if the message is deleted or a BatchResultErrorEntry tag if the message
// cannot be deleted.
@ -1084,6 +1208,22 @@ func (s DeleteMessageBatchRequestEntry) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteMessageBatchRequestEntry) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchRequestEntry"}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.ReceiptHandle == nil {
invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Encloses the id an entry in DeleteMessageBatch.
type DeleteMessageBatchResultEntry struct {
_ struct{} `type:"structure"`
@ -1122,6 +1262,22 @@ func (s DeleteMessageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteMessageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteMessageInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.ReceiptHandle == nil {
invalidParams.Add(request.NewErrParamRequired("ReceiptHandle"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteMessageOutput struct {
_ struct{} `type:"structure"`
}
@ -1153,6 +1309,19 @@ func (s DeleteQueueInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteQueueInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DeleteQueueInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteQueueOutput struct {
_ struct{} `type:"structure"`
}
@ -1187,6 +1356,19 @@ func (s GetQueueAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetQueueAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetQueueAttributesInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A list of returned queue attributes.
type GetQueueAttributesOutput struct {
_ struct{} `type:"structure"`
@ -1226,6 +1408,19 @@ func (s GetQueueUrlInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetQueueUrlInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "GetQueueUrlInput"}
if s.QueueName == nil {
invalidParams.Add(request.NewErrParamRequired("QueueName"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// For more information, see Responses (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/UnderstandingResponses.html)
// in the Amazon SQS Developer Guide.
type GetQueueUrlOutput struct {
@ -1262,6 +1457,19 @@ func (s ListDeadLetterSourceQueuesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ListDeadLetterSourceQueuesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ListDeadLetterSourceQueuesInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A list of your dead letter source queues.
type ListDeadLetterSourceQueuesOutput struct {
_ struct{} `type:"structure"`
@ -1406,6 +1614,19 @@ func (s MessageAttributeValue) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *MessageAttributeValue) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"}
if s.DataType == nil {
invalidParams.Add(request.NewErrParamRequired("DataType"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PurgeQueueInput struct {
_ struct{} `type:"structure"`
@ -1424,6 +1645,19 @@ func (s PurgeQueueInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *PurgeQueueInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "PurgeQueueInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type PurgeQueueOutput struct {
_ struct{} `type:"structure"`
}
@ -1500,6 +1734,19 @@ func (s ReceiveMessageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ReceiveMessageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ReceiveMessageInput"}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// A list of received messages.
type ReceiveMessageOutput struct {
_ struct{} `type:"structure"`
@ -1539,6 +1786,22 @@ func (s RemovePermissionInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RemovePermissionInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"}
if s.Label == nil {
invalidParams.Add(request.NewErrParamRequired("Label"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type RemovePermissionOutput struct {
_ struct{} `type:"structure"`
}
@ -1573,6 +1836,32 @@ func (s SendMessageBatchInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SendMessageBatchInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchInput"}
if s.Entries == nil {
invalidParams.Add(request.NewErrParamRequired("Entries"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.Entries != nil {
for i, v := range s.Entries {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// For each message in the batch, the response contains a SendMessageBatchResultEntry
// tag if the message succeeds or a BatchResultErrorEntry tag if the message
// fails.
@ -1627,6 +1916,32 @@ func (s SendMessageBatchRequestEntry) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SendMessageBatchRequestEntry) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchRequestEntry"}
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
if s.MessageBody == nil {
invalidParams.Add(request.NewErrParamRequired("MessageBody"))
}
if s.MessageAttributes != nil {
for i, v := range s.MessageAttributes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Encloses a message ID for successfully enqueued message of a SendMessageBatch.
type SendMessageBatchResultEntry struct {
_ struct{} `type:"structure"`
@ -1691,6 +2006,32 @@ func (s SendMessageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SendMessageInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SendMessageInput"}
if s.MessageBody == nil {
invalidParams.Add(request.NewErrParamRequired("MessageBody"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if s.MessageAttributes != nil {
for i, v := range s.MessageAttributes {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The MD5OfMessageBody and MessageId elements.
type SendMessageOutput struct {
_ struct{} `type:"structure"`
@ -1766,6 +2107,22 @@ func (s SetQueueAttributesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SetQueueAttributesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "SetQueueAttributesInput"}
if s.Attributes == nil {
invalidParams.Add(request.NewErrParamRequired("Attributes"))
}
if s.QueueUrl == nil {
invalidParams.Add(request.NewErrParamRequired("QueueUrl"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type SetQueueAttributesOutput struct {
_ struct{} `type:"structure"`
}

1478
vendor/github.com/aws/aws-sdk-go/service/sts/api.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
package sts
import "github.com/aws/aws-sdk-go/aws/request"
func init() {
initRequest = func(r *request.Request) {
switch r.Operation.Name {
case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity:
r.Handlers.Sign.Clear() // these operations are unsigned
}
}
}

130
vendor/github.com/aws/aws-sdk-go/service/sts/service.go generated vendored Normal file
View File

@ -0,0 +1,130 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package sts
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol/query"
"github.com/aws/aws-sdk-go/private/signer/v4"
)
// The AWS Security Token Service (STS) is a web service that enables you to
// request temporary, limited-privilege credentials for AWS Identity and Access
// Management (IAM) users or for users that you authenticate (federated users).
// This guide provides descriptions of the STS API. For more detailed information
// about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
//
// As an alternative to using the API, you can use one of the AWS SDKs, which
// consist of libraries and sample code for various programming languages and
// platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient
// way to create programmatic access to STS. For example, the SDKs take care
// of cryptographically signing requests, managing errors, and retrying requests
// automatically. For information about the AWS SDKs, including how to download
// and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).
//
// For information about setting up signatures and authorization through the
// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)
// in the AWS General Reference. For general information about the Query API,
// go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)
// in Using IAM. For information about using security tokens with other AWS
// products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)
// in the IAM User Guide.
//
// If you're new to AWS and need additional technical information about a specific
// AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/
// (http://aws.amazon.com/documentation/).
//
// Endpoints
//
// The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com
// that maps to the US East (N. Virginia) region. Additional regions are available
// and are activated by default. For more information, see Activating and Deactivating
// AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)
// in the AWS General Reference.
//
// Recording API requests
//
// STS supports AWS CloudTrail, which is a service that records AWS calls for
// your AWS account and delivers log files to an Amazon S3 bucket. By using
// information collected by CloudTrail, you can determine what requests were
// successfully made to STS, who made the request, when it was made, and so
// on. To learn more about CloudTrail, including how to turn it on and find
// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
//The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
type STS struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// A ServiceName is the name of the service the client will make API calls to.
const ServiceName = "sts"
// New creates a new instance of the STS client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a STS client from just a session.
// svc := sts.New(mySession)
//
// // Create a STS client with additional configuration
// svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS {
c := p.ClientConfig(ServiceName, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *STS {
svc := &STS{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2011-06-15",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBack(v4.Sign)
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a STS operation and runs any
// custom request initialization.
func (c *STS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}