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 4483201 additions and 5922 deletions

3183
vendor/github.com/aws/aws-sdk-go/service/codestar/api.go generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,124 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package codestariface provides an interface to enable mocking the AWS CodeStar 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 codestariface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/codestar"
)
// CodeStarAPI provides an interface to enable mocking the
// codestar.CodeStar 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 CodeStar.
// func myFunc(svc codestariface.CodeStarAPI) bool {
// // Make svc.AssociateTeamMember request
// }
//
// func main() {
// sess := session.New()
// svc := codestar.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockCodeStarClient struct {
// codestariface.CodeStarAPI
// }
// func (m *mockCodeStarClient) AssociateTeamMember(input *codestar.AssociateTeamMemberInput) (*codestar.AssociateTeamMemberOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockCodeStarClient{}
//
// 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 CodeStarAPI interface {
AssociateTeamMember(*codestar.AssociateTeamMemberInput) (*codestar.AssociateTeamMemberOutput, error)
AssociateTeamMemberWithContext(aws.Context, *codestar.AssociateTeamMemberInput, ...request.Option) (*codestar.AssociateTeamMemberOutput, error)
AssociateTeamMemberRequest(*codestar.AssociateTeamMemberInput) (*request.Request, *codestar.AssociateTeamMemberOutput)
CreateProject(*codestar.CreateProjectInput) (*codestar.CreateProjectOutput, error)
CreateProjectWithContext(aws.Context, *codestar.CreateProjectInput, ...request.Option) (*codestar.CreateProjectOutput, error)
CreateProjectRequest(*codestar.CreateProjectInput) (*request.Request, *codestar.CreateProjectOutput)
CreateUserProfile(*codestar.CreateUserProfileInput) (*codestar.CreateUserProfileOutput, error)
CreateUserProfileWithContext(aws.Context, *codestar.CreateUserProfileInput, ...request.Option) (*codestar.CreateUserProfileOutput, error)
CreateUserProfileRequest(*codestar.CreateUserProfileInput) (*request.Request, *codestar.CreateUserProfileOutput)
DeleteProject(*codestar.DeleteProjectInput) (*codestar.DeleteProjectOutput, error)
DeleteProjectWithContext(aws.Context, *codestar.DeleteProjectInput, ...request.Option) (*codestar.DeleteProjectOutput, error)
DeleteProjectRequest(*codestar.DeleteProjectInput) (*request.Request, *codestar.DeleteProjectOutput)
DeleteUserProfile(*codestar.DeleteUserProfileInput) (*codestar.DeleteUserProfileOutput, error)
DeleteUserProfileWithContext(aws.Context, *codestar.DeleteUserProfileInput, ...request.Option) (*codestar.DeleteUserProfileOutput, error)
DeleteUserProfileRequest(*codestar.DeleteUserProfileInput) (*request.Request, *codestar.DeleteUserProfileOutput)
DescribeProject(*codestar.DescribeProjectInput) (*codestar.DescribeProjectOutput, error)
DescribeProjectWithContext(aws.Context, *codestar.DescribeProjectInput, ...request.Option) (*codestar.DescribeProjectOutput, error)
DescribeProjectRequest(*codestar.DescribeProjectInput) (*request.Request, *codestar.DescribeProjectOutput)
DescribeUserProfile(*codestar.DescribeUserProfileInput) (*codestar.DescribeUserProfileOutput, error)
DescribeUserProfileWithContext(aws.Context, *codestar.DescribeUserProfileInput, ...request.Option) (*codestar.DescribeUserProfileOutput, error)
DescribeUserProfileRequest(*codestar.DescribeUserProfileInput) (*request.Request, *codestar.DescribeUserProfileOutput)
DisassociateTeamMember(*codestar.DisassociateTeamMemberInput) (*codestar.DisassociateTeamMemberOutput, error)
DisassociateTeamMemberWithContext(aws.Context, *codestar.DisassociateTeamMemberInput, ...request.Option) (*codestar.DisassociateTeamMemberOutput, error)
DisassociateTeamMemberRequest(*codestar.DisassociateTeamMemberInput) (*request.Request, *codestar.DisassociateTeamMemberOutput)
ListProjects(*codestar.ListProjectsInput) (*codestar.ListProjectsOutput, error)
ListProjectsWithContext(aws.Context, *codestar.ListProjectsInput, ...request.Option) (*codestar.ListProjectsOutput, error)
ListProjectsRequest(*codestar.ListProjectsInput) (*request.Request, *codestar.ListProjectsOutput)
ListResources(*codestar.ListResourcesInput) (*codestar.ListResourcesOutput, error)
ListResourcesWithContext(aws.Context, *codestar.ListResourcesInput, ...request.Option) (*codestar.ListResourcesOutput, error)
ListResourcesRequest(*codestar.ListResourcesInput) (*request.Request, *codestar.ListResourcesOutput)
ListTeamMembers(*codestar.ListTeamMembersInput) (*codestar.ListTeamMembersOutput, error)
ListTeamMembersWithContext(aws.Context, *codestar.ListTeamMembersInput, ...request.Option) (*codestar.ListTeamMembersOutput, error)
ListTeamMembersRequest(*codestar.ListTeamMembersInput) (*request.Request, *codestar.ListTeamMembersOutput)
ListUserProfiles(*codestar.ListUserProfilesInput) (*codestar.ListUserProfilesOutput, error)
ListUserProfilesWithContext(aws.Context, *codestar.ListUserProfilesInput, ...request.Option) (*codestar.ListUserProfilesOutput, error)
ListUserProfilesRequest(*codestar.ListUserProfilesInput) (*request.Request, *codestar.ListUserProfilesOutput)
UpdateProject(*codestar.UpdateProjectInput) (*codestar.UpdateProjectOutput, error)
UpdateProjectWithContext(aws.Context, *codestar.UpdateProjectInput, ...request.Option) (*codestar.UpdateProjectOutput, error)
UpdateProjectRequest(*codestar.UpdateProjectInput) (*request.Request, *codestar.UpdateProjectOutput)
UpdateTeamMember(*codestar.UpdateTeamMemberInput) (*codestar.UpdateTeamMemberOutput, error)
UpdateTeamMemberWithContext(aws.Context, *codestar.UpdateTeamMemberInput, ...request.Option) (*codestar.UpdateTeamMemberOutput, error)
UpdateTeamMemberRequest(*codestar.UpdateTeamMemberInput) (*request.Request, *codestar.UpdateTeamMemberOutput)
UpdateUserProfile(*codestar.UpdateUserProfileInput) (*codestar.UpdateUserProfileOutput, error)
UpdateUserProfileWithContext(aws.Context, *codestar.UpdateUserProfileInput, ...request.Option) (*codestar.UpdateUserProfileOutput, error)
UpdateUserProfileRequest(*codestar.UpdateUserProfileInput) (*request.Request, *codestar.UpdateUserProfileOutput)
}
var _ CodeStarAPI = (*codestar.CodeStar)(nil)

