mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-31 04:30:44 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+3638
-1667
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+38
-2
@@ -26,7 +26,7 @@ import (
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Direct Connect.
|
||||
// func myFunc(svc directconnectiface.DirectConnectAPI) bool {
|
||||
// // Make svc.AllocateConnectionOnInterconnect request
|
||||
// // Make svc.AcceptDirectConnectGatewayAssociationProposal request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
@@ -42,7 +42,7 @@ import (
|
||||
// type mockDirectConnectClient struct {
|
||||
// directconnectiface.DirectConnectAPI
|
||||
// }
|
||||
// func (m *mockDirectConnectClient) AllocateConnectionOnInterconnect(input *directconnect.AllocateConnectionOnInterconnectInput) (*directconnect.Connection, error) {
|
||||
// func (m *mockDirectConnectClient) AcceptDirectConnectGatewayAssociationProposal(input *directconnect.AcceptDirectConnectGatewayAssociationProposalInput) (*directconnect.AcceptDirectConnectGatewayAssociationProposalOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
@@ -60,6 +60,10 @@ import (
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type DirectConnectAPI interface {
|
||||
AcceptDirectConnectGatewayAssociationProposal(*directconnect.AcceptDirectConnectGatewayAssociationProposalInput) (*directconnect.AcceptDirectConnectGatewayAssociationProposalOutput, error)
|
||||
AcceptDirectConnectGatewayAssociationProposalWithContext(aws.Context, *directconnect.AcceptDirectConnectGatewayAssociationProposalInput, ...request.Option) (*directconnect.AcceptDirectConnectGatewayAssociationProposalOutput, error)
|
||||
AcceptDirectConnectGatewayAssociationProposalRequest(*directconnect.AcceptDirectConnectGatewayAssociationProposalInput) (*request.Request, *directconnect.AcceptDirectConnectGatewayAssociationProposalOutput)
|
||||
|
||||
AllocateConnectionOnInterconnect(*directconnect.AllocateConnectionOnInterconnectInput) (*directconnect.Connection, error)
|
||||
AllocateConnectionOnInterconnectWithContext(aws.Context, *directconnect.AllocateConnectionOnInterconnectInput, ...request.Option) (*directconnect.Connection, error)
|
||||
AllocateConnectionOnInterconnectRequest(*directconnect.AllocateConnectionOnInterconnectInput) (*request.Request, *directconnect.Connection)
|
||||
@@ -76,6 +80,10 @@ type DirectConnectAPI interface {
|
||||
AllocatePublicVirtualInterfaceWithContext(aws.Context, *directconnect.AllocatePublicVirtualInterfaceInput, ...request.Option) (*directconnect.VirtualInterface, error)
|
||||
AllocatePublicVirtualInterfaceRequest(*directconnect.AllocatePublicVirtualInterfaceInput) (*request.Request, *directconnect.VirtualInterface)
|
||||
|
||||
AllocateTransitVirtualInterface(*directconnect.AllocateTransitVirtualInterfaceInput) (*directconnect.AllocateTransitVirtualInterfaceOutput, error)
|
||||
AllocateTransitVirtualInterfaceWithContext(aws.Context, *directconnect.AllocateTransitVirtualInterfaceInput, ...request.Option) (*directconnect.AllocateTransitVirtualInterfaceOutput, error)
|
||||
AllocateTransitVirtualInterfaceRequest(*directconnect.AllocateTransitVirtualInterfaceInput) (*request.Request, *directconnect.AllocateTransitVirtualInterfaceOutput)
|
||||
|
||||
AssociateConnectionWithLag(*directconnect.AssociateConnectionWithLagInput) (*directconnect.Connection, error)
|
||||
AssociateConnectionWithLagWithContext(aws.Context, *directconnect.AssociateConnectionWithLagInput, ...request.Option) (*directconnect.Connection, error)
|
||||
AssociateConnectionWithLagRequest(*directconnect.AssociateConnectionWithLagInput) (*request.Request, *directconnect.Connection)
|
||||
@@ -100,6 +108,10 @@ type DirectConnectAPI interface {
|
||||
ConfirmPublicVirtualInterfaceWithContext(aws.Context, *directconnect.ConfirmPublicVirtualInterfaceInput, ...request.Option) (*directconnect.ConfirmPublicVirtualInterfaceOutput, error)
|
||||
ConfirmPublicVirtualInterfaceRequest(*directconnect.ConfirmPublicVirtualInterfaceInput) (*request.Request, *directconnect.ConfirmPublicVirtualInterfaceOutput)
|
||||
|
||||
ConfirmTransitVirtualInterface(*directconnect.ConfirmTransitVirtualInterfaceInput) (*directconnect.ConfirmTransitVirtualInterfaceOutput, error)
|
||||
ConfirmTransitVirtualInterfaceWithContext(aws.Context, *directconnect.ConfirmTransitVirtualInterfaceInput, ...request.Option) (*directconnect.ConfirmTransitVirtualInterfaceOutput, error)
|
||||
ConfirmTransitVirtualInterfaceRequest(*directconnect.ConfirmTransitVirtualInterfaceInput) (*request.Request, *directconnect.ConfirmTransitVirtualInterfaceOutput)
|
||||
|
||||
CreateBGPPeer(*directconnect.CreateBGPPeerInput) (*directconnect.CreateBGPPeerOutput, error)
|
||||
CreateBGPPeerWithContext(aws.Context, *directconnect.CreateBGPPeerInput, ...request.Option) (*directconnect.CreateBGPPeerOutput, error)
|
||||
CreateBGPPeerRequest(*directconnect.CreateBGPPeerInput) (*request.Request, *directconnect.CreateBGPPeerOutput)
|
||||
@@ -116,6 +128,10 @@ type DirectConnectAPI interface {
|
||||
CreateDirectConnectGatewayAssociationWithContext(aws.Context, *directconnect.CreateDirectConnectGatewayAssociationInput, ...request.Option) (*directconnect.CreateDirectConnectGatewayAssociationOutput, error)
|
||||
CreateDirectConnectGatewayAssociationRequest(*directconnect.CreateDirectConnectGatewayAssociationInput) (*request.Request, *directconnect.CreateDirectConnectGatewayAssociationOutput)
|
||||
|
||||
CreateDirectConnectGatewayAssociationProposal(*directconnect.CreateDirectConnectGatewayAssociationProposalInput) (*directconnect.CreateDirectConnectGatewayAssociationProposalOutput, error)
|
||||
CreateDirectConnectGatewayAssociationProposalWithContext(aws.Context, *directconnect.CreateDirectConnectGatewayAssociationProposalInput, ...request.Option) (*directconnect.CreateDirectConnectGatewayAssociationProposalOutput, error)
|
||||
CreateDirectConnectGatewayAssociationProposalRequest(*directconnect.CreateDirectConnectGatewayAssociationProposalInput) (*request.Request, *directconnect.CreateDirectConnectGatewayAssociationProposalOutput)
|
||||
|
||||
CreateInterconnect(*directconnect.CreateInterconnectInput) (*directconnect.Interconnect, error)
|
||||
CreateInterconnectWithContext(aws.Context, *directconnect.CreateInterconnectInput, ...request.Option) (*directconnect.Interconnect, error)
|
||||
CreateInterconnectRequest(*directconnect.CreateInterconnectInput) (*request.Request, *directconnect.Interconnect)
|
||||
@@ -132,6 +148,10 @@ type DirectConnectAPI interface {
|
||||
CreatePublicVirtualInterfaceWithContext(aws.Context, *directconnect.CreatePublicVirtualInterfaceInput, ...request.Option) (*directconnect.VirtualInterface, error)
|
||||
CreatePublicVirtualInterfaceRequest(*directconnect.CreatePublicVirtualInterfaceInput) (*request.Request, *directconnect.VirtualInterface)
|
||||
|
||||
CreateTransitVirtualInterface(*directconnect.CreateTransitVirtualInterfaceInput) (*directconnect.CreateTransitVirtualInterfaceOutput, error)
|
||||
CreateTransitVirtualInterfaceWithContext(aws.Context, *directconnect.CreateTransitVirtualInterfaceInput, ...request.Option) (*directconnect.CreateTransitVirtualInterfaceOutput, error)
|
||||
CreateTransitVirtualInterfaceRequest(*directconnect.CreateTransitVirtualInterfaceInput) (*request.Request, *directconnect.CreateTransitVirtualInterfaceOutput)
|
||||
|
||||
DeleteBGPPeer(*directconnect.DeleteBGPPeerInput) (*directconnect.DeleteBGPPeerOutput, error)
|
||||
DeleteBGPPeerWithContext(aws.Context, *directconnect.DeleteBGPPeerInput, ...request.Option) (*directconnect.DeleteBGPPeerOutput, error)
|
||||
DeleteBGPPeerRequest(*directconnect.DeleteBGPPeerInput) (*request.Request, *directconnect.DeleteBGPPeerOutput)
|
||||
@@ -148,6 +168,10 @@ type DirectConnectAPI interface {
|
||||
DeleteDirectConnectGatewayAssociationWithContext(aws.Context, *directconnect.DeleteDirectConnectGatewayAssociationInput, ...request.Option) (*directconnect.DeleteDirectConnectGatewayAssociationOutput, error)
|
||||
DeleteDirectConnectGatewayAssociationRequest(*directconnect.DeleteDirectConnectGatewayAssociationInput) (*request.Request, *directconnect.DeleteDirectConnectGatewayAssociationOutput)
|
||||
|
||||
DeleteDirectConnectGatewayAssociationProposal(*directconnect.DeleteDirectConnectGatewayAssociationProposalInput) (*directconnect.DeleteDirectConnectGatewayAssociationProposalOutput, error)
|
||||
DeleteDirectConnectGatewayAssociationProposalWithContext(aws.Context, *directconnect.DeleteDirectConnectGatewayAssociationProposalInput, ...request.Option) (*directconnect.DeleteDirectConnectGatewayAssociationProposalOutput, error)
|
||||
DeleteDirectConnectGatewayAssociationProposalRequest(*directconnect.DeleteDirectConnectGatewayAssociationProposalInput) (*request.Request, *directconnect.DeleteDirectConnectGatewayAssociationProposalOutput)
|
||||
|
||||
DeleteInterconnect(*directconnect.DeleteInterconnectInput) (*directconnect.DeleteInterconnectOutput, error)
|
||||
DeleteInterconnectWithContext(aws.Context, *directconnect.DeleteInterconnectInput, ...request.Option) (*directconnect.DeleteInterconnectOutput, error)
|
||||
DeleteInterconnectRequest(*directconnect.DeleteInterconnectInput) (*request.Request, *directconnect.DeleteInterconnectOutput)
|
||||
@@ -172,6 +196,10 @@ type DirectConnectAPI interface {
|
||||
DescribeConnectionsOnInterconnectWithContext(aws.Context, *directconnect.DescribeConnectionsOnInterconnectInput, ...request.Option) (*directconnect.Connections, error)
|
||||
DescribeConnectionsOnInterconnectRequest(*directconnect.DescribeConnectionsOnInterconnectInput) (*request.Request, *directconnect.Connections)
|
||||
|
||||
DescribeDirectConnectGatewayAssociationProposals(*directconnect.DescribeDirectConnectGatewayAssociationProposalsInput) (*directconnect.DescribeDirectConnectGatewayAssociationProposalsOutput, error)
|
||||
DescribeDirectConnectGatewayAssociationProposalsWithContext(aws.Context, *directconnect.DescribeDirectConnectGatewayAssociationProposalsInput, ...request.Option) (*directconnect.DescribeDirectConnectGatewayAssociationProposalsOutput, error)
|
||||
DescribeDirectConnectGatewayAssociationProposalsRequest(*directconnect.DescribeDirectConnectGatewayAssociationProposalsInput) (*request.Request, *directconnect.DescribeDirectConnectGatewayAssociationProposalsOutput)
|
||||
|
||||
DescribeDirectConnectGatewayAssociations(*directconnect.DescribeDirectConnectGatewayAssociationsInput) (*directconnect.DescribeDirectConnectGatewayAssociationsOutput, error)
|
||||
DescribeDirectConnectGatewayAssociationsWithContext(aws.Context, *directconnect.DescribeDirectConnectGatewayAssociationsInput, ...request.Option) (*directconnect.DescribeDirectConnectGatewayAssociationsOutput, error)
|
||||
DescribeDirectConnectGatewayAssociationsRequest(*directconnect.DescribeDirectConnectGatewayAssociationsInput) (*request.Request, *directconnect.DescribeDirectConnectGatewayAssociationsOutput)
|
||||
@@ -232,9 +260,17 @@ type DirectConnectAPI interface {
|
||||
UntagResourceWithContext(aws.Context, *directconnect.UntagResourceInput, ...request.Option) (*directconnect.UntagResourceOutput, error)
|
||||
UntagResourceRequest(*directconnect.UntagResourceInput) (*request.Request, *directconnect.UntagResourceOutput)
|
||||
|
||||
UpdateDirectConnectGatewayAssociation(*directconnect.UpdateDirectConnectGatewayAssociationInput) (*directconnect.UpdateDirectConnectGatewayAssociationOutput, error)
|
||||
UpdateDirectConnectGatewayAssociationWithContext(aws.Context, *directconnect.UpdateDirectConnectGatewayAssociationInput, ...request.Option) (*directconnect.UpdateDirectConnectGatewayAssociationOutput, error)
|
||||
UpdateDirectConnectGatewayAssociationRequest(*directconnect.UpdateDirectConnectGatewayAssociationInput) (*request.Request, *directconnect.UpdateDirectConnectGatewayAssociationOutput)
|
||||
|
||||
UpdateLag(*directconnect.UpdateLagInput) (*directconnect.Lag, error)
|
||||
UpdateLagWithContext(aws.Context, *directconnect.UpdateLagInput, ...request.Option) (*directconnect.Lag, error)
|
||||
UpdateLagRequest(*directconnect.UpdateLagInput) (*request.Request, *directconnect.Lag)
|
||||
|
||||
UpdateVirtualInterfaceAttributes(*directconnect.UpdateVirtualInterfaceAttributesInput) (*directconnect.UpdateVirtualInterfaceAttributesOutput, error)
|
||||
UpdateVirtualInterfaceAttributesWithContext(aws.Context, *directconnect.UpdateVirtualInterfaceAttributesInput, ...request.Option) (*directconnect.UpdateVirtualInterfaceAttributesOutput, error)
|
||||
UpdateVirtualInterfaceAttributesRequest(*directconnect.UpdateVirtualInterfaceAttributesInput) (*request.Request, *directconnect.UpdateVirtualInterfaceAttributesOutput)
|
||||
}
|
||||
|
||||
var _ DirectConnectAPI = (*directconnect.DirectConnect)(nil)
|
||||
|
||||
+8
-11
@@ -4,17 +4,14 @@
|
||||
// requests to AWS Direct Connect.
|
||||
//
|
||||
// AWS Direct Connect links your internal network to an AWS Direct Connect location
|
||||
// over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end
|
||||
// of the cable is connected to your router, the other to an AWS Direct Connect
|
||||
// router. With this connection in place, you can create virtual interfaces
|
||||
// directly to the AWS cloud (for example, to Amazon Elastic Compute Cloud (Amazon
|
||||
// EC2) and Amazon Simple Storage Service (Amazon S3)) and to Amazon Virtual
|
||||
// Private Cloud (Amazon VPC), bypassing Internet service providers in your
|
||||
// network path. An AWS Direct Connect location provides access to AWS in the
|
||||
// region it is associated with, as well as access to other US regions. For
|
||||
// example, you can provision a single connection to any AWS Direct Connect
|
||||
// location in the US and use it to access public AWS services in all US Regions
|
||||
// and AWS GovCloud (US).
|
||||
// over a standard Ethernet fiber-optic cable. One end of the cable is connected
|
||||
// to your router, the other to an AWS Direct Connect router. With this connection
|
||||
// in place, you can create virtual interfaces directly to the AWS cloud (for
|
||||
// example, to Amazon EC2 and Amazon S3) and to Amazon VPC, bypassing Internet
|
||||
// service providers in your network path. A connection provides access to all
|
||||
// AWS Regions except the China (Beijing) and (China) Ningxia Regions. AWS resources
|
||||
// in the China Regions can only be accessed through locations associated with
|
||||
// those Regions.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25 for more information on this service.
|
||||
//
|
||||
|
||||
+7
-10
@@ -5,11 +5,10 @@ package directconnect
|
||||
const (
|
||||
|
||||
// ErrCodeClientException for service response error code
|
||||
// "ClientException".
|
||||
// "DirectConnectClientException".
|
||||
//
|
||||
// The API was called with invalid parameters. The error message will contain
|
||||
// additional details about the cause.
|
||||
ErrCodeClientException = "ClientException"
|
||||
// One or more parameters are not valid.
|
||||
ErrCodeClientException = "DirectConnectClientException"
|
||||
|
||||
// ErrCodeDuplicateTagKeysException for service response error code
|
||||
// "DuplicateTagKeysException".
|
||||
@@ -18,16 +17,14 @@ const (
|
||||
ErrCodeDuplicateTagKeysException = "DuplicateTagKeysException"
|
||||
|
||||
// ErrCodeServerException for service response error code
|
||||
// "ServerException".
|
||||
// "DirectConnectServerException".
|
||||
//
|
||||
// A server-side error occurred during the API call. The error message will
|
||||
// contain additional details about the cause.
|
||||
ErrCodeServerException = "ServerException"
|
||||
// A server-side error occurred.
|
||||
ErrCodeServerException = "DirectConnectServerException"
|
||||
|
||||
// ErrCodeTooManyTagsException for service response error code
|
||||
// "TooManyTagsException".
|
||||
//
|
||||
// You have reached the limit on the number of tags that can be assigned to
|
||||
// a Direct Connect resource.
|
||||
// You have reached the limit on the number of tags that can be assigned.
|
||||
ErrCodeTooManyTagsException = "TooManyTagsException"
|
||||
)
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// +build go1.10,integration
|
||||
|
||||
package directconnect_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/directconnect"
|
||||
)
|
||||
|
||||
var _ aws.Config
|
||||
var _ awserr.Error
|
||||
var _ request.Request
|
||||
|
||||
func TestInteg_00_DescribeConnections(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := directconnect.New(sess)
|
||||
params := &directconnect.DescribeConnectionsInput{}
|
||||
_, err := svc.DescribeConnectionsWithContext(ctx, params)
|
||||
if err != nil {
|
||||
t.Errorf("expect no error, got %v", err)
|
||||
}
|
||||
}
|
||||
func TestInteg_01_DescribeConnections(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := directconnect.New(sess)
|
||||
params := &directconnect.DescribeConnectionsInput{
|
||||
ConnectionId: aws.String("fake-connection"),
|
||||
}
|
||||
_, err := svc.DescribeConnectionsWithContext(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
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "directconnect" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
ServiceName = "directconnect" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "Direct Connect" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the DirectConnect 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,
|
||||
|
||||
Reference in New Issue
Block a user