Conver to regular Go vendor + dep tool

This commit is contained in:
Andrey Smirnov
2017-03-22 17:38:32 +03:00
parent 070347295e
commit c6c1012330
3260 changed files with 1742550 additions and 72 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,141 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package codecommitiface provides an interface to enable mocking the AWS CodeCommit 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 codecommitiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/codecommit"
)
// CodeCommitAPI provides an interface to enable mocking the
// codecommit.CodeCommit 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 CodeCommit.
// func myFunc(svc codecommitiface.CodeCommitAPI) bool {
// // Make svc.BatchGetRepositories request
// }
//
// func main() {
// sess := session.New()
// svc := codecommit.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockCodeCommitClient struct {
// codecommitiface.CodeCommitAPI
// }
// func (m *mockCodeCommitClient) BatchGetRepositories(input *codecommit.BatchGetRepositoriesInput) (*codecommit.BatchGetRepositoriesOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockCodeCommitClient{}
//
// 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 CodeCommitAPI interface {
BatchGetRepositories(*codecommit.BatchGetRepositoriesInput) (*codecommit.BatchGetRepositoriesOutput, error)
BatchGetRepositoriesWithContext(aws.Context, *codecommit.BatchGetRepositoriesInput, ...request.Option) (*codecommit.BatchGetRepositoriesOutput, error)
BatchGetRepositoriesRequest(*codecommit.BatchGetRepositoriesInput) (*request.Request, *codecommit.BatchGetRepositoriesOutput)
CreateBranch(*codecommit.CreateBranchInput) (*codecommit.CreateBranchOutput, error)
CreateBranchWithContext(aws.Context, *codecommit.CreateBranchInput, ...request.Option) (*codecommit.CreateBranchOutput, error)
CreateBranchRequest(*codecommit.CreateBranchInput) (*request.Request, *codecommit.CreateBranchOutput)
CreateRepository(*codecommit.CreateRepositoryInput) (*codecommit.CreateRepositoryOutput, error)
CreateRepositoryWithContext(aws.Context, *codecommit.CreateRepositoryInput, ...request.Option) (*codecommit.CreateRepositoryOutput, error)
CreateRepositoryRequest(*codecommit.CreateRepositoryInput) (*request.Request, *codecommit.CreateRepositoryOutput)
DeleteRepository(*codecommit.DeleteRepositoryInput) (*codecommit.DeleteRepositoryOutput, error)
DeleteRepositoryWithContext(aws.Context, *codecommit.DeleteRepositoryInput, ...request.Option) (*codecommit.DeleteRepositoryOutput, error)
DeleteRepositoryRequest(*codecommit.DeleteRepositoryInput) (*request.Request, *codecommit.DeleteRepositoryOutput)
GetBlob(*codecommit.GetBlobInput) (*codecommit.GetBlobOutput, error)
GetBlobWithContext(aws.Context, *codecommit.GetBlobInput, ...request.Option) (*codecommit.GetBlobOutput, error)
GetBlobRequest(*codecommit.GetBlobInput) (*request.Request, *codecommit.GetBlobOutput)
GetBranch(*codecommit.GetBranchInput) (*codecommit.GetBranchOutput, error)
GetBranchWithContext(aws.Context, *codecommit.GetBranchInput, ...request.Option) (*codecommit.GetBranchOutput, error)
GetBranchRequest(*codecommit.GetBranchInput) (*request.Request, *codecommit.GetBranchOutput)
GetCommit(*codecommit.GetCommitInput) (*codecommit.GetCommitOutput, error)
GetCommitWithContext(aws.Context, *codecommit.GetCommitInput, ...request.Option) (*codecommit.GetCommitOutput, error)
GetCommitRequest(*codecommit.GetCommitInput) (*request.Request, *codecommit.GetCommitOutput)
GetDifferences(*codecommit.GetDifferencesInput) (*codecommit.GetDifferencesOutput, error)
GetDifferencesWithContext(aws.Context, *codecommit.GetDifferencesInput, ...request.Option) (*codecommit.GetDifferencesOutput, error)
GetDifferencesRequest(*codecommit.GetDifferencesInput) (*request.Request, *codecommit.GetDifferencesOutput)
GetDifferencesPages(*codecommit.GetDifferencesInput, func(*codecommit.GetDifferencesOutput, bool) bool) error
GetDifferencesPagesWithContext(aws.Context, *codecommit.GetDifferencesInput, func(*codecommit.GetDifferencesOutput, bool) bool, ...request.Option) error
GetRepository(*codecommit.GetRepositoryInput) (*codecommit.GetRepositoryOutput, error)
GetRepositoryWithContext(aws.Context, *codecommit.GetRepositoryInput, ...request.Option) (*codecommit.GetRepositoryOutput, error)
GetRepositoryRequest(*codecommit.GetRepositoryInput) (*request.Request, *codecommit.GetRepositoryOutput)
GetRepositoryTriggers(*codecommit.GetRepositoryTriggersInput) (*codecommit.GetRepositoryTriggersOutput, error)
GetRepositoryTriggersWithContext(aws.Context, *codecommit.GetRepositoryTriggersInput, ...request.Option) (*codecommit.GetRepositoryTriggersOutput, error)
GetRepositoryTriggersRequest(*codecommit.GetRepositoryTriggersInput) (*request.Request, *codecommit.GetRepositoryTriggersOutput)
ListBranches(*codecommit.ListBranchesInput) (*codecommit.ListBranchesOutput, error)
ListBranchesWithContext(aws.Context, *codecommit.ListBranchesInput, ...request.Option) (*codecommit.ListBranchesOutput, error)
ListBranchesRequest(*codecommit.ListBranchesInput) (*request.Request, *codecommit.ListBranchesOutput)
ListBranchesPages(*codecommit.ListBranchesInput, func(*codecommit.ListBranchesOutput, bool) bool) error
ListBranchesPagesWithContext(aws.Context, *codecommit.ListBranchesInput, func(*codecommit.ListBranchesOutput, bool) bool, ...request.Option) error
ListRepositories(*codecommit.ListRepositoriesInput) (*codecommit.ListRepositoriesOutput, error)
ListRepositoriesWithContext(aws.Context, *codecommit.ListRepositoriesInput, ...request.Option) (*codecommit.ListRepositoriesOutput, error)
ListRepositoriesRequest(*codecommit.ListRepositoriesInput) (*request.Request, *codecommit.ListRepositoriesOutput)
ListRepositoriesPages(*codecommit.ListRepositoriesInput, func(*codecommit.ListRepositoriesOutput, bool) bool) error
ListRepositoriesPagesWithContext(aws.Context, *codecommit.ListRepositoriesInput, func(*codecommit.ListRepositoriesOutput, bool) bool, ...request.Option) error
PutRepositoryTriggers(*codecommit.PutRepositoryTriggersInput) (*codecommit.PutRepositoryTriggersOutput, error)
PutRepositoryTriggersWithContext(aws.Context, *codecommit.PutRepositoryTriggersInput, ...request.Option) (*codecommit.PutRepositoryTriggersOutput, error)
PutRepositoryTriggersRequest(*codecommit.PutRepositoryTriggersInput) (*request.Request, *codecommit.PutRepositoryTriggersOutput)
TestRepositoryTriggers(*codecommit.TestRepositoryTriggersInput) (*codecommit.TestRepositoryTriggersOutput, error)
TestRepositoryTriggersWithContext(aws.Context, *codecommit.TestRepositoryTriggersInput, ...request.Option) (*codecommit.TestRepositoryTriggersOutput, error)
TestRepositoryTriggersRequest(*codecommit.TestRepositoryTriggersInput) (*request.Request, *codecommit.TestRepositoryTriggersOutput)
UpdateDefaultBranch(*codecommit.UpdateDefaultBranchInput) (*codecommit.UpdateDefaultBranchOutput, error)
UpdateDefaultBranchWithContext(aws.Context, *codecommit.UpdateDefaultBranchInput, ...request.Option) (*codecommit.UpdateDefaultBranchOutput, error)
UpdateDefaultBranchRequest(*codecommit.UpdateDefaultBranchInput) (*request.Request, *codecommit.UpdateDefaultBranchOutput)
UpdateRepositoryDescription(*codecommit.UpdateRepositoryDescriptionInput) (*codecommit.UpdateRepositoryDescriptionOutput, error)
UpdateRepositoryDescriptionWithContext(aws.Context, *codecommit.UpdateRepositoryDescriptionInput, ...request.Option) (*codecommit.UpdateRepositoryDescriptionOutput, error)
UpdateRepositoryDescriptionRequest(*codecommit.UpdateRepositoryDescriptionInput) (*request.Request, *codecommit.UpdateRepositoryDescriptionOutput)
UpdateRepositoryName(*codecommit.UpdateRepositoryNameInput) (*codecommit.UpdateRepositoryNameOutput, error)
UpdateRepositoryNameWithContext(aws.Context, *codecommit.UpdateRepositoryNameInput, ...request.Option) (*codecommit.UpdateRepositoryNameOutput, error)
UpdateRepositoryNameRequest(*codecommit.UpdateRepositoryNameInput) (*request.Request, *codecommit.UpdateRepositoryNameOutput)
}
var _ CodeCommitAPI = (*codecommit.CodeCommit)(nil)
+296
View File
@@ -0,0 +1,296 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codecommit
const (
// ErrCodeBlobIdDoesNotExistException for service response error code
// "BlobIdDoesNotExistException".
//
// The specified blob does not exist.
ErrCodeBlobIdDoesNotExistException = "BlobIdDoesNotExistException"
// ErrCodeBlobIdRequiredException for service response error code
// "BlobIdRequiredException".
//
// A blob ID is required but was not specified.
ErrCodeBlobIdRequiredException = "BlobIdRequiredException"
// ErrCodeBranchDoesNotExistException for service response error code
// "BranchDoesNotExistException".
//
// The specified branch does not exist.
ErrCodeBranchDoesNotExistException = "BranchDoesNotExistException"
// ErrCodeBranchNameExistsException for service response error code
// "BranchNameExistsException".
//
// The specified branch name already exists.
ErrCodeBranchNameExistsException = "BranchNameExistsException"
// ErrCodeBranchNameRequiredException for service response error code
// "BranchNameRequiredException".
//
// A branch name is required but was not specified.
ErrCodeBranchNameRequiredException = "BranchNameRequiredException"
// ErrCodeCommitDoesNotExistException for service response error code
// "CommitDoesNotExistException".
//
// The specified commit does not exist or no commit was specified, and the specified
// repository has no default branch.
ErrCodeCommitDoesNotExistException = "CommitDoesNotExistException"
// ErrCodeCommitIdDoesNotExistException for service response error code
// "CommitIdDoesNotExistException".
//
// The specified commit ID does not exist.
ErrCodeCommitIdDoesNotExistException = "CommitIdDoesNotExistException"
// ErrCodeCommitIdRequiredException for service response error code
// "CommitIdRequiredException".
//
// A commit ID was not specified.
ErrCodeCommitIdRequiredException = "CommitIdRequiredException"
// ErrCodeCommitRequiredException for service response error code
// "CommitRequiredException".
//
// A commit was not specified.
ErrCodeCommitRequiredException = "CommitRequiredException"
// ErrCodeEncryptionIntegrityChecksFailedException for service response error code
// "EncryptionIntegrityChecksFailedException".
//
// An encryption integrity check failed.
ErrCodeEncryptionIntegrityChecksFailedException = "EncryptionIntegrityChecksFailedException"
// ErrCodeEncryptionKeyAccessDeniedException for service response error code
// "EncryptionKeyAccessDeniedException".
//
// An encryption key could not be accessed.
ErrCodeEncryptionKeyAccessDeniedException = "EncryptionKeyAccessDeniedException"
// ErrCodeEncryptionKeyDisabledException for service response error code
// "EncryptionKeyDisabledException".
//
// The encryption key is disabled.
ErrCodeEncryptionKeyDisabledException = "EncryptionKeyDisabledException"
// ErrCodeEncryptionKeyNotFoundException for service response error code
// "EncryptionKeyNotFoundException".
//
// No encryption key was found.
ErrCodeEncryptionKeyNotFoundException = "EncryptionKeyNotFoundException"
// ErrCodeEncryptionKeyUnavailableException for service response error code
// "EncryptionKeyUnavailableException".
//
// The encryption key is not available.
ErrCodeEncryptionKeyUnavailableException = "EncryptionKeyUnavailableException"
// ErrCodeFileTooLargeException for service response error code
// "FileTooLargeException".
//
// The specified file exceeds the file size limit for AWS CodeCommit. For more
// information about limits in AWS CodeCommit, see AWS CodeCommit User Guide
// (http://docs.aws.amazon.com/codecommit/latest/userguide/limits.html).
ErrCodeFileTooLargeException = "FileTooLargeException"
// ErrCodeInvalidBlobIdException for service response error code
// "InvalidBlobIdException".
//
// The specified blob is not valid.
ErrCodeInvalidBlobIdException = "InvalidBlobIdException"
// ErrCodeInvalidBranchNameException for service response error code
// "InvalidBranchNameException".
//
// The specified branch name is not valid.
ErrCodeInvalidBranchNameException = "InvalidBranchNameException"
// ErrCodeInvalidCommitException for service response error code
// "InvalidCommitException".
//
// The specified commit is not valid.
ErrCodeInvalidCommitException = "InvalidCommitException"
// ErrCodeInvalidCommitIdException for service response error code
// "InvalidCommitIdException".
//
// The specified commit ID is not valid.
ErrCodeInvalidCommitIdException = "InvalidCommitIdException"
// ErrCodeInvalidContinuationTokenException for service response error code
// "InvalidContinuationTokenException".
//
// The specified continuation token is not valid.
ErrCodeInvalidContinuationTokenException = "InvalidContinuationTokenException"
// ErrCodeInvalidMaxResultsException for service response error code
// "InvalidMaxResultsException".
//
// The specified number of maximum results is not valid.
ErrCodeInvalidMaxResultsException = "InvalidMaxResultsException"
// ErrCodeInvalidOrderException for service response error code
// "InvalidOrderException".
//
// The specified sort order is not valid.
ErrCodeInvalidOrderException = "InvalidOrderException"
// ErrCodeInvalidPathException for service response error code
// "InvalidPathException".
//
// The specified path is not valid.
ErrCodeInvalidPathException = "InvalidPathException"
// ErrCodeInvalidRepositoryDescriptionException for service response error code
// "InvalidRepositoryDescriptionException".
//
// The specified repository description is not valid.
ErrCodeInvalidRepositoryDescriptionException = "InvalidRepositoryDescriptionException"
// ErrCodeInvalidRepositoryNameException for service response error code
// "InvalidRepositoryNameException".
//
// At least one specified repository name is not valid.
//
// This exception only occurs when a specified repository name is not valid.
// Other exceptions occur when a required repository parameter is missing, or
// when a specified repository does not exist.
ErrCodeInvalidRepositoryNameException = "InvalidRepositoryNameException"
// ErrCodeInvalidRepositoryTriggerBranchNameException for service response error code
// "InvalidRepositoryTriggerBranchNameException".
//
// One or more branch names specified for the trigger is not valid.
ErrCodeInvalidRepositoryTriggerBranchNameException = "InvalidRepositoryTriggerBranchNameException"
// ErrCodeInvalidRepositoryTriggerCustomDataException for service response error code
// "InvalidRepositoryTriggerCustomDataException".
//
// The custom data provided for the trigger is not valid.
ErrCodeInvalidRepositoryTriggerCustomDataException = "InvalidRepositoryTriggerCustomDataException"
// ErrCodeInvalidRepositoryTriggerDestinationArnException for service response error code
// "InvalidRepositoryTriggerDestinationArnException".
//
// The Amazon Resource Name (ARN) for the trigger is not valid for the specified
// destination. The most common reason for this error is that the ARN does not
// meet the requirements for the service type.
ErrCodeInvalidRepositoryTriggerDestinationArnException = "InvalidRepositoryTriggerDestinationArnException"
// ErrCodeInvalidRepositoryTriggerEventsException for service response error code
// "InvalidRepositoryTriggerEventsException".
//
// One or more events specified for the trigger is not valid. Check to make
// sure that all events specified match the requirements for allowed events.
ErrCodeInvalidRepositoryTriggerEventsException = "InvalidRepositoryTriggerEventsException"
// ErrCodeInvalidRepositoryTriggerNameException for service response error code
// "InvalidRepositoryTriggerNameException".
//
// The name of the trigger is not valid.
ErrCodeInvalidRepositoryTriggerNameException = "InvalidRepositoryTriggerNameException"
// ErrCodeInvalidRepositoryTriggerRegionException for service response error code
// "InvalidRepositoryTriggerRegionException".
//
// The region for the trigger target does not match the region for the repository.
// Triggers must be created in the same region as the target for the trigger.
ErrCodeInvalidRepositoryTriggerRegionException = "InvalidRepositoryTriggerRegionException"
// ErrCodeInvalidSortByException for service response error code
// "InvalidSortByException".
//
// The specified sort by value is not valid.
ErrCodeInvalidSortByException = "InvalidSortByException"
// ErrCodeMaximumBranchesExceededException for service response error code
// "MaximumBranchesExceededException".
//
// The number of branches for the trigger was exceeded.
ErrCodeMaximumBranchesExceededException = "MaximumBranchesExceededException"
// ErrCodeMaximumRepositoryNamesExceededException for service response error code
// "MaximumRepositoryNamesExceededException".
//
// The maximum number of allowed repository names was exceeded. Currently, this
// number is 25.
ErrCodeMaximumRepositoryNamesExceededException = "MaximumRepositoryNamesExceededException"
// ErrCodeMaximumRepositoryTriggersExceededException for service response error code
// "MaximumRepositoryTriggersExceededException".
//
// The number of triggers allowed for the repository was exceeded.
ErrCodeMaximumRepositoryTriggersExceededException = "MaximumRepositoryTriggersExceededException"
// ErrCodePathDoesNotExistException for service response error code
// "PathDoesNotExistException".
//
// The specified path does not exist.
ErrCodePathDoesNotExistException = "PathDoesNotExistException"
// ErrCodeRepositoryDoesNotExistException for service response error code
// "RepositoryDoesNotExistException".
//
// The specified repository does not exist.
ErrCodeRepositoryDoesNotExistException = "RepositoryDoesNotExistException"
// ErrCodeRepositoryLimitExceededException for service response error code
// "RepositoryLimitExceededException".
//
// A repository resource limit was exceeded.
ErrCodeRepositoryLimitExceededException = "RepositoryLimitExceededException"
// ErrCodeRepositoryNameExistsException for service response error code
// "RepositoryNameExistsException".
//
// The specified repository name already exists.
ErrCodeRepositoryNameExistsException = "RepositoryNameExistsException"
// ErrCodeRepositoryNameRequiredException for service response error code
// "RepositoryNameRequiredException".
//
// A repository name is required but was not specified.
ErrCodeRepositoryNameRequiredException = "RepositoryNameRequiredException"
// ErrCodeRepositoryNamesRequiredException for service response error code
// "RepositoryNamesRequiredException".
//
// A repository names object is required but was not specified.
ErrCodeRepositoryNamesRequiredException = "RepositoryNamesRequiredException"
// ErrCodeRepositoryTriggerBranchNameListRequiredException for service response error code
// "RepositoryTriggerBranchNameListRequiredException".
//
// At least one branch name is required but was not specified in the trigger
// configuration.
ErrCodeRepositoryTriggerBranchNameListRequiredException = "RepositoryTriggerBranchNameListRequiredException"
// ErrCodeRepositoryTriggerDestinationArnRequiredException for service response error code
// "RepositoryTriggerDestinationArnRequiredException".
//
// A destination ARN for the target service for the trigger is required but
// was not specified.
ErrCodeRepositoryTriggerDestinationArnRequiredException = "RepositoryTriggerDestinationArnRequiredException"
// ErrCodeRepositoryTriggerEventsListRequiredException for service response error code
// "RepositoryTriggerEventsListRequiredException".
//
// At least one event for the trigger is required but was not specified.
ErrCodeRepositoryTriggerEventsListRequiredException = "RepositoryTriggerEventsListRequiredException"
// ErrCodeRepositoryTriggerNameRequiredException for service response error code
// "RepositoryTriggerNameRequiredException".
//
// A name for the trigger is required but was not specified.
ErrCodeRepositoryTriggerNameRequiredException = "RepositoryTriggerNameRequiredException"
// ErrCodeRepositoryTriggersListRequiredException for service response error code
// "RepositoryTriggersListRequiredException".
//
// The list of triggers for the repository is required but was not specified.
ErrCodeRepositoryTriggersListRequiredException = "RepositoryTriggersListRequiredException"
)
+426
View File
@@ -0,0 +1,426 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codecommit_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/codecommit"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleCodeCommit_BatchGetRepositories() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.BatchGetRepositoriesInput{
RepositoryNames: []*string{ // Required
aws.String("RepositoryName"), // Required
// More values...
},
}
resp, err := svc.BatchGetRepositories(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 ExampleCodeCommit_CreateBranch() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.CreateBranchInput{
BranchName: aws.String("BranchName"), // Required
CommitId: aws.String("CommitId"), // Required
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.CreateBranch(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 ExampleCodeCommit_CreateRepository() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.CreateRepositoryInput{
RepositoryName: aws.String("RepositoryName"), // Required
RepositoryDescription: aws.String("RepositoryDescription"),
}
resp, err := svc.CreateRepository(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 ExampleCodeCommit_DeleteRepository() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.DeleteRepositoryInput{
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.DeleteRepository(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 ExampleCodeCommit_GetBlob() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetBlobInput{
BlobId: aws.String("ObjectId"), // Required
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.GetBlob(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 ExampleCodeCommit_GetBranch() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetBranchInput{
BranchName: aws.String("BranchName"),
RepositoryName: aws.String("RepositoryName"),
}
resp, err := svc.GetBranch(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 ExampleCodeCommit_GetCommit() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetCommitInput{
CommitId: aws.String("ObjectId"), // Required
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.GetCommit(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 ExampleCodeCommit_GetDifferences() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetDifferencesInput{
AfterCommitSpecifier: aws.String("CommitName"), // Required
RepositoryName: aws.String("RepositoryName"), // Required
AfterPath: aws.String("Path"),
BeforeCommitSpecifier: aws.String("CommitName"),
BeforePath: aws.String("Path"),
MaxResults: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.GetDifferences(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 ExampleCodeCommit_GetRepository() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetRepositoryInput{
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.GetRepository(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 ExampleCodeCommit_GetRepositoryTriggers() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.GetRepositoryTriggersInput{
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.GetRepositoryTriggers(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 ExampleCodeCommit_ListBranches() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.ListBranchesInput{
RepositoryName: aws.String("RepositoryName"), // Required
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListBranches(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 ExampleCodeCommit_ListRepositories() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.ListRepositoriesInput{
NextToken: aws.String("NextToken"),
Order: aws.String("OrderEnum"),
SortBy: aws.String("SortByEnum"),
}
resp, err := svc.ListRepositories(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 ExampleCodeCommit_PutRepositoryTriggers() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.PutRepositoryTriggersInput{
RepositoryName: aws.String("RepositoryName"), // Required
Triggers: []*codecommit.RepositoryTrigger{ // Required
{ // Required
DestinationArn: aws.String("Arn"), // Required
Events: []*string{ // Required
aws.String("RepositoryTriggerEventEnum"), // Required
// More values...
},
Name: aws.String("RepositoryTriggerName"), // Required
Branches: []*string{
aws.String("BranchName"), // Required
// More values...
},
CustomData: aws.String("RepositoryTriggerCustomData"),
},
// More values...
},
}
resp, err := svc.PutRepositoryTriggers(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 ExampleCodeCommit_TestRepositoryTriggers() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.TestRepositoryTriggersInput{
RepositoryName: aws.String("RepositoryName"), // Required
Triggers: []*codecommit.RepositoryTrigger{ // Required
{ // Required
DestinationArn: aws.String("Arn"), // Required
Events: []*string{ // Required
aws.String("RepositoryTriggerEventEnum"), // Required
// More values...
},
Name: aws.String("RepositoryTriggerName"), // Required
Branches: []*string{
aws.String("BranchName"), // Required
// More values...
},
CustomData: aws.String("RepositoryTriggerCustomData"),
},
// More values...
},
}
resp, err := svc.TestRepositoryTriggers(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 ExampleCodeCommit_UpdateDefaultBranch() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.UpdateDefaultBranchInput{
DefaultBranchName: aws.String("BranchName"), // Required
RepositoryName: aws.String("RepositoryName"), // Required
}
resp, err := svc.UpdateDefaultBranch(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 ExampleCodeCommit_UpdateRepositoryDescription() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.UpdateRepositoryDescriptionInput{
RepositoryName: aws.String("RepositoryName"), // Required
RepositoryDescription: aws.String("RepositoryDescription"),
}
resp, err := svc.UpdateRepositoryDescription(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 ExampleCodeCommit_UpdateRepositoryName() {
sess := session.Must(session.NewSession())
svc := codecommit.New(sess)
params := &codecommit.UpdateRepositoryNameInput{
NewName: aws.String("RepositoryName"), // Required
OldName: aws.String("RepositoryName"), // Required
}
resp, err := svc.UpdateRepositoryName(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)
}
+154
View File
@@ -0,0 +1,154 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codecommit
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"
)
// This is the AWS CodeCommit API Reference. This reference provides descriptions
// of the operations and data types for AWS CodeCommit API along with usage
// examples.
//
// You can use the AWS CodeCommit API to work with the following objects:
//
// Repositories, by calling the following:
//
// * BatchGetRepositories, which returns information about one or more repositories
// associated with your AWS account
//
// * CreateRepository, which creates an AWS CodeCommit repository
//
// * DeleteRepository, which deletes an AWS CodeCommit repository
//
// * GetRepository, which returns information about a specified repository
//
// * ListRepositories, which lists all AWS CodeCommit repositories associated
// with your AWS account
//
// * UpdateRepositoryDescription, which sets or updates the description of
// the repository
//
// * UpdateRepositoryName, which changes the name of the repository. If you
// change the name of a repository, no other users of that repository will
// be able to access it until you send them the new HTTPS or SSH URL to use.
//
// Branches, by calling the following:
//
// * CreateBranch, which creates a new branch in a specified repository
//
// * GetBranch, which returns information about a specified branch
//
// * ListBranches, which lists all branches for a specified repository
//
// * UpdateDefaultBranch, which changes the default branch for a repository
//
// Information about committed code in a repository, by calling the following:
//
// * GetBlob, which returns the base-64 encoded content of an individual
// Git blob object within a repository
//
// * GetCommit, which returns information about a commit, including commit
// messages and author and committer information
//
// * GetDifferences, which returns information about the differences in a
// valid commit specifier (such as a branch, tag, HEAD, commit ID or other
// fully qualified reference)
//
// Triggers, by calling the following:
//
// * GetRepositoryTriggers, which returns information about triggers configured
// for a repository
//
// * PutRepositoryTriggers, which replaces all triggers for a repository
// and can be used to create or delete triggers
//
// * TestRepositoryTriggers, which tests the functionality of a repository
// trigger by sending data to the trigger target
//
// For information about how to use AWS CodeCommit, see the AWS CodeCommit User
// Guide (http://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html).
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13
type CodeCommit 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 = "codecommit" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the CodeCommit 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 CodeCommit client from just a session.
// svc := codecommit.New(mySession)
//
// // Create a CodeCommit client with additional configuration
// svc := codecommit.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeCommit {
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) *CodeCommit {
svc := &CodeCommit{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2015-04-13",
JSONVersion: "1.1",
TargetPrefix: "CodeCommit_20150413",
},
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 CodeCommit operation and runs any
// custom request initialization.
func (c *CodeCommit) 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
}