mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Update vendored deps, including AWS SDK, openpgp, ftp, ...
This commit is contained in:
+2143
File diff suppressed because it is too large
Load Diff
+110
@@ -0,0 +1,110 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloud9iface provides an interface to enable mocking the AWS Cloud9 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 cloud9iface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/cloud9"
|
||||
)
|
||||
|
||||
// Cloud9API provides an interface to enable mocking the
|
||||
// cloud9.Cloud9 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 SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Cloud9.
|
||||
// func myFunc(svc cloud9iface.Cloud9API) bool {
|
||||
// // Make svc.CreateEnvironmentEC2 request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := cloud9.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockCloud9Client struct {
|
||||
// cloud9iface.Cloud9API
|
||||
// }
|
||||
// func (m *mockCloud9Client) CreateEnvironmentEC2(input *cloud9.CreateEnvironmentEC2Input) (*cloud9.CreateEnvironmentEC2Output, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockCloud9Client{}
|
||||
//
|
||||
// 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 Cloud9API interface {
|
||||
CreateEnvironmentEC2(*cloud9.CreateEnvironmentEC2Input) (*cloud9.CreateEnvironmentEC2Output, error)
|
||||
CreateEnvironmentEC2WithContext(aws.Context, *cloud9.CreateEnvironmentEC2Input, ...request.Option) (*cloud9.CreateEnvironmentEC2Output, error)
|
||||
CreateEnvironmentEC2Request(*cloud9.CreateEnvironmentEC2Input) (*request.Request, *cloud9.CreateEnvironmentEC2Output)
|
||||
|
||||
CreateEnvironmentMembership(*cloud9.CreateEnvironmentMembershipInput) (*cloud9.CreateEnvironmentMembershipOutput, error)
|
||||
CreateEnvironmentMembershipWithContext(aws.Context, *cloud9.CreateEnvironmentMembershipInput, ...request.Option) (*cloud9.CreateEnvironmentMembershipOutput, error)
|
||||
CreateEnvironmentMembershipRequest(*cloud9.CreateEnvironmentMembershipInput) (*request.Request, *cloud9.CreateEnvironmentMembershipOutput)
|
||||
|
||||
DeleteEnvironment(*cloud9.DeleteEnvironmentInput) (*cloud9.DeleteEnvironmentOutput, error)
|
||||
DeleteEnvironmentWithContext(aws.Context, *cloud9.DeleteEnvironmentInput, ...request.Option) (*cloud9.DeleteEnvironmentOutput, error)
|
||||
DeleteEnvironmentRequest(*cloud9.DeleteEnvironmentInput) (*request.Request, *cloud9.DeleteEnvironmentOutput)
|
||||
|
||||
DeleteEnvironmentMembership(*cloud9.DeleteEnvironmentMembershipInput) (*cloud9.DeleteEnvironmentMembershipOutput, error)
|
||||
DeleteEnvironmentMembershipWithContext(aws.Context, *cloud9.DeleteEnvironmentMembershipInput, ...request.Option) (*cloud9.DeleteEnvironmentMembershipOutput, error)
|
||||
DeleteEnvironmentMembershipRequest(*cloud9.DeleteEnvironmentMembershipInput) (*request.Request, *cloud9.DeleteEnvironmentMembershipOutput)
|
||||
|
||||
DescribeEnvironmentMemberships(*cloud9.DescribeEnvironmentMembershipsInput) (*cloud9.DescribeEnvironmentMembershipsOutput, error)
|
||||
DescribeEnvironmentMembershipsWithContext(aws.Context, *cloud9.DescribeEnvironmentMembershipsInput, ...request.Option) (*cloud9.DescribeEnvironmentMembershipsOutput, error)
|
||||
DescribeEnvironmentMembershipsRequest(*cloud9.DescribeEnvironmentMembershipsInput) (*request.Request, *cloud9.DescribeEnvironmentMembershipsOutput)
|
||||
|
||||
DescribeEnvironmentMembershipsPages(*cloud9.DescribeEnvironmentMembershipsInput, func(*cloud9.DescribeEnvironmentMembershipsOutput, bool) bool) error
|
||||
DescribeEnvironmentMembershipsPagesWithContext(aws.Context, *cloud9.DescribeEnvironmentMembershipsInput, func(*cloud9.DescribeEnvironmentMembershipsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeEnvironmentStatus(*cloud9.DescribeEnvironmentStatusInput) (*cloud9.DescribeEnvironmentStatusOutput, error)
|
||||
DescribeEnvironmentStatusWithContext(aws.Context, *cloud9.DescribeEnvironmentStatusInput, ...request.Option) (*cloud9.DescribeEnvironmentStatusOutput, error)
|
||||
DescribeEnvironmentStatusRequest(*cloud9.DescribeEnvironmentStatusInput) (*request.Request, *cloud9.DescribeEnvironmentStatusOutput)
|
||||
|
||||
DescribeEnvironments(*cloud9.DescribeEnvironmentsInput) (*cloud9.DescribeEnvironmentsOutput, error)
|
||||
DescribeEnvironmentsWithContext(aws.Context, *cloud9.DescribeEnvironmentsInput, ...request.Option) (*cloud9.DescribeEnvironmentsOutput, error)
|
||||
DescribeEnvironmentsRequest(*cloud9.DescribeEnvironmentsInput) (*request.Request, *cloud9.DescribeEnvironmentsOutput)
|
||||
|
||||
ListEnvironments(*cloud9.ListEnvironmentsInput) (*cloud9.ListEnvironmentsOutput, error)
|
||||
ListEnvironmentsWithContext(aws.Context, *cloud9.ListEnvironmentsInput, ...request.Option) (*cloud9.ListEnvironmentsOutput, error)
|
||||
ListEnvironmentsRequest(*cloud9.ListEnvironmentsInput) (*request.Request, *cloud9.ListEnvironmentsOutput)
|
||||
|
||||
ListEnvironmentsPages(*cloud9.ListEnvironmentsInput, func(*cloud9.ListEnvironmentsOutput, bool) bool) error
|
||||
ListEnvironmentsPagesWithContext(aws.Context, *cloud9.ListEnvironmentsInput, func(*cloud9.ListEnvironmentsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
UpdateEnvironment(*cloud9.UpdateEnvironmentInput) (*cloud9.UpdateEnvironmentOutput, error)
|
||||
UpdateEnvironmentWithContext(aws.Context, *cloud9.UpdateEnvironmentInput, ...request.Option) (*cloud9.UpdateEnvironmentOutput, error)
|
||||
UpdateEnvironmentRequest(*cloud9.UpdateEnvironmentInput) (*request.Request, *cloud9.UpdateEnvironmentOutput)
|
||||
|
||||
UpdateEnvironmentMembership(*cloud9.UpdateEnvironmentMembershipInput) (*cloud9.UpdateEnvironmentMembershipOutput, error)
|
||||
UpdateEnvironmentMembershipWithContext(aws.Context, *cloud9.UpdateEnvironmentMembershipInput, ...request.Option) (*cloud9.UpdateEnvironmentMembershipOutput, error)
|
||||
UpdateEnvironmentMembershipRequest(*cloud9.UpdateEnvironmentMembershipInput) (*request.Request, *cloud9.UpdateEnvironmentMembershipOutput)
|
||||
}
|
||||
|
||||
var _ Cloud9API = (*cloud9.Cloud9)(nil)
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloud9 provides the client and types for making API
|
||||
// requests to AWS Cloud9.
|
||||
//
|
||||
// AWS Cloud9 is a collection of tools that you can use to code, build, run,
|
||||
// test, debug, and release software in the cloud.
|
||||
//
|
||||
// For more information about AWS Cloud9, see the AWS Cloud9 User Guide (https://docs.aws.amazon.com/cloud9/latest/user-guide).
|
||||
//
|
||||
// AWS Cloud9 supports these operations:
|
||||
//
|
||||
// * CreateEnvironmentEC2: Creates an AWS Cloud9 development environment,
|
||||
// launches an Amazon EC2 instance, and then connects from the instance to
|
||||
// the environment.
|
||||
//
|
||||
// * CreateEnvironmentMembership: Adds an environment member to an environment.
|
||||
//
|
||||
// * DeleteEnvironment: Deletes an environment. If an Amazon EC2 instance
|
||||
// is connected to the environment, also terminates the instance.
|
||||
//
|
||||
// * DeleteEnvironmentMembership: Deletes an environment member from an environment.
|
||||
//
|
||||
// * DescribeEnvironmentMemberships: Gets information about environment members
|
||||
// for an environment.
|
||||
//
|
||||
// * DescribeEnvironments: Gets information about environments.
|
||||
//
|
||||
// * DescribeEnvironmentStatus: Gets status information for an environment.
|
||||
//
|
||||
// * ListEnvironments: Gets a list of environment identifiers.
|
||||
//
|
||||
// * UpdateEnvironment: Changes the settings of an existing environment.
|
||||
//
|
||||
// * UpdateEnvironmentMembership: Changes the settings of an existing environment
|
||||
// member for an environment.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23 for more information on this service.
|
||||
//
|
||||
// See cloud9 package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloud9/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AWS Cloud9 with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS Cloud9 client Cloud9 for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloud9/#New
|
||||
package cloud9
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloud9
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeBadRequestException for service response error code
|
||||
// "BadRequestException".
|
||||
//
|
||||
// The target request is invalid.
|
||||
ErrCodeBadRequestException = "BadRequestException"
|
||||
|
||||
// ErrCodeConflictException for service response error code
|
||||
// "ConflictException".
|
||||
//
|
||||
// A conflict occurred.
|
||||
ErrCodeConflictException = "ConflictException"
|
||||
|
||||
// ErrCodeForbiddenException for service response error code
|
||||
// "ForbiddenException".
|
||||
//
|
||||
// An access permissions issue occurred.
|
||||
ErrCodeForbiddenException = "ForbiddenException"
|
||||
|
||||
// ErrCodeInternalServerErrorException for service response error code
|
||||
// "InternalServerErrorException".
|
||||
//
|
||||
// An internal server error occurred.
|
||||
ErrCodeInternalServerErrorException = "InternalServerErrorException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// A service limit was exceeded.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeNotFoundException for service response error code
|
||||
// "NotFoundException".
|
||||
//
|
||||
// The target resource cannot be found.
|
||||
ErrCodeNotFoundException = "NotFoundException"
|
||||
|
||||
// ErrCodeTooManyRequestsException for service response error code
|
||||
// "TooManyRequestsException".
|
||||
//
|
||||
// Too many service requests were made over the given time period.
|
||||
ErrCodeTooManyRequestsException = "TooManyRequestsException"
|
||||
)
|
||||
+537
@@ -0,0 +1,537 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloud9_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/cloud9"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// CreateEnvironmentEC2
|
||||
//
|
||||
|
||||
func ExampleCloud9_CreateEnvironmentEC2_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.CreateEnvironmentEC2Input{
|
||||
AutomaticStopTimeMinutes: aws.Int64(60),
|
||||
Description: aws.String("This is my demonstration environment."),
|
||||
InstanceType: aws.String("t2.micro"),
|
||||
Name: aws.String("my-demo-environment"),
|
||||
OwnerArn: aws.String("arn:aws:iam::123456789012:user/MyDemoUser"),
|
||||
SubnetId: aws.String("subnet-1fab8aEX"),
|
||||
}
|
||||
|
||||
result, err := svc.CreateEnvironmentEC2(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// CreateEnvironmentMembership
|
||||
//
|
||||
|
||||
func ExampleCloud9_CreateEnvironmentMembership_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.CreateEnvironmentMembershipInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
Permissions: aws.String("read-write"),
|
||||
UserArn: aws.String("arn:aws:iam::123456789012:user/AnotherDemoUser"),
|
||||
}
|
||||
|
||||
result, err := svc.CreateEnvironmentMembership(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DeleteEnvironment
|
||||
//
|
||||
|
||||
func ExampleCloud9_DeleteEnvironment_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DeleteEnvironmentInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteEnvironment(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DeleteEnvironmentMembership
|
||||
//
|
||||
|
||||
func ExampleCloud9_DeleteEnvironmentMembership_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DeleteEnvironmentMembershipInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
UserArn: aws.String("arn:aws:iam::123456789012:user/AnotherDemoUser"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteEnvironmentMembership(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DescribeEnvironmentMemberships1
|
||||
//
|
||||
// The following example gets information about all of the environment members for the
|
||||
// specified AWS Cloud9 development environment.
|
||||
func ExampleCloud9_DescribeEnvironmentMemberships_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DescribeEnvironmentMembershipsInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeEnvironmentMemberships(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DescribeEnvironmentMemberships2
|
||||
//
|
||||
// The following example gets information about the owner of the specified AWS Cloud9
|
||||
// development environment.
|
||||
func ExampleCloud9_DescribeEnvironmentMemberships_shared01() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DescribeEnvironmentMembershipsInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
Permissions: []*string{
|
||||
aws.String("owner"),
|
||||
},
|
||||
}
|
||||
|
||||
result, err := svc.DescribeEnvironmentMemberships(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DescribeEnvironmentMemberships3
|
||||
//
|
||||
// The following example gets AWS Cloud9 development environment membership information
|
||||
// for the specified user.
|
||||
func ExampleCloud9_DescribeEnvironmentMemberships_shared02() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DescribeEnvironmentMembershipsInput{
|
||||
UserArn: aws.String("arn:aws:iam::123456789012:user/MyDemoUser"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeEnvironmentMemberships(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DescribeEnvironmentStatus
|
||||
//
|
||||
|
||||
func ExampleCloud9_DescribeEnvironmentStatus_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DescribeEnvironmentStatusInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeEnvironmentStatus(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// DescribeEnvironments
|
||||
//
|
||||
|
||||
func ExampleCloud9_DescribeEnvironments_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.DescribeEnvironmentsInput{
|
||||
EnvironmentIds: []*string{
|
||||
aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
aws.String("349c86d4579e4e7298d500ff57a6b2EX"),
|
||||
},
|
||||
}
|
||||
|
||||
result, err := svc.DescribeEnvironments(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// ListEnvironments
|
||||
//
|
||||
|
||||
func ExampleCloud9_ListEnvironments_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.ListEnvironmentsInput{}
|
||||
|
||||
result, err := svc.ListEnvironments(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// UpdateEnvironment
|
||||
//
|
||||
|
||||
func ExampleCloud9_UpdateEnvironment_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.UpdateEnvironmentInput{
|
||||
Description: aws.String("This is my changed demonstration environment."),
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
Name: aws.String("my-changed-demo-environment"),
|
||||
}
|
||||
|
||||
result, err := svc.UpdateEnvironment(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
|
||||
// UpdateEnvironmentMembership
|
||||
//
|
||||
|
||||
func ExampleCloud9_UpdateEnvironmentMembership_shared00() {
|
||||
svc := cloud9.New(session.New())
|
||||
input := &cloud9.UpdateEnvironmentMembershipInput{
|
||||
EnvironmentId: aws.String("8d9967e2f0624182b74e7690ad69ebEX"),
|
||||
Permissions: aws.String("read-only"),
|
||||
UserArn: aws.String("arn:aws:iam::123456789012:user/AnotherDemoUser"),
|
||||
}
|
||||
|
||||
result, err := svc.UpdateEnvironmentMembership(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case cloud9.ErrCodeBadRequestException:
|
||||
fmt.Println(cloud9.ErrCodeBadRequestException, aerr.Error())
|
||||
case cloud9.ErrCodeConflictException:
|
||||
fmt.Println(cloud9.ErrCodeConflictException, aerr.Error())
|
||||
case cloud9.ErrCodeNotFoundException:
|
||||
fmt.Println(cloud9.ErrCodeNotFoundException, aerr.Error())
|
||||
case cloud9.ErrCodeForbiddenException:
|
||||
fmt.Println(cloud9.ErrCodeForbiddenException, aerr.Error())
|
||||
case cloud9.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(cloud9.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case cloud9.ErrCodeLimitExceededException:
|
||||
fmt.Println(cloud9.ErrCodeLimitExceededException, aerr.Error())
|
||||
case cloud9.ErrCodeInternalServerErrorException:
|
||||
fmt.Println(cloud9.ErrCodeInternalServerErrorException, 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)
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloud9
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// Cloud9 provides the API operation methods for making requests to
|
||||
// AWS Cloud9. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// Cloud9 methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type Cloud9 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 = "cloud9" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Cloud9 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 Cloud9 client from just a session.
|
||||
// svc := cloud9.New(mySession)
|
||||
//
|
||||
// // Create a Cloud9 client with additional configuration
|
||||
// svc := cloud9.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Cloud9 {
|
||||
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) *Cloud9 {
|
||||
svc := &Cloud9{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2017-09-23",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AWSCloud9WorkspaceManagementService",
|
||||
},
|
||||
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 Cloud9 operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Cloud9) 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
|
||||
}
|
||||
Reference in New Issue
Block a user