Struct aws_sdk_codestarconnections::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for AWS CodeStar connections
Client for invoking operations on AWS CodeStar connections. Each operation on AWS CodeStar connections is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_codestarconnections::Client::new(&config);
Occasionally, SDKs may have additional service-specific that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_codestarconnections::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateConnection
operation has
a Client::create_connection
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_connection()
.provider_type("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_connection(&self) -> CreateConnectionFluentBuilder
pub fn create_connection(&self) -> CreateConnectionFluentBuilder
Constructs a fluent builder for the CreateConnection
operation.
- The fluent builder is configurable:
provider_type(ProviderType)
/set_provider_type(Option<ProviderType>)
:
required: falseThe name of the external provider where your third-party code repository is configured.
connection_name(impl Into<String>)
/set_connection_name(Option<String>)
:
required: trueThe name of the connection to be created.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseThe key-value pair to use when tagging the resource.
host_arn(impl Into<String>)
/set_host_arn(Option<String>)
:
required: falseThe Amazon Resource Name (ARN) of the host associated with the connection to be created.
- On success, responds with
CreateConnectionOutput
with field(s):connection_arn(String)
: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 Amazon Web Services services.
The ARN is never reused if the connection is deleted.
tags(Option<Vec::<Tag>>)
:Specifies the tags applied to the resource.
- On failure, responds with
SdkError<CreateConnectionError>
source§impl Client
impl Client
sourcepub fn create_host(&self) -> CreateHostFluentBuilder
pub fn create_host(&self) -> CreateHostFluentBuilder
Constructs a fluent builder for the CreateHost
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name of the host to be created.
provider_type(ProviderType)
/set_provider_type(Option<ProviderType>)
:
required: trueThe name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.
provider_endpoint(impl Into<String>)
/set_provider_endpoint(Option<String>)
:
required: trueThe endpoint of the infrastructure to be represented by the host after it is created.
vpc_configuration(VpcConfiguration)
/set_vpc_configuration(Option<VpcConfiguration>)
:
required: falseThe VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: false
(undocumented)
- On success, responds with
CreateHostOutput
with field(s):host_arn(Option<String>)
:The Amazon Resource Name (ARN) of the host to be created.
tags(Option<Vec::<Tag>>)
: (undocumented)
- On failure, responds with
SdkError<CreateHostError>
source§impl Client
impl Client
sourcepub fn delete_connection(&self) -> DeleteConnectionFluentBuilder
pub fn delete_connection(&self) -> DeleteConnectionFluentBuilder
Constructs a fluent builder for the DeleteConnection
operation.
- The fluent builder is configurable:
connection_arn(impl Into<String>)
/set_connection_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the connection to be deleted.
The ARN is never reused if the connection is deleted.
- On success, responds with
DeleteConnectionOutput
- On failure, responds with
SdkError<DeleteConnectionError>
source§impl Client
impl Client
sourcepub fn delete_host(&self) -> DeleteHostFluentBuilder
pub fn delete_host(&self) -> DeleteHostFluentBuilder
Constructs a fluent builder for the DeleteHost
operation.
- The fluent builder is configurable:
host_arn(impl Into<String>)
/set_host_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the host to be deleted.
- On success, responds with
DeleteHostOutput
- On failure, responds with
SdkError<DeleteHostError>
source§impl Client
impl Client
sourcepub fn get_connection(&self) -> GetConnectionFluentBuilder
pub fn get_connection(&self) -> GetConnectionFluentBuilder
Constructs a fluent builder for the GetConnection
operation.
- The fluent builder is configurable:
connection_arn(impl Into<String>)
/set_connection_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of a connection.
- On success, responds with
GetConnectionOutput
with field(s):connection(Option<Connection>)
:The connection details, such as status, owner, and provider type.
- On failure, responds with
SdkError<GetConnectionError>
source§impl Client
impl Client
sourcepub fn get_host(&self) -> GetHostFluentBuilder
pub fn get_host(&self) -> GetHostFluentBuilder
Constructs a fluent builder for the GetHost
operation.
- The fluent builder is configurable:
host_arn(impl Into<String>)
/set_host_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the requested host.
- On success, responds with
GetHostOutput
with field(s):name(Option<String>)
:The name of the requested host.
status(Option<String>)
:The status of the requested host.
provider_type(Option<ProviderType>)
:The provider type of the requested host, such as GitHub Enterprise Server.
provider_endpoint(Option<String>)
:The endpoint of the infrastructure represented by the requested host.
vpc_configuration(Option<VpcConfiguration>)
:The VPC configuration of the requested host.
- On failure, responds with
SdkError<GetHostError>
source§impl Client
impl Client
sourcepub fn list_connections(&self) -> ListConnectionsFluentBuilder
pub fn list_connections(&self) -> ListConnectionsFluentBuilder
Constructs a fluent builder for the ListConnections
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
provider_type_filter(ProviderType)
/set_provider_type_filter(Option<ProviderType>)
:
required: falseFilters the list of connections to those associated with a specified provider, such as Bitbucket.
host_arn_filter(impl Into<String>)
/set_host_arn_filter(Option<String>)
:
required: falseFilters the list of connections to those associated with a specified host.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned
nextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token that was returned from the previous
ListConnections
call, which can be used to return the next set of connections in the list.
- On success, responds with
ListConnectionsOutput
with field(s):connections(Option<Vec::<Connection>>)
:A list of connections and the details for each connection, such as status, owner, and provider type.
next_token(Option<String>)
: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 morenextToken
values are returned.
- On failure, responds with
SdkError<ListConnectionsError>
source§impl Client
impl Client
sourcepub fn list_hosts(&self) -> ListHostsFluentBuilder
pub fn list_hosts(&self) -> ListHostsFluentBuilder
Constructs a fluent builder for the ListHosts
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned
nextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseThe token that was returned from the previous
ListHosts
call, which can be used to return the next set of hosts in the list.
- On success, responds with
ListHostsOutput
with field(s):hosts(Option<Vec::<Host>>)
:A list of hosts and the details for each host, such as status, endpoint, and provider type.
next_token(Option<String>)
:A token that can be used in the next
ListHosts
call. To view all items in the list, continue to call this operation with each subsequent token until no morenextToken
values are returned.
- On failure, responds with
SdkError<ListHostsError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource for which you want to get information about tags, if any.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:A list of tag key and value pairs associated with the specified resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to which you want to add or update tags.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueThe tags you want to modify or add to the resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to remove tags from.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe list of keys for the tags to be removed from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_host(&self) -> UpdateHostFluentBuilder
pub fn update_host(&self) -> UpdateHostFluentBuilder
Constructs a fluent builder for the UpdateHost
operation.
- The fluent builder is configurable:
host_arn(impl Into<String>)
/set_host_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the host to be updated.
provider_endpoint(impl Into<String>)
/set_provider_endpoint(Option<String>)
:
required: falseThe URL or endpoint of the host to be updated.
vpc_configuration(VpcConfiguration)
/set_vpc_configuration(Option<VpcConfiguration>)
:
required: falseThe VPC configuration of the host to be updated. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.
- On success, responds with
UpdateHostOutput
- On failure, responds with
SdkError<UpdateHostError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.