123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- // 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/service/codecommit"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleCodeCommit_BatchGetRepositories() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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_GetBranch() {
- svc := codecommit.New(nil)
- 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_GetRepository() {
- svc := codecommit.New(nil)
- 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_ListBranches() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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_UpdateDefaultBranch() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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() {
- svc := codecommit.New(nil)
- 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)
- }
|