View file

@ -0,0 +1,123 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package codestar provides the client and types for making API
// requests to AWS CodeStar.
//
// This is the API reference for AWS CodeStar. This reference provides descriptions
// of the operations and data types for the AWS CodeStar API along with usage
// examples.
//
// You can use the AWS CodeStar API to work with:
//
// Projects and their resources, by calling the following:
//
// * DeleteProject, which deletes a project in AWS CodeStar.
//
// * DescribeProject, which lists the attributes of a project.
//
// * ListProjects, which lists all AWS CodeStar projects associated with
// your AWS account.
//
// * ListResources, which lists the resources associated with an AWS CodeStar
// project.
//
// * UpdateProject, which updates the attributes of an AWS CodeStar project.
//
// Teams and team members, by calling the following:
//
// * AssociateTeamMember, which adds an IAM user to the team for an AWS CodeStar
// project.
//
// * DisassociateTeamMember, which removes an IAM user from the team for
// an AWS CodeStar project.
//
// * ListTeamMembers, which lists all the IAM users in the team for an AWS
// CodeStar project, including their roles and attributes.
//
// Users, by calling the following:
//
// * CreateUserProfile, which creates a user profile that contains data associated
// with the user across all AWS CodeStar projects.
//
// * DeleteUserProfile, which deletes all user profile information across
// all AWS CodeStar projects.
//
// * DescribeUserProfile, which describes the profile of a user.
//
// * ListUserProfiles, which lists all AWS CodeStar user profiles.
//
// * UpdateUserProfile, which updates the profile for an AWS CodeStar user.
//
// See https://docs.aws.amazon.com/goto/WebAPI/codestar-2017-04-19 for more information on this service.
//
// See codestar package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/codestar/
//
// Using the Client
//
// To use the client for AWS CodeStar 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 := codestar.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 CodeStar client CodeStar for more
// information on creating the service's client.
// https://docs.aws.amazon.com/sdk-for-go/api/service/codestar/#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.AssociateTeamMember(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("AssociateTeamMember 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.AssociateTeamMemberWithContext(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 codestar

