pub struct IdentityClient { /* private fields */ }Expand description
A client of AgentCore Identity.
It is cheap to clone, and clones share one connection pool. See the module documentation for how an operation finds its workload access token.
Implementations§
Source§impl IdentityClient
impl IdentityClient
Sourcepub fn new(config: &SdkConfig) -> Self
pub fn new(config: &SdkConfig) -> Self
Creates a client from the AWS configuration of the application.
Region, credentials, retries, timeouts and endpoint come from config, for the
requests of this client and for data_plane. Load it
once at startup, for example with
aws_config::load_defaults(BehaviorVersion::latest()).await.
A configuration without a region is accepted here. Each operation then fails
with ErrorKind::Service when it is sent.
§Panics
As aws_sdk_bedrockagentcore::Client::new does: when config has no behavior
version, no HTTP client, or no async sleep implementation while retries or
timeouts are enabled. aws_config::load_defaults sets all three.
Sourcepub fn from_client(client: Client) -> Self
pub fn from_client(client: Client) -> Self
Creates a client that sends its requests through client, for example a
client with a custom configuration or a mocked client in a test.
The configuration of client is kept, with its interceptors, runtime plugins,
credentials and endpoint, and WatPropagation is added to it.
§Connection pool
Adding the interceptor builds a new generated client from the configuration of
client. An HTTP client that was set on that configuration is shared, so both
clients use its connection pool. Without one, the new client gets a default
HTTP client of its own, and with it a new, empty pool. To keep the connections
of such a client, add WatPropagation when you build it: a client that
already has the interceptor is used as it is.
Sourcepub fn data_plane(&self) -> &Client
pub fn data_plane(&self) -> &Client
The generated AgentCore client of this IdentityClient, for the operations
that this crate does not wrap.
By default, its Invoke* operations carry the current invocation’s workload
access token. See WatPropagation to override the token for one call.
Sourcepub fn api_key(&self, provider: impl Into<String>) -> ApiKeyBuilder
pub fn api_key(&self, provider: impl Into<String>) -> ApiKeyBuilder
Starts a request for the API key of the credential provider provider.
Sourcepub fn oauth2_token(
&self,
provider: impl Into<String>,
flow: AuthFlow,
) -> Oauth2TokenBuilder
pub fn oauth2_token( &self, provider: impl Into<String>, flow: AuthFlow, ) -> Oauth2TokenBuilder
Starts a request for an OAuth2 access token of the credential provider
provider, obtained with flow.
Trait Implementations§
Source§impl Clone for IdentityClient
impl Clone for IdentityClient
Auto Trait Implementations§
impl !RefUnwindSafe for IdentityClient
impl !UnwindSafe for IdentityClient
impl Forget for IdentityClient
impl Freeze for IdentityClient
impl Move for IdentityClient
impl Send for IdentityClient
impl Sync for IdentityClient
impl Unpin for IdentityClient
impl UnsafeUnpin for IdentityClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more