mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+8
-6
@@ -15,7 +15,7 @@ const opDeleteThingShadow = "DeleteThingShadow"
|
||||
// DeleteThingShadowRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteThingShadow operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfuly.
|
||||
// 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.
|
||||
@@ -115,7 +115,7 @@ const opGetThingShadow = "GetThingShadow"
|
||||
// GetThingShadowRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the GetThingShadow operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfuly.
|
||||
// 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.
|
||||
@@ -215,7 +215,7 @@ const opPublish = "Publish"
|
||||
// PublishRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the Publish operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfuly.
|
||||
// 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.
|
||||
@@ -247,8 +247,7 @@ func (c *IoTDataPlane) PublishRequest(input *PublishInput) (req *request.Request
|
||||
|
||||
output = &PublishOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler)
|
||||
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
|
||||
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -305,7 +304,7 @@ const opUpdateThingShadow = "UpdateThingShadow"
|
||||
// UpdateThingShadowRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the UpdateThingShadow operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfuly.
|
||||
// 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.
|
||||
@@ -569,6 +568,9 @@ func (s *PublishInput) Validate() error {
|
||||
if s.Topic == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Topic"))
|
||||
}
|
||||
if s.Topic != nil && len(*s.Topic) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("Topic", 1))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// +build integration
|
||||
|
||||
package iotdataplane_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/awstesting/integration"
|
||||
"github.com/aws/aws-sdk-go/service/iot"
|
||||
"github.com/aws/aws-sdk-go/service/iotdataplane"
|
||||
)
|
||||
|
||||
func TestInteg_DescribeEndpoint(t *testing.T) {
|
||||
sess := integration.Session.Copy()
|
||||
if v := aws.StringValue(sess.Config.Region); len(v) == 0 {
|
||||
sess.Config.Region = aws.String("us-east-1")
|
||||
}
|
||||
|
||||
ctrlSvc := iot.New(sess)
|
||||
descResp, err := ctrlSvc.DescribeEndpoint(&iot.DescribeEndpointInput{})
|
||||
if err != nil {
|
||||
t.Fatalf("failed to get dataplane endpoint, %v", err)
|
||||
}
|
||||
|
||||
dataSvc := iotdataplane.New(sess, &aws.Config{
|
||||
Endpoint: descResp.EndpointAddress,
|
||||
})
|
||||
_, err = dataSvc.GetThingShadow(&iotdataplane.GetThingShadowInput{
|
||||
ThingName: aws.String("fake-thing"),
|
||||
})
|
||||
if err == nil {
|
||||
t.Fatalf("expect error")
|
||||
}
|
||||
|
||||
aerr, ok := err.(awserr.Error)
|
||||
if !ok {
|
||||
t.Fatalf("expect awserr.Error, got %T, %v", err, err)
|
||||
}
|
||||
if e, a := "ResourceNotFoundException", aerr.Code(); e != a {
|
||||
t.Errorf("expect %v error, got %v", e, aerr)
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "data.iot" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
ServiceName = "data.iot" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "IoT Data Plane" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the IoTDataPlane client with a session.
|
||||
@@ -63,6 +64,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