View file

@ -0,0 +1,91 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codestar
const (
// ErrCodeConcurrentModificationException for service response error code
// "ConcurrentModificationException".
//
// Another modification is being made. That modification must complete before
// you can make your change.
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
// ErrCodeInvalidNextTokenException for service response error code
// "InvalidNextTokenException".
//
// The next token is not valid.
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
// ErrCodeInvalidServiceRoleException for service response error code
// "InvalidServiceRoleException".
//
// The service role is not valid.
ErrCodeInvalidServiceRoleException = "InvalidServiceRoleException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// A resource limit has been exceeded.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeProjectAlreadyExistsException for service response error code
// "ProjectAlreadyExistsException".
//
// An AWS CodeStar project with the same ID already exists in this region for
// the AWS account. AWS CodeStar project IDs must be unique within a region
// for the AWS account.
ErrCodeProjectAlreadyExistsException = "ProjectAlreadyExistsException"
// ErrCodeProjectConfigurationException for service response error code
// "ProjectConfigurationException".
//
// Project configuration information is required but not specified.
ErrCodeProjectConfigurationException = "ProjectConfigurationException"
// ErrCodeProjectCreationFailedException for service response error code
// "ProjectCreationFailedException".
//
// The project creation request was valid, but a nonspecific exception or error
// occurred during project creation. The project could not be created in AWS
// CodeStar.
ErrCodeProjectCreationFailedException = "ProjectCreationFailedException"
// ErrCodeProjectNotFoundException for service response error code
// "ProjectNotFoundException".
//
// The specified AWS CodeStar project was not found.
ErrCodeProjectNotFoundException = "ProjectNotFoundException"
// ErrCodeTeamMemberAlreadyAssociatedException for service response error code
// "TeamMemberAlreadyAssociatedException".
//
// The team member is already associated with a role in this project.
ErrCodeTeamMemberAlreadyAssociatedException = "TeamMemberAlreadyAssociatedException"
// ErrCodeTeamMemberNotFoundException for service response error code
// "TeamMemberNotFoundException".
//
// The specified team member was not found.
ErrCodeTeamMemberNotFoundException = "TeamMemberNotFoundException"
// ErrCodeUserProfileAlreadyExistsException for service response error code
// "UserProfileAlreadyExistsException".
//
// A user profile with that name already exists in this region for the AWS account.
// AWS CodeStar user profile names must be unique within a region for the AWS
// account.
ErrCodeUserProfileAlreadyExistsException = "UserProfileAlreadyExistsException"
// ErrCodeUserProfileNotFoundException for service response error code
// "UserProfileNotFoundException".
//
// The user profile was not found.
ErrCodeUserProfileNotFoundException = "UserProfileNotFoundException"
// ErrCodeValidationException for service response error code
// "ValidationException".
//
// The specified input is either not valid, or it could not be validated.
ErrCodeValidationException = "ValidationException"
)

View file

@ -0,0 +1,358 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codestar_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/codestar"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleCodeStar_AssociateTeamMember() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.AssociateTeamMemberInput{
ProjectId: aws.String("ProjectId"), // Required
ProjectRole: aws.String("Role"), // Required
UserArn: aws.String("UserArn"), // Required
ClientRequestToken: aws.String("ClientRequestToken"),
RemoteAccessAllowed: aws.Bool(true),
}
resp, err := svc.AssociateTeamMember(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 ExampleCodeStar_CreateProject() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.CreateProjectInput{
Id: aws.String("ProjectId"), // Required
Name: aws.String("ProjectName"), // Required
ClientRequestToken: aws.String("ClientRequestToken"),
Description: aws.String("ProjectDescription"),
}
resp, err := svc.CreateProject(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 ExampleCodeStar_CreateUserProfile() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.CreateUserProfileInput{
DisplayName: aws.String("UserProfileDisplayName"), // Required
EmailAddress: aws.String("Email"), // Required
UserArn: aws.String("UserArn"), // Required
SshPublicKey: aws.String("SshPublicKey"),
}
resp, err := svc.CreateUserProfile(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 ExampleCodeStar_DeleteProject() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.DeleteProjectInput{
Id: aws.String("ProjectId"), // Required
ClientRequestToken: aws.String("ClientRequestToken"),
DeleteStack: aws.Bool(true),
}
resp, err := svc.DeleteProject(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 ExampleCodeStar_DeleteUserProfile() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.DeleteUserProfileInput{
UserArn: aws.String("UserArn"), // Required
}
resp, err := svc.DeleteUserProfile(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 ExampleCodeStar_DescribeProject() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.DescribeProjectInput{
Id: aws.String("ProjectId"), // Required
}
resp, err := svc.DescribeProject(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 ExampleCodeStar_DescribeUserProfile() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.DescribeUserProfileInput{
UserArn: aws.String("UserArn"), // Required
}
resp, err := svc.DescribeUserProfile(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 ExampleCodeStar_DisassociateTeamMember() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.DisassociateTeamMemberInput{
ProjectId: aws.String("ProjectId"), // Required
UserArn: aws.String("UserArn"), // Required
}
resp, err := svc.DisassociateTeamMember(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 ExampleCodeStar_ListProjects() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.ListProjectsInput{
MaxResults: aws.Int64(1),
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.ListProjects(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 ExampleCodeStar_ListResources() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.ListResourcesInput{
ProjectId: aws.String("ProjectId"), // Required
MaxResults: aws.Int64(1),
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.ListResources(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 ExampleCodeStar_ListTeamMembers() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.ListTeamMembersInput{
ProjectId: aws.String("ProjectId"), // Required
MaxResults: aws.Int64(1),
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.ListTeamMembers(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 ExampleCodeStar_ListUserProfiles() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.ListUserProfilesInput{
MaxResults: aws.Int64(1),
NextToken: aws.String("PaginationToken"),
}
resp, err := svc.ListUserProfiles(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 ExampleCodeStar_UpdateProject() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.UpdateProjectInput{
Id: aws.String("ProjectId"), // Required
Description: aws.String("ProjectDescription"),
Name: aws.String("ProjectName"),
}
resp, err := svc.UpdateProject(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 ExampleCodeStar_UpdateTeamMember() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.UpdateTeamMemberInput{
ProjectId: aws.String("ProjectId"), // Required
UserArn: aws.String("UserArn"), // Required
ProjectRole: aws.String("Role"),
RemoteAccessAllowed: aws.Bool(true),
}
resp, err := svc.UpdateTeamMember(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 ExampleCodeStar_UpdateUserProfile() {
sess := session.Must(session.NewSession())
svc := codestar.New(sess)
params := &codestar.UpdateUserProfileInput{
UserArn: aws.String("UserArn"), // Required
DisplayName: aws.String("UserProfileDisplayName"),
EmailAddress: aws.String("Email"),
SshPublicKey: aws.String("SshPublicKey"),
}
resp, err := svc.UpdateUserProfile(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)
}

View file

@ -0,0 +1,95 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codestar
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"
)
// CodeStar provides the API operation methods for making requests to
// AWS CodeStar. See this package's package overview docs
// for details on the service.
//
// CodeStar methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type CodeStar 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 = "codestar" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the CodeStar 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 CodeStar client from just a session.
// svc := codestar.New(mySession)
//
// // Create a CodeStar client with additional configuration
// svc := codestar.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeStar {
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) *CodeStar {
svc := &CodeStar{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2017-04-19",
JSONVersion: "1.1",
TargetPrefix: "CodeStar_20170419",
},
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 CodeStar operation and runs any
// custom request initialization.
func (c *CodeStar) 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
}