codestarconnections

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Overview

Package codestarconnections provides the client and types for making API requests to AWS CodeStar connections.

This AWS CodeStar Connections API Reference provides descriptions and usage examples of the operations and data types for the AWS CodeStar Connections API. You can use the Connections API to work with connections and installations.

Connections are configurations that you use to connect AWS resources to external code repositories. Each connection is a resource that can be given to services such as CodePipeline to connect to a third-party repository such as Bitbucket. For example, you can add the connection in CodePipeline so that it triggers your pipeline when a code change is made to your third-party code repository. Each connection is named and associated with a unique ARN that is used to reference the connection.

When you create a connection, the console initiates a third-party connection handshake. Installations are the apps that are used to conduct this handshake. For example, the installation for the Bitbucket provider type is the Bitbucket Cloud app. When you create a connection, you can choose an existing installation or create one.

You can work with connections by calling:

  • CreateConnection, which creates a uniquely named connection that can be referenced by services such as CodePipeline.

  • DeleteConnection, which deletes the specified connection.

  • GetConnection, which returns information about the connection, including the connection status.

  • ListConnections, which lists the connections associated with your account.

For information about how to use AWS CodeStar Connections, see the AWS CodePipeline User Guide (https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html).

See https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01 for more information on this service.

See codestarconnections package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/codestarconnections/

Using the Client

To use AWS CodeStar connections 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 CodeStar connections client for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/codestarconnections/#New

Index

Constants

View Source
const (
	ServiceName = "AWS CodeStar connections" // Service's name
	ServiceID   = "CodeStarConnections"      // Service's identifier
	EndpointsID = "codestar-connections"     // Service's Endpoint identifier
)
View Source
const (

	// ErrCodeLimitExceededException for service response error code
	// "LimitExceededException".
	//
	// Exceeded the maximum limit for connections.
	ErrCodeLimitExceededException = "LimitExceededException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// Resource not found. Verify the connection resource ARN and try again.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*aws.Client
}

Client provides the API operation methods for making requests to AWS CodeStar connections. See this package's package overview docs for details on the service.

The client's methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *Client

New creates a new instance of the client from the provided Config.

Example:

// Create a client from just a config.
svc := codestarconnections.New(myConfig)

func (*Client) CreateConnectionRequest

func (c *Client) CreateConnectionRequest(input *CreateConnectionInput) CreateConnectionRequest

CreateConnectionRequest returns a request value for making API operation for AWS CodeStar connections.

Creates a connection that can then be given to other AWS services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.

// Example sending a request using CreateConnectionRequest.
req := client.CreateConnectionRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/CreateConnection

func (*Client) DeleteConnectionRequest

func (c *Client) DeleteConnectionRequest(input *DeleteConnectionInput) DeleteConnectionRequest

DeleteConnectionRequest returns a request value for making API operation for AWS CodeStar connections.

The connection to be deleted.

// Example sending a request using DeleteConnectionRequest.
req := client.DeleteConnectionRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/DeleteConnection

func (*Client) GetConnectionRequest

func (c *Client) GetConnectionRequest(input *GetConnectionInput) GetConnectionRequest

GetConnectionRequest returns a request value for making API operation for AWS CodeStar connections.

Returns the connection ARN and details such as status, owner, and provider type.

// Example sending a request using GetConnectionRequest.
req := client.GetConnectionRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/GetConnection

func (*Client) ListConnectionsRequest

func (c *Client) ListConnectionsRequest(input *ListConnectionsInput) ListConnectionsRequest

ListConnectionsRequest returns a request value for making API operation for AWS CodeStar connections.

Lists the connections associated with your account.

// Example sending a request using ListConnectionsRequest.
req := client.ListConnectionsRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/codestar-connections-2019-12-01/ListConnections

type Connection

