1
0
Fork 0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-11-14 17:02:43 +00:00
cloudkeys-go/vendor/github.com/aws/aws-sdk-go/service/codebuild/examples_test.go
Knut Ahlers 7581358922
Switch to dep for vendoring, update dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-12-08 13:03:10 +01:00

58 lines
1.4 KiB
Go

// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codebuild_test
import (
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/codebuild"
)
var _ time.Duration
var _ strings.Reader
var _ aws.Config
func parseTime(layout, value string) *time.Time {
t, err := time.Parse(layout, value)
if err != nil {
panic(err)
}
return &t
}
// To get information about builds
//
// The following example gets information about builds with the specified build IDs.
func ExampleCodeBuild_BatchGetBuilds_shared00() {
svc := codebuild.New(session.New())
input := &codebuild.BatchGetBuildsInput{
Ids: []*string{
aws.String("codebuild-demo-project:9b0ac37f-d19e-4254-9079-f47e9a389eEX"),
aws.String("codebuild-demo-project:b79a46f7-1473-4636-a23f-da9c45c208EX"),
},
}
result, err := svc.BatchGetBuilds(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case codebuild.ErrCodeInvalidInputException:
fmt.Println(codebuild.ErrCodeInvalidInputException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}