mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-08 22:30:41 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+168
@@ -0,0 +1,168 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package apigatewaymanagementapi
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/private/protocol"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
const opPostToConnection = "PostToConnection"
|
||||
|
||||
// PostToConnectionRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the PostToConnection operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See PostToConnection for more information on using the PostToConnection
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
//
|
||||
// // Example sending a request using the PostToConnectionRequest method.
|
||||
// req, resp := client.PostToConnectionRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/PostToConnection
|
||||
func (c *ApiGatewayManagementApi) PostToConnectionRequest(input *PostToConnectionInput) (req *request.Request, output *PostToConnectionOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opPostToConnection,
|
||||
HTTPMethod: "POST",
|
||||
HTTPPath: "/@connections/{connectionId}",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &PostToConnectionInput{}
|
||||
}
|
||||
|
||||
output = &PostToConnectionOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
// PostToConnection API operation for AmazonApiGatewayManagementApi.
|
||||
//
|
||||
// Sends the provided data to the specified connection.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for AmazonApiGatewayManagementApi's
|
||||
// API operation PostToConnection for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeGoneException "GoneException"
|
||||
// The connection with the provided id no longer exists.
|
||||
//
|
||||
// * ErrCodeLimitExceededException "LimitExceededException"
|
||||
// The client is sending more than the allowed number of requests per unit of
|
||||
// time.
|
||||
//
|
||||
// * ErrCodePayloadTooLargeException "PayloadTooLargeException"
|
||||
// The data has exceeded the maximum size allowed.
|
||||
//
|
||||
// * ErrCodeForbiddenException "ForbiddenException"
|
||||
// The caller is not authorized to invoke this operation.
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29/PostToConnection
|
||||
func (c *ApiGatewayManagementApi) PostToConnection(input *PostToConnectionInput) (*PostToConnectionOutput, error) {
|
||||
req, out := c.PostToConnectionRequest(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// PostToConnectionWithContext is the same as PostToConnection with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See PostToConnection for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ApiGatewayManagementApi) PostToConnectionWithContext(ctx aws.Context, input *PostToConnectionInput, opts ...request.Option) (*PostToConnectionOutput, error) {
|
||||
req, out := c.PostToConnectionRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
type PostToConnectionInput struct {
|
||||
_ struct{} `type:"structure" payload:"Data"`
|
||||
|
||||
// ConnectionId is a required field
|
||||
ConnectionId *string `location:"uri" locationName:"connectionId" type:"string" required:"true"`
|
||||
|
||||
// The data to be sent to the client specified by its connection id.
|
||||
//
|
||||
// Data is a required field
|
||||
Data []byte `type:"blob" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s PostToConnectionInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s PostToConnectionInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *PostToConnectionInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "PostToConnectionInput"}
|
||||
if s.ConnectionId == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("ConnectionId"))
|
||||
}
|
||||
if s.ConnectionId != nil && len(*s.ConnectionId) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("ConnectionId", 1))
|
||||
}
|
||||
if s.Data == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Data"))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetConnectionId sets the ConnectionId field's value.
|
||||
func (s *PostToConnectionInput) SetConnectionId(v string) *PostToConnectionInput {
|
||||
s.ConnectionId = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetData sets the Data field's value.
|
||||
func (s *PostToConnectionInput) SetData(v []byte) *PostToConnectionInput {
|
||||
s.Data = v
|
||||
return s
|
||||
}
|
||||
|
||||
type PostToConnectionOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s PostToConnectionOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s PostToConnectionOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
Generated
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package apigatewaymanagementapiiface provides an interface to enable mocking the AmazonApiGatewayManagementApi service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package apigatewaymanagementapiiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/apigatewaymanagementapi"
|
||||
)
|
||||
|
||||
// ApiGatewayManagementApiAPI provides an interface to enable mocking the
|
||||
// apigatewaymanagementapi.ApiGatewayManagementApi service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AmazonApiGatewayManagementApi.
|
||||
// func myFunc(svc apigatewaymanagementapiiface.ApiGatewayManagementApiAPI) bool {
|
||||
// // Make svc.PostToConnection request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := apigatewaymanagementapi.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockApiGatewayManagementApiClient struct {
|
||||
// apigatewaymanagementapiiface.ApiGatewayManagementApiAPI
|
||||
// }
|
||||
// func (m *mockApiGatewayManagementApiClient) PostToConnection(input *apigatewaymanagementapi.PostToConnectionInput) (*apigatewaymanagementapi.PostToConnectionOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockApiGatewayManagementApiClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type ApiGatewayManagementApiAPI interface {
|
||||
PostToConnection(*apigatewaymanagementapi.PostToConnectionInput) (*apigatewaymanagementapi.PostToConnectionOutput, error)
|
||||
PostToConnectionWithContext(aws.Context, *apigatewaymanagementapi.PostToConnectionInput, ...request.Option) (*apigatewaymanagementapi.PostToConnectionOutput, error)
|
||||
PostToConnectionRequest(*apigatewaymanagementapi.PostToConnectionInput) (*request.Request, *apigatewaymanagementapi.PostToConnectionOutput)
|
||||
}
|
||||
|
||||
var _ ApiGatewayManagementApiAPI = (*apigatewaymanagementapi.ApiGatewayManagementApi)(nil)
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package apigatewaymanagementapi provides the client and types for making API
|
||||
// requests to AmazonApiGatewayManagementApi.
|
||||
//
|
||||
// The Amazon API Gateway Management API allows you to directly manage runtime
|
||||
// aspects of your deployed APIs. To use it, you must explicitly set the SDK's
|
||||
// endpoint to point to the endpoint of your deployed API. The endpoint will
|
||||
// be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage},
|
||||
// or will be the endpoint corresponding to your API's custom domain and base
|
||||
// path, if applicable.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/apigatewaymanagementapi-2018-11-29 for more information on this service.
|
||||
//
|
||||
// See apigatewaymanagementapi package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/apigatewaymanagementapi/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AmazonApiGatewayManagementApi with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AmazonApiGatewayManagementApi client ApiGatewayManagementApi for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/apigatewaymanagementapi/#New
|
||||
package apigatewaymanagementapi
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package apigatewaymanagementapi
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeForbiddenException for service response error code
|
||||
// "ForbiddenException".
|
||||
//
|
||||
// The caller is not authorized to invoke this operation.
|
||||
ErrCodeForbiddenException = "ForbiddenException"
|
||||
|
||||
// ErrCodeGoneException for service response error code
|
||||
// "GoneException".
|
||||
//
|
||||
// The connection with the provided id no longer exists.
|
||||
ErrCodeGoneException = "GoneException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// The client is sending more than the allowed number of requests per unit of
|
||||
// time.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodePayloadTooLargeException for service response error code
|
||||
// "PayloadTooLargeException".
|
||||
//
|
||||
// The data has exceeded the maximum size allowed.
|
||||
ErrCodePayloadTooLargeException = "PayloadTooLargeException"
|
||||
)
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package apigatewaymanagementapi
|
||||
|
||||
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/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// ApiGatewayManagementApi provides the API operation methods for making requests to
|
||||
// AmazonApiGatewayManagementApi. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ApiGatewayManagementApi methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type ApiGatewayManagementApi 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)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "ApiGatewayManagementApi" // Name of service.
|
||||
EndpointsID = "execute-api" // ID to lookup a service endpoint with.
|
||||
ServiceID = "ApiGatewayManagementApi" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ApiGatewayManagementApi 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 ApiGatewayManagementApi client from just a session.
|
||||
// svc := apigatewaymanagementapi.New(mySession)
|
||||
//
|
||||
// // Create a ApiGatewayManagementApi client with additional configuration
|
||||
// svc := apigatewaymanagementapi.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApiGatewayManagementApi {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = "execute-api"
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ApiGatewayManagementApi {
|
||||
svc := &ApiGatewayManagementApi{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2018-11-29",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a ApiGatewayManagementApi operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ApiGatewayManagementApi) 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
|
||||
}
|
||||
Reference in New Issue
Block a user