Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
+2346 -630
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -9,7 +9,7 @@
// and data types via the endpoint waf.amazonaws.com. This guide is for developers
// who need detailed information about the AWS WAF API actions, data types,
// and errors. For detailed information about AWS WAF features and an overview
// of how to use the AWS WAF API, see the AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/).
// of how to use the AWS WAF API, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/).
//
// See https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24 for more information on this service.
//
+60 -37
View File
@@ -4,28 +4,32 @@ package waf
const (
// ErrCodeBadRequestException for service response error code
// "WAFBadRequestException".
ErrCodeBadRequestException = "WAFBadRequestException"
// ErrCodeDisallowedNameException for service response error code
// "DisallowedNameException".
// "WAFDisallowedNameException".
//
// The name specified is invalid.
ErrCodeDisallowedNameException = "DisallowedNameException"
ErrCodeDisallowedNameException = "WAFDisallowedNameException"
// ErrCodeInternalErrorException for service response error code
// "InternalErrorException".
// "WAFInternalErrorException".
//
// The operation failed because of a system problem, even though the request
// was valid. Retry your request.
ErrCodeInternalErrorException = "InternalErrorException"
ErrCodeInternalErrorException = "WAFInternalErrorException"
// ErrCodeInvalidAccountException for service response error code
// "InvalidAccountException".
// "WAFInvalidAccountException".
//
// The operation failed because you tried to create, update, or delete an object
// by using an invalid account identifier.
ErrCodeInvalidAccountException = "InvalidAccountException"
ErrCodeInvalidAccountException = "WAFInvalidAccountException"
// ErrCodeInvalidOperationException for service response error code
// "InvalidOperationException".
// "WAFInvalidOperationException".
//
// The operation failed because there was nothing to do. For example:
//
@@ -41,15 +45,12 @@ const (
// * You tried to add a Rule to a WebACL, but the Rule already exists in
// the specified WebACL.
//
// * You tried to add an IP address to an IPSet, but the IP address already
// exists in the specified IPSet.
//
// * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple
// already exists in the specified WebACL.
ErrCodeInvalidOperationException = "InvalidOperationException"
ErrCodeInvalidOperationException = "WAFInvalidOperationException"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
// "WAFInvalidParameterException".
//
// The operation failed because AWS WAF didn't recognize a parameter in the
// request. For example:
@@ -61,16 +62,16 @@ const (
// * You tried to update an object (ByteMatchSet, IPSet, Rule, or WebACL)
// using an action other than INSERT or DELETE.
//
// * You tried to create a WebACL with a DefaultActionType other than ALLOW,
// * You tried to create a WebACL with a DefaultAction Type other than ALLOW,
// BLOCK, or COUNT.
//
// * You tried to create a RateBasedRule with a RateKey value other than
// IP.
//
// * You tried to update a WebACL with a WafActionType other than ALLOW,
// * You tried to update a WebACL with a WafAction Type other than ALLOW,
// BLOCK, or COUNT.
//
// * You tried to update a ByteMatchSet with a FieldToMatchType other than
// * You tried to update a ByteMatchSet with a FieldToMatch Type other than
// HEADER, METHOD, QUERY_STRING, URI, or BODY.
//
// * You tried to update a ByteMatchSet with a Field of HEADER but no value
@@ -78,10 +79,10 @@ const (
//
// * Your request references an ARN that is malformed, or corresponds to
// a resource with which a web ACL cannot be associated.
ErrCodeInvalidParameterException = "InvalidParameterException"
ErrCodeInvalidParameterException = "WAFInvalidParameterException"
// ErrCodeInvalidPermissionPolicyException for service response error code
// "InvalidPermissionPolicyException".
// "WAFInvalidPermissionPolicyException".
//
// The operation failed because the specified policy is not in the proper format.
//
@@ -93,8 +94,9 @@ const (
//
// * Effect must specify Allow.
//
// * The Action in the policy must be waf:UpdateWebACL or waf-regional:UpdateWebACL.
// Any extra or wildcard actions in the policy will be rejected.
// * The Action in the policy must be waf:UpdateWebACL, waf-regional:UpdateWebACL,
// waf:GetRuleGroup and waf-regional:GetRuleGroup . Any extra or wildcard
// actions in the policy will be rejected.
//
// * The policy cannot include a Resource parameter.
//
@@ -104,25 +106,25 @@ const (
// * The user making the request must be the owner of the RuleGroup.
//
// * Your policy must be composed using IAM Policy version 2012-10-17.
ErrCodeInvalidPermissionPolicyException = "InvalidPermissionPolicyException"
ErrCodeInvalidPermissionPolicyException = "WAFInvalidPermissionPolicyException"
// ErrCodeInvalidRegexPatternException for service response error code
// "InvalidRegexPatternException".
// "WAFInvalidRegexPatternException".
//
// The regular expression (regex) you specified in RegexPatternString is invalid.
ErrCodeInvalidRegexPatternException = "InvalidRegexPatternException"
ErrCodeInvalidRegexPatternException = "WAFInvalidRegexPatternException"
// ErrCodeLimitsExceededException for service response error code
// "LimitsExceededException".
// "WAFLimitsExceededException".
//
// The operation exceeds a resource limit, for example, the maximum number of
// WebACL objects that you can create for an AWS account. For more information,
// see Limits (http://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the AWS WAF Developer Guide.
ErrCodeLimitsExceededException = "LimitsExceededException"
ErrCodeLimitsExceededException = "WAFLimitsExceededException"
// ErrCodeNonEmptyEntityException for service response error code
// "NonEmptyEntityException".
// "WAFNonEmptyEntityException".
//
// The operation failed because you tried to delete an object that isn't empty.
// For example:
@@ -136,10 +138,10 @@ const (
// objects.
//
// * You tried to delete an IPSet that references one or more IP addresses.
ErrCodeNonEmptyEntityException = "NonEmptyEntityException"
ErrCodeNonEmptyEntityException = "WAFNonEmptyEntityException"
// ErrCodeNonexistentContainerException for service response error code
// "NonexistentContainerException".
// "WAFNonexistentContainerException".
//
// The operation failed because you tried to add an object to or delete an object
// from another object that doesn't exist. For example:
@@ -155,16 +157,16 @@ const (
//
// * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from
// a ByteMatchSet that doesn't exist.
ErrCodeNonexistentContainerException = "NonexistentContainerException"
ErrCodeNonexistentContainerException = "WAFNonexistentContainerException"
// ErrCodeNonexistentItemException for service response error code
// "NonexistentItemException".
// "WAFNonexistentItemException".
//
// The operation failed because the referenced object doesn't exist.
ErrCodeNonexistentItemException = "NonexistentItemException"
ErrCodeNonexistentItemException = "WAFNonexistentItemException"
// ErrCodeReferencedItemException for service response error code
// "ReferencedItemException".
// "WAFReferencedItemException".
//
// The operation failed because you tried to delete an object that is still
// in use. For example:
@@ -172,18 +174,39 @@ const (
// * You tried to delete a ByteMatchSet that is still referenced by a Rule.
//
// * You tried to delete a Rule that is still referenced by a WebACL.
ErrCodeReferencedItemException = "ReferencedItemException"
ErrCodeReferencedItemException = "WAFReferencedItemException"
// ErrCodeServiceLinkedRoleErrorException for service response error code
// "WAFServiceLinkedRoleErrorException".
//
// AWS WAF is not able to access the service linked role. This can be caused
// by a previous PutLoggingConfiguration request, which can lock the service
// linked role for about 20 seconds. Please try your request again. The service
// linked role can also be locked by a previous DeleteServiceLinkedRole request,
// which can lock the role for 15 minutes or more. If you recently made a DeleteServiceLinkedRole,
// wait at least 15 minutes and try the request again. If you receive this same
// exception again, you will have to wait additional time until the role is
// unlocked.
ErrCodeServiceLinkedRoleErrorException = "WAFServiceLinkedRoleErrorException"
// ErrCodeStaleDataException for service response error code
// "StaleDataException".
// "WAFStaleDataException".
//
// The operation failed because you tried to create, update, or delete an object
// by using a change token that has already been used.
ErrCodeStaleDataException = "StaleDataException"
ErrCodeStaleDataException = "WAFStaleDataException"
// ErrCodeSubscriptionNotFoundException for service response error code
// "SubscriptionNotFoundException".
// "WAFSubscriptionNotFoundException".
//
// The specified subscription does not exist.
ErrCodeSubscriptionNotFoundException = "SubscriptionNotFoundException"
ErrCodeSubscriptionNotFoundException = "WAFSubscriptionNotFoundException"
// ErrCodeTagOperationException for service response error code
// "WAFTagOperationException".
ErrCodeTagOperationException = "WAFTagOperationException"
// ErrCodeTagOperationInternalErrorException for service response error code
// "WAFTagOperationInternalErrorException".
ErrCodeTagOperationInternalErrorException = "WAFTagOperationInternalErrorException"
)
+23 -3
View File
@@ -90,6 +90,12 @@ func ExampleWAF_CreateRule_shared00() {
fmt.Println(waf.ErrCodeInvalidParameterException, aerr.Error())
case waf.ErrCodeLimitsExceededException:
fmt.Println(waf.ErrCodeLimitsExceededException, aerr.Error())
case waf.ErrCodeTagOperationException:
fmt.Println(waf.ErrCodeTagOperationException, aerr.Error())
case waf.ErrCodeTagOperationInternalErrorException:
fmt.Println(waf.ErrCodeTagOperationInternalErrorException, aerr.Error())
case waf.ErrCodeBadRequestException:
fmt.Println(waf.ErrCodeBadRequestException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -214,6 +220,12 @@ func ExampleWAF_CreateWebACL_shared00() {
fmt.Println(waf.ErrCodeInvalidParameterException, aerr.Error())
case waf.ErrCodeLimitsExceededException:
fmt.Println(waf.ErrCodeLimitsExceededException, aerr.Error())
case waf.ErrCodeTagOperationException:
fmt.Println(waf.ErrCodeTagOperationException, aerr.Error())
case waf.ErrCodeTagOperationInternalErrorException:
fmt.Println(waf.ErrCodeTagOperationInternalErrorException, aerr.Error())
case waf.ErrCodeBadRequestException:
fmt.Println(waf.ErrCodeBadRequestException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -310,7 +322,7 @@ func ExampleWAF_DeleteByteMatchSet_shared00() {
// To delete an IP set
//
// The following example deletes an IP match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
// The following example deletes an IP match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
func ExampleWAF_DeleteIPSet_shared00() {
svc := waf.New(session.New())
input := &waf.DeleteIPSetInput{
@@ -374,6 +386,10 @@ func ExampleWAF_DeleteRule_shared00() {
fmt.Println(waf.ErrCodeReferencedItemException, aerr.Error())
case waf.ErrCodeNonEmptyEntityException:
fmt.Println(waf.ErrCodeNonEmptyEntityException, aerr.Error())
case waf.ErrCodeTagOperationException:
fmt.Println(waf.ErrCodeTagOperationException, aerr.Error())
case waf.ErrCodeTagOperationInternalErrorException:
fmt.Println(waf.ErrCodeTagOperationInternalErrorException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
@@ -390,7 +406,7 @@ func ExampleWAF_DeleteRule_shared00() {
// To delete a size constraint set
//
// The following example deletes a size constraint set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
// The following example deletes a size constraint set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
func ExampleWAF_DeleteSizeConstraintSet_shared00() {
svc := waf.New(session.New())
input := &waf.DeleteSizeConstraintSetInput{
@@ -430,7 +446,7 @@ func ExampleWAF_DeleteSizeConstraintSet_shared00() {
// To delete a SQL injection match set
//
// The following example deletes a SQL injection match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
// The following example deletes a SQL injection match set with the ID example1ds3t-46da-4fdb-b8d5-abc321j569j5.
func ExampleWAF_DeleteSqlInjectionMatchSet_shared00() {
svc := waf.New(session.New())
input := &waf.DeleteSqlInjectionMatchSetInput{
@@ -494,6 +510,10 @@ func ExampleWAF_DeleteWebACL_shared00() {
fmt.Println(waf.ErrCodeReferencedItemException, aerr.Error())
case waf.ErrCodeNonEmptyEntityException:
fmt.Println(waf.ErrCodeNonEmptyEntityException, aerr.Error())
case waf.ErrCodeTagOperationException:
fmt.Println(waf.ErrCodeTagOperationException, aerr.Error())
case waf.ErrCodeTagOperationInternalErrorException:
fmt.Println(waf.ErrCodeTagOperationInternalErrorException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
+61
View File
@@ -0,0 +1,61 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// +build go1.10,integration
package waf_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/integration"
"github.com/aws/aws-sdk-go/service/waf"
)
var _ aws.Config
var _ awserr.Error
var _ request.Request
func TestInteg_00_ListRules(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-east-1")
svc := waf.New(sess)
params := &waf.ListRulesInput{
Limit: aws.Int64(20),
}
_, err := svc.ListRulesWithContext(ctx, params)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestInteg_01_CreateSqlInjectionMatchSet(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-east-1")
svc := waf.New(sess)
params := &waf.CreateSqlInjectionMatchSetInput{
ChangeToken: aws.String("fake_token"),
Name: aws.String("fake_name"),
}
_, err := svc.CreateSqlInjectionMatchSetWithContext(ctx, params)
if err == nil {
t.Fatalf("expect request to fail")
}
aerr, ok := err.(awserr.RequestFailure)
if !ok {
t.Fatalf("expect awserr, was %T", err)
}
if len(aerr.Code()) == 0 {
t.Errorf("expect non-empty error code")
}
if v := aerr.Code(); v == request.ErrCodeSerialization {
t.Errorf("expect API error code got serialization failure")
}
}
+4 -2
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "waf" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "waf" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "WAF" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the WAF client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
+28
View File
@@ -120,6 +120,10 @@ type WAFAPI interface {
DeleteIPSetWithContext(aws.Context, *waf.DeleteIPSetInput, ...request.Option) (*waf.DeleteIPSetOutput, error)
DeleteIPSetRequest(*waf.DeleteIPSetInput) (*request.Request, *waf.DeleteIPSetOutput)
DeleteLoggingConfiguration(*waf.DeleteLoggingConfigurationInput) (*waf.DeleteLoggingConfigurationOutput, error)
DeleteLoggingConfigurationWithContext(aws.Context, *waf.DeleteLoggingConfigurationInput, ...request.Option) (*waf.DeleteLoggingConfigurationOutput, error)
DeleteLoggingConfigurationRequest(*waf.DeleteLoggingConfigurationInput) (*request.Request, *waf.DeleteLoggingConfigurationOutput)
DeletePermissionPolicy(*waf.DeletePermissionPolicyInput) (*waf.DeletePermissionPolicyOutput, error)
DeletePermissionPolicyWithContext(aws.Context, *waf.DeletePermissionPolicyInput, ...request.Option) (*waf.DeletePermissionPolicyOutput, error)
DeletePermissionPolicyRequest(*waf.DeletePermissionPolicyInput) (*request.Request, *waf.DeletePermissionPolicyOutput)
@@ -180,6 +184,10 @@ type WAFAPI interface {
GetIPSetWithContext(aws.Context, *waf.GetIPSetInput, ...request.Option) (*waf.GetIPSetOutput, error)
GetIPSetRequest(*waf.GetIPSetInput) (*request.Request, *waf.GetIPSetOutput)
GetLoggingConfiguration(*waf.GetLoggingConfigurationInput) (*waf.GetLoggingConfigurationOutput, error)
GetLoggingConfigurationWithContext(aws.Context, *waf.GetLoggingConfigurationInput, ...request.Option) (*waf.GetLoggingConfigurationOutput, error)
GetLoggingConfigurationRequest(*waf.GetLoggingConfigurationInput) (*request.Request, *waf.GetLoggingConfigurationOutput)
GetPermissionPolicy(*waf.GetPermissionPolicyInput) (*waf.GetPermissionPolicyOutput, error)
GetPermissionPolicyWithContext(aws.Context, *waf.GetPermissionPolicyInput, ...request.Option) (*waf.GetPermissionPolicyOutput, error)
GetPermissionPolicyRequest(*waf.GetPermissionPolicyInput) (*request.Request, *waf.GetPermissionPolicyOutput)
@@ -244,6 +252,10 @@ type WAFAPI interface {
ListIPSetsWithContext(aws.Context, *waf.ListIPSetsInput, ...request.Option) (*waf.ListIPSetsOutput, error)
ListIPSetsRequest(*waf.ListIPSetsInput) (*request.Request, *waf.ListIPSetsOutput)
ListLoggingConfigurations(*waf.ListLoggingConfigurationsInput) (*waf.ListLoggingConfigurationsOutput, error)
ListLoggingConfigurationsWithContext(aws.Context, *waf.ListLoggingConfigurationsInput, ...request.Option) (*waf.ListLoggingConfigurationsOutput, error)
ListLoggingConfigurationsRequest(*waf.ListLoggingConfigurationsInput) (*request.Request, *waf.ListLoggingConfigurationsOutput)
ListRateBasedRules(*waf.ListRateBasedRulesInput) (*waf.ListRateBasedRulesOutput, error)
ListRateBasedRulesWithContext(aws.Context, *waf.ListRateBasedRulesInput, ...request.Option) (*waf.ListRateBasedRulesOutput, error)
ListRateBasedRulesRequest(*waf.ListRateBasedRulesInput) (*request.Request, *waf.ListRateBasedRulesOutput)
@@ -276,6 +288,10 @@ type WAFAPI interface {
ListSubscribedRuleGroupsWithContext(aws.Context, *waf.ListSubscribedRuleGroupsInput, ...request.Option) (*waf.ListSubscribedRuleGroupsOutput, error)
ListSubscribedRuleGroupsRequest(*waf.ListSubscribedRuleGroupsInput) (*request.Request, *waf.ListSubscribedRuleGroupsOutput)
ListTagsForResource(*waf.ListTagsForResourceInput) (*waf.ListTagsForResourceOutput, error)
ListTagsForResourceWithContext(aws.Context, *waf.ListTagsForResourceInput, ...request.Option) (*waf.ListTagsForResourceOutput, error)
ListTagsForResourceRequest(*waf.ListTagsForResourceInput) (*request.Request, *waf.ListTagsForResourceOutput)
ListWebACLs(*waf.ListWebACLsInput) (*waf.ListWebACLsOutput, error)
ListWebACLsWithContext(aws.Context, *waf.ListWebACLsInput, ...request.Option) (*waf.ListWebACLsOutput, error)
ListWebACLsRequest(*waf.ListWebACLsInput) (*request.Request, *waf.ListWebACLsOutput)
@@ -284,10 +300,22 @@ type WAFAPI interface {
ListXssMatchSetsWithContext(aws.Context, *waf.ListXssMatchSetsInput, ...request.Option) (*waf.ListXssMatchSetsOutput, error)
ListXssMatchSetsRequest(*waf.ListXssMatchSetsInput) (*request.Request, *waf.ListXssMatchSetsOutput)
PutLoggingConfiguration(*waf.PutLoggingConfigurationInput) (*waf.PutLoggingConfigurationOutput, error)
PutLoggingConfigurationWithContext(aws.Context, *waf.PutLoggingConfigurationInput, ...request.Option) (*waf.PutLoggingConfigurationOutput, error)
PutLoggingConfigurationRequest(*waf.PutLoggingConfigurationInput) (*request.Request, *waf.PutLoggingConfigurationOutput)
PutPermissionPolicy(*waf.PutPermissionPolicyInput) (*waf.PutPermissionPolicyOutput, error)
PutPermissionPolicyWithContext(aws.Context, *waf.PutPermissionPolicyInput, ...request.Option) (*waf.PutPermissionPolicyOutput, error)
PutPermissionPolicyRequest(*waf.PutPermissionPolicyInput) (*request.Request, *waf.PutPermissionPolicyOutput)
TagResource(*waf.TagResourceInput) (*waf.TagResourceOutput, error)
TagResourceWithContext(aws.Context, *waf.TagResourceInput, ...request.Option) (*waf.TagResourceOutput, error)
TagResourceRequest(*waf.TagResourceInput) (*request.Request, *waf.TagResourceOutput)
UntagResource(*waf.UntagResourceInput) (*waf.UntagResourceOutput, error)
UntagResourceWithContext(aws.Context, *waf.UntagResourceInput, ...request.Option) (*waf.UntagResourceOutput, error)
UntagResourceRequest(*waf.UntagResourceInput) (*request.Request, *waf.UntagResourceOutput)
UpdateByteMatchSet(*waf.UpdateByteMatchSetInput) (*waf.UpdateByteMatchSetOutput, error)
UpdateByteMatchSetWithContext(aws.Context, *waf.UpdateByteMatchSetInput, ...request.Option) (*waf.UpdateByteMatchSetOutput, error)
UpdateByteMatchSetRequest(*waf.UpdateByteMatchSetInput) (*request.Request, *waf.UpdateByteMatchSetOutput)