type Connection struct {

	// The Amazon Resource Name (ARN) of the connection. The ARN is used as the
	// connection reference when the connection is shared between AWS services.
	//
	// The ARN is never reused if the connection is deleted.
	ConnectionArn *string `type:"string"`

	// The name of the connection. Connection names must be unique in an AWS user
	// account.
	ConnectionName *string `min:"1" type:"string"`

	// The current status of the connection.
	ConnectionStatus ConnectionStatus `type:"string" enum:"true"`

	// The name of the external provider where your third-party code repository
	// is configured. For Bitbucket, this is the account ID of the owner of the
	// Bitbucket repository.
	OwnerAccountId *string `min:"12" type:"string"`

	// The name of the external provider where your third-party code repository
	// is configured. Currently, the valid provider type is Bitbucket.
	ProviderType ProviderType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

The configuration that allows a service such as CodePipeline to connect to a third-party code repository.

func (Connection) String

func (s Connection) String() string

String returns the string representation

type ConnectionStatus

type ConnectionStatus string
const (
	ConnectionStatusPending   ConnectionStatus = "PENDING"
	ConnectionStatusAvailable ConnectionStatus = "AVAILABLE"
	ConnectionStatusError     ConnectionStatus = "ERROR"
)

Enum values for ConnectionStatus

func (ConnectionStatus) MarshalValue

func (enum ConnectionStatus) MarshalValue() (string, error)

func (ConnectionStatus) MarshalValueBuf

func (enum ConnectionStatus) MarshalValueBuf(b []byte) ([]byte, error)

type CreateConnectionInput

type CreateConnectionInput struct {

	// The name of the connection to be created. The name must be unique in the
	// calling AWS account.
	//
	// ConnectionName is a required field
	ConnectionName *string `min:"1" type:"string" required:"true"`

	// The name of the external provider where your third-party code repository
	// is configured. Currently, the valid provider type is Bitbucket.
	//
	// ProviderType is a required field
	ProviderType ProviderType `type:"string" required:"true" enum:"true"`
	// contains filtered or unexported fields
}

func (CreateConnectionInput) String

func (s CreateConnectionInput) String() string

String returns the string representation

func (*CreateConnectionInput) Validate

func (s *CreateConnectionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CreateConnectionOutput

type CreateConnectionOutput struct {

	// The Amazon Resource Name (ARN) of the connection to be created. The ARN is
	// used as the connection reference when the connection is shared between AWS
	// services.
	//
	// The ARN is never reused if the connection is deleted.
	//
	// ConnectionArn is a required field
	ConnectionArn *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CreateConnectionOutput) String

func (s CreateConnectionOutput) String() string

String returns the string representation

type CreateConnectionRequest

type CreateConnectionRequest struct {
	*aws.Request
	Input *CreateConnectionInput
	Copy  func(*CreateConnectionInput) CreateConnectionRequest
}

CreateConnectionRequest is the request type for the CreateConnection API operation.

func (CreateConnectionRequest) Send

Send marshals and sends the CreateConnection API request.

type CreateConnectionResponse

type CreateConnectionResponse struct {
	*CreateConnectionOutput
	// contains filtered or unexported fields
}

CreateConnectionResponse is the response type for the CreateConnection API operation.

func (*CreateConnectionResponse) SDKResponseMetdata

func (r *CreateConnectionResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the CreateConnection request.

type DeleteConnectionInput

type DeleteConnectionInput struct {

	// The Amazon Resource Name (ARN) of the connection to be deleted.
	//
	// The ARN is never reused if the connection is deleted.
	//
	// ConnectionArn is a required field
	ConnectionArn *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteConnectionInput) String

func (s DeleteConnectionInput) String() string

String returns the string representation

func (*DeleteConnectionInput) Validate

func (s *DeleteConnectionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeleteConnectionOutput

type DeleteConnectionOutput struct {
	// contains filtered or unexported fields
}

func (DeleteConnectionOutput) String

func (s DeleteConnectionOutput) String() string

String returns the string representation

type DeleteConnectionRequest

type DeleteConnectionRequest struct {
	*aws.Request
	Input *DeleteConnectionInput
	Copy  func(*DeleteConnectionInput) DeleteConnectionRequest
}

DeleteConnectionRequest is the request type for the DeleteConnection API operation.

func (DeleteConnectionRequest) Send

Send marshals and sends the DeleteConnection API request.

type DeleteConnectionResponse

type DeleteConnectionResponse struct {
	*DeleteConnectionOutput
	// contains filtered or unexported fields
}

DeleteConnectionResponse is the response type for the DeleteConnection API operation.

func (*DeleteConnectionResponse) SDKResponseMetdata

func (r *DeleteConnectionResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the DeleteConnection request.

type GetConnectionInput

type GetConnectionInput struct {

	// The Amazon Resource Name (ARN) of a connection.
	//
	// ConnectionArn is a required field
	ConnectionArn *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (GetConnectionInput) String

func (s GetConnectionInput) String() string

String returns the string representation

func (*GetConnectionInput) Validate

func (s *GetConnectionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetConnectionOutput

type GetConnectionOutput struct {

	// The connection details, such as status, owner, and provider type.
	Connection *Connection `type:"structure"`
	// contains filtered or unexported fields
}

func (GetConnectionOutput) String

func (s GetConnectionOutput) String() string

String returns the string representation

type GetConnectionRequest

type GetConnectionRequest struct {
	*aws.Request
	Input *GetConnectionInput
	Copy  func(*GetConnectionInput) GetConnectionRequest
}

GetConnectionRequest is the request type for the GetConnection API operation.

func (GetConnectionRequest) Send

Send marshals and sends the GetConnection API request.

type GetConnectionResponse

type GetConnectionResponse struct {
	*GetConnectionOutput
	// contains filtered or unexported fields
}

GetConnectionResponse is the response type for the GetConnection API operation.

func (*GetConnectionResponse) SDKResponseMetdata

func (r *GetConnectionResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the GetConnection request.

type ListConnectionsInput

type ListConnectionsInput struct {

	// The maximum number of results to return in a single call. To retrieve the
	// remaining results, make another call with the returned nextToken value.
	MaxResults *int64 `min:"1" type:"integer"`

	// The token that was returned from the previous ListConnections call, which
	// can be used to return the next set of connections in the list.
	NextToken *string `min:"1" type:"string"`

	// Filters the list of connections to those associated with a specified provider,
	// such as Bitbucket.
	ProviderTypeFilter ProviderType `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

func (ListConnectionsInput) String

func (s ListConnectionsInput) String() string

String returns the string representation

func (*ListConnectionsInput) Validate

func (s *ListConnectionsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListConnectionsOutput

type ListConnectionsOutput struct {

	// A list of connections and the details for each connection, such as status,
	// owner, and provider type.
	Connections []Connection `type:"list"`

	// A token that can be used in the next ListConnections call. To view all items
	// in the list, continue to call this operation with each subsequent token until
	// no more nextToken values are returned.
	NextToken *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

func (ListConnectionsOutput) String

func (s ListConnectionsOutput) String() string

String returns the string representation

type ListConnectionsPaginator

type ListConnectionsPaginator struct {
	aws.Pager
}

ListConnectionsPaginator is used to paginate the request. This can be done by calling Next and CurrentPage.

func NewListConnectionsPaginator

func NewListConnectionsPaginator(req ListConnectionsRequest) ListConnectionsPaginator

NewListConnectionsRequestPaginator returns a paginator for ListConnections. Use Next method to get the next page, and CurrentPage to get the current response page from the paginator. Next will return false, if there are no more pages, or an error was encountered.

Note: This operation can generate multiple requests to a service.

// Example iterating over pages.
req := client.ListConnectionsRequest(input)
p := codestarconnections.NewListConnectionsRequestPaginator(req)

for p.Next(context.TODO()) {
    page := p.CurrentPage()
}

if err := p.Err(); err != nil {
    return err
}

func (*ListConnectionsPaginator) CurrentPage

type ListConnectionsRequest

type ListConnectionsRequest struct {
	*aws.Request
	Input *ListConnectionsInput
	Copy  func(*ListConnectionsInput) ListConnectionsRequest
}

ListConnectionsRequest is the request type for the ListConnections API operation.

func (ListConnectionsRequest) Send

Send marshals and sends the ListConnections API request.

type ListConnectionsResponse

type ListConnectionsResponse struct {
	*ListConnectionsOutput
	// contains filtered or unexported fields
}

ListConnectionsResponse is the response type for the ListConnections API operation.

func (*ListConnectionsResponse) SDKResponseMetdata

func (r *ListConnectionsResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the ListConnections request.

type ProviderType

type ProviderType string
const (
	ProviderTypeBitbucket ProviderType = "Bitbucket"
)

Enum values for ProviderType

func (ProviderType) MarshalValue

func (enum ProviderType) MarshalValue() (string, error)

func (ProviderType) MarshalValueBuf

func (enum ProviderType) MarshalValueBuf(b []byte) ([]byte, error)

Directories

Path Synopsis
Package codestarconnectionsiface provides an interface to enable mocking the AWS CodeStar connections service client for testing your code.
Package codestarconnectionsiface provides an interface to enable mocking the AWS CodeStar connections service client for testing your code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL