Switch to using the dep tool and update all the dependencies

This commit is contained in:
Nick Craig-Wood
2017-05-11 15:39:54 +01:00
parent 5135ff73cb
commit 98c2d2c41b
5321 changed files with 4483197 additions and 5918 deletions
File diff suppressed because it is too large Load Diff
+117
View File
@@ -0,0 +1,117 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package health provides the client and types for making API
// requests to AWS Health APIs and Notifications.
//
// The AWS Health API provides programmatic access to the AWS Health information
// that is presented in the AWS Personal Health Dashboard (https://phd.aws.amazon.com/phd/home#/).
// You can get information about events that affect your AWS resources:
//
// * DescribeEvents: Summary information about events.
//
// * DescribeEventDetails: Detailed information about one or more events.
//
// * DescribeAffectedEntities: Information about AWS resources that are affected
// by one or more events.
//
// In addition, these operations provide information about event types and summary
// counts of events or affected entities:
//
// * DescribeEventTypes: Information about the kinds of events that AWS Health
// tracks.
//
// * DescribeEventAggregates: A count of the number of events that meet specified
// criteria.
//
// * DescribeEntityAggregates: A count of the number of affected entities
// that meet specified criteria.
//
// The Health API requires a Business or Enterprise support plan from AWS Support
// (http://aws.amazon.com/premiumsupport/). Calling the Health API from an account
// that does not have a Business or Enterprise support plan causes a SubscriptionRequiredException.
//
// For authentication of requests, AWS Health uses the Signature Version 4 Signing
// Process (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
//
// See the AWS Health User Guide (http://docs.aws.amazon.com/health/latest/ug/what-is-aws-health.html)
// for information about how to use the API.
//
// Service Endpoint
//
// The HTTP endpoint for the AWS Health API is:
//
// * https://health.us-east-1.amazonaws.com
//
// See https://docs.aws.amazon.com/goto/WebAPI/health-2016-08-04 for more information on this service.
//
// See health package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/health/
//
// Using the Client
//
// To use the client for AWS Health APIs and Notifications you will first need
// to create a new instance of it.
//
// When creating a client for an AWS service you'll first need to have a Session
// already created. The Session provides configuration that can be shared
// between multiple service clients. Additional configuration can be applied to
// the Session and service's client when they are constructed. The aws package's
// Config type contains several fields such as Region for the AWS Region the
// client should make API requests too. The optional Config value can be provided
// as the variadic argument for Sessions and client creation.
//
// Once the service's client is created you can use it to make API requests the
// AWS service. These clients are safe to use concurrently.
//
// // Create a session to share configuration, and load external configuration.
// sess := session.Must(session.NewSession())
//
// // Create the service's client with the session.
// svc := health.New(sess)
//
// See the SDK's documentation for more information on how to use service clients.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws package's Config type for more information on configuration options.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS Health APIs and Notifications client Health for more
// information on creating the service's client.
// https://docs.aws.amazon.com/sdk-for-go/api/service/health/#New
//
// Once the client is created you can make an API request to the service.
// Each API method takes a input parameter, and returns the service response
// and an error.
//
// The API method will document which error codes the service can be returned
// by the operation if the service models the API operation's errors. These
// errors will also be available as const strings prefixed with "ErrCode".
//
// result, err := svc.DescribeAffectedEntities(params)
// if err != nil {
// // Cast err to awserr.Error to handle specific error codes.
// aerr, ok := err.(awserr.Error)
// if ok && aerr.Code() == <error code to check for> {
// // Specific error code handling
// }
// return err
// }
//
// fmt.Println("DescribeAffectedEntities result:")
// fmt.Println(result)
//
// Using the Client with Context
//
// The service's client also provides methods to make API requests with a Context
// value. This allows you to control the timeout, and cancellation of pending
// requests. These methods also take request Option as variadic parameter to apply
// additional configuration to the API request.
//
// ctx := context.Background()
//
// result, err := svc.DescribeAffectedEntitiesWithContext(ctx, params)
//
// See the request package documentation for more information on using Context pattern
// with the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
package health
+18
View File
@@ -0,0 +1,18 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package health
const (
// ErrCodeInvalidPaginationToken for service response error code
// "InvalidPaginationToken".
//
// The specified pagination token (nextToken) is not valid.
ErrCodeInvalidPaginationToken = "InvalidPaginationToken"
// ErrCodeUnsupportedLocale for service response error code
// "UnsupportedLocale".
//
// The specified locale is not supported.
ErrCodeUnsupportedLocale = "UnsupportedLocale"
)
+335
View File
@@ -0,0 +1,335 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package health_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/health"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleHealth_DescribeAffectedEntities() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeAffectedEntitiesInput{
Filter: &health.EntityFilter{ // Required
EventArns: []*string{ // Required
aws.String("eventArn"), // Required
// More values...
},
EntityArns: []*string{
aws.String("entityArn"), // Required
// More values...
},
EntityValues: []*string{
aws.String("entityValue"), // Required
// More values...
},
LastUpdatedTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
StatusCodes: []*string{
aws.String("entityStatusCode"), // Required
// More values...
},
Tags: []map[string]*string{
{ // Required
"Key": aws.String("tagValue"), // Required
// More values...
},
// More values...
},
},
Locale: aws.String("locale"),
MaxResults: aws.Int64(1),
NextToken: aws.String("nextToken"),
}
resp, err := svc.DescribeAffectedEntities(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleHealth_DescribeEntityAggregates() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeEntityAggregatesInput{
EventArns: []*string{
aws.String("eventArn"), // Required
// More values...
},
}
resp, err := svc.DescribeEntityAggregates(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleHealth_DescribeEventAggregates() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeEventAggregatesInput{
AggregateField: aws.String("eventAggregateField"), // Required
Filter: &health.EventFilter{
AvailabilityZones: []*string{
aws.String("availabilityZone"), // Required
// More values...
},
EndTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
EntityArns: []*string{
aws.String("entityArn"), // Required
// More values...
},
EntityValues: []*string{
aws.String("entityValue"), // Required
// More values...
},
EventArns: []*string{
aws.String("eventArn"), // Required
// More values...
},
EventStatusCodes: []*string{
aws.String("eventStatusCode"), // Required
// More values...
},
EventTypeCategories: []*string{
aws.String("eventTypeCategory"), // Required
// More values...
},
EventTypeCodes: []*string{
aws.String("eventType"), // Required
// More values...
},
LastUpdatedTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
Regions: []*string{
aws.String("region"), // Required
// More values...
},
Services: []*string{
aws.String("service"), // Required
// More values...
},
StartTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
Tags: []map[string]*string{
{ // Required
"Key": aws.String("tagValue"), // Required
// More values...
},
// More values...
},
},
MaxResults: aws.Int64(1),
NextToken: aws.String("nextToken"),
}
resp, err := svc.DescribeEventAggregates(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleHealth_DescribeEventDetails() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeEventDetailsInput{
EventArns: []*string{ // Required
aws.String("eventArn"), // Required
// More values...
},
Locale: aws.String("locale"),
}
resp, err := svc.DescribeEventDetails(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleHealth_DescribeEventTypes() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeEventTypesInput{
Filter: &health.EventTypeFilter{
EventTypeCategories: []*string{
aws.String("eventTypeCategory"), // Required
// More values...
},
EventTypeCodes: []*string{
aws.String("eventTypeCode"), // Required
// More values...
},
Services: []*string{
aws.String("service"), // Required
// More values...
},
},
Locale: aws.String("locale"),
MaxResults: aws.Int64(1),
NextToken: aws.String("nextToken"),
}
resp, err := svc.DescribeEventTypes(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleHealth_DescribeEvents() {
sess := session.Must(session.NewSession())
svc := health.New(sess)
params := &health.DescribeEventsInput{
Filter: &health.EventFilter{
AvailabilityZones: []*string{
aws.String("availabilityZone"), // Required
// More values...
},
EndTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
EntityArns: []*string{
aws.String("entityArn"), // Required
// More values...
},
EntityValues: []*string{
aws.String("entityValue"), // Required
// More values...
},
EventArns: []*string{
aws.String("eventArn"), // Required
// More values...
},
EventStatusCodes: []*string{
aws.String("eventStatusCode"), // Required
// More values...
},
EventTypeCategories: []*string{
aws.String("eventTypeCategory"), // Required
// More values...
},
EventTypeCodes: []*string{
aws.String("eventType"), // Required
// More values...
},
LastUpdatedTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
Regions: []*string{
aws.String("region"), // Required
// More values...
},
Services: []*string{
aws.String("service"), // Required
// More values...
},
StartTimes: []*health.DateTimeRange{
{ // Required
From: aws.Time(time.Now()),
To: aws.Time(time.Now()),
},
// More values...
},
Tags: []map[string]*string{
{ // Required
"Key": aws.String("tagValue"), // Required
// More values...
},
// More values...
},
},
Locale: aws.String("locale"),
MaxResults: aws.Int64(1),
NextToken: aws.String("nextToken"),
}
resp, err := svc.DescribeEvents(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
@@ -0,0 +1,100 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package healthiface provides an interface to enable mocking the AWS Health APIs and Notifications 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 healthiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/health"
)
// HealthAPI provides an interface to enable mocking the
// health.Health 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 the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // AWS Health APIs and Notifications.
// func myFunc(svc healthiface.HealthAPI) bool {
// // Make svc.DescribeAffectedEntities request
// }
//
// func main() {
// sess := session.New()
// svc := health.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockHealthClient struct {
// healthiface.HealthAPI
// }
// func (m *mockHealthClient) DescribeAffectedEntities(input *health.DescribeAffectedEntitiesInput) (*health.DescribeAffectedEntitiesOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockHealthClient{}
//
// 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 HealthAPI interface {
DescribeAffectedEntities(*health.DescribeAffectedEntitiesInput) (*health.DescribeAffectedEntitiesOutput, error)
DescribeAffectedEntitiesWithContext(aws.Context, *health.DescribeAffectedEntitiesInput, ...request.Option) (*health.DescribeAffectedEntitiesOutput, error)
DescribeAffectedEntitiesRequest(*health.DescribeAffectedEntitiesInput) (*request.Request, *health.DescribeAffectedEntitiesOutput)
DescribeAffectedEntitiesPages(*health.DescribeAffectedEntitiesInput, func(*health.DescribeAffectedEntitiesOutput, bool) bool) error
DescribeAffectedEntitiesPagesWithContext(aws.Context, *health.DescribeAffectedEntitiesInput, func(*health.DescribeAffectedEntitiesOutput, bool) bool, ...request.Option) error
DescribeEntityAggregates(*health.DescribeEntityAggregatesInput) (*health.DescribeEntityAggregatesOutput, error)
DescribeEntityAggregatesWithContext(aws.Context, *health.DescribeEntityAggregatesInput, ...request.Option) (*health.DescribeEntityAggregatesOutput, error)
DescribeEntityAggregatesRequest(*health.DescribeEntityAggregatesInput) (*request.Request, *health.DescribeEntityAggregatesOutput)
DescribeEventAggregates(*health.DescribeEventAggregatesInput) (*health.DescribeEventAggregatesOutput, error)
DescribeEventAggregatesWithContext(aws.Context, *health.DescribeEventAggregatesInput, ...request.Option) (*health.DescribeEventAggregatesOutput, error)
DescribeEventAggregatesRequest(*health.DescribeEventAggregatesInput) (*request.Request, *health.DescribeEventAggregatesOutput)
DescribeEventAggregatesPages(*health.DescribeEventAggregatesInput, func(*health.DescribeEventAggregatesOutput, bool) bool) error
DescribeEventAggregatesPagesWithContext(aws.Context, *health.DescribeEventAggregatesInput, func(*health.DescribeEventAggregatesOutput, bool) bool, ...request.Option) error
DescribeEventDetails(*health.DescribeEventDetailsInput) (*health.DescribeEventDetailsOutput, error)
DescribeEventDetailsWithContext(aws.Context, *health.DescribeEventDetailsInput, ...request.Option) (*health.DescribeEventDetailsOutput, error)
DescribeEventDetailsRequest(*health.DescribeEventDetailsInput) (*request.Request, *health.DescribeEventDetailsOutput)
DescribeEventTypes(*health.DescribeEventTypesInput) (*health.DescribeEventTypesOutput, error)
DescribeEventTypesWithContext(aws.Context, *health.DescribeEventTypesInput, ...request.Option) (*health.DescribeEventTypesOutput, error)
DescribeEventTypesRequest(*health.DescribeEventTypesInput) (*request.Request, *health.DescribeEventTypesOutput)
DescribeEventTypesPages(*health.DescribeEventTypesInput, func(*health.DescribeEventTypesOutput, bool) bool) error
DescribeEventTypesPagesWithContext(aws.Context, *health.DescribeEventTypesInput, func(*health.DescribeEventTypesOutput, bool) bool, ...request.Option) error
DescribeEvents(*health.DescribeEventsInput) (*health.DescribeEventsOutput, error)
DescribeEventsWithContext(aws.Context, *health.DescribeEventsInput, ...request.Option) (*health.DescribeEventsOutput, error)
DescribeEventsRequest(*health.DescribeEventsInput) (*request.Request, *health.DescribeEventsOutput)
DescribeEventsPages(*health.DescribeEventsInput, func(*health.DescribeEventsOutput, bool) bool) error
DescribeEventsPagesWithContext(aws.Context, *health.DescribeEventsInput, func(*health.DescribeEventsOutput, bool) bool, ...request.Option) error
}
var _ HealthAPI = (*health.Health)(nil)
+95
View File
@@ -0,0 +1,95 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package health
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/jsonrpc"
)
// Health provides the API operation methods for making requests to
// AWS Health APIs and Notifications. See this package's package overview docs
// for details on the service.
//
// Health methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type Health 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 = "health" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the Health 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 Health client from just a session.
// svc := health.New(mySession)
//
// // Create a Health client with additional configuration
// svc := health.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Health {
c := p.ClientConfig(EndpointsID, cfgs...)
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) *Health {
svc := &Health{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2016-08-04",
JSONVersion: "1.1",
TargetPrefix: "AWSHealth_20160804",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a Health operation and runs any
// custom request initialization.
func (c *Health) 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
}