TurnkeyClient

Struct TurnkeyClient 

Source
pub struct TurnkeyClient<S: Stamp> { /* private fields */ }
Expand description

Base client. To create a new client, see TurnkeyClient::<S>::builder.

Implementations§

Source§

impl<S: Stamp> TurnkeyClient<S>

Source

pub async fn get_whoami( &self, request: GetWhoamiRequest, ) -> Result<GetWhoamiResponse, TurnkeyClientError>

Who am I?

Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users.

Source

pub async fn get_sub_org_ids( &self, request: GetSubOrgIdsRequest, ) -> Result<GetSubOrgIdsResponse, TurnkeyClientError>

Get sub-organizations

Get all suborg IDs associated given a parent org ID and an optional filter.

Source

pub async fn get_verified_sub_org_ids( &self, request: GetVerifiedSubOrgIdsRequest, ) -> Result<GetVerifiedSubOrgIdsResponse, TurnkeyClientError>

Get verified sub-organizations

Get all email or phone verified suborg IDs associated given a parent org ID.

Source

pub async fn get_activity( &self, request: GetActivityRequest, ) -> Result<ActivityResponse, TurnkeyClientError>

Get activity

Get details about an activity.

Source

pub async fn get_activities( &self, request: GetActivitiesRequest, ) -> Result<GetActivitiesResponse, TurnkeyClientError>

List activities

List all activities within an organization.

Source

pub async fn approve_activity( &self, organization_id: String, timestamp_ms: u128, params: ApproveActivityIntent, ) -> Result<Activity, TurnkeyClientError>

Approve activity

Approve an activity.

Source

pub async fn reject_activity( &self, organization_id: String, timestamp_ms: u128, params: RejectActivityIntent, ) -> Result<Activity, TurnkeyClientError>

Reject activity

Reject an activity.

Source

pub async fn get_user( &self, request: GetUserRequest, ) -> Result<GetUserResponse, TurnkeyClientError>

Get user

Get details about a user.

Source

pub async fn get_users( &self, request: GetUsersRequest, ) -> Result<GetUsersResponse, TurnkeyClientError>

List users

List all users within an organization.

Source

pub async fn delete_users( &self, organization_id: String, timestamp_ms: u128, params: DeleteUsersIntent, ) -> Result<DeleteUsersResult, TurnkeyClientError>

Delete users

Delete users within an organization.

Source

pub async fn create_policy( &self, organization_id: String, timestamp_ms: u128, params: CreatePolicyIntentV3, ) -> Result<CreatePolicyResult, TurnkeyClientError>

Create policy

Create a new policy.

Source

pub async fn create_policies( &self, organization_id: String, timestamp_ms: u128, params: CreatePoliciesIntent, ) -> Result<CreatePoliciesResult, TurnkeyClientError>

Create policies

Create new policies.

Source

pub async fn update_policy( &self, organization_id: String, timestamp_ms: u128, params: UpdatePolicyIntentV2, ) -> Result<UpdatePolicyResultV2, TurnkeyClientError>

Update policy

Update an existing policy.

Source

pub async fn delete_policy( &self, organization_id: String, timestamp_ms: u128, params: DeletePolicyIntent, ) -> Result<DeletePolicyResult, TurnkeyClientError>

Delete policy

Delete an existing policy.

Source

pub async fn get_policies( &self, request: GetPoliciesRequest, ) -> Result<GetPoliciesResponse, TurnkeyClientError>

List policies

List all policies within an organization.

Source

pub async fn get_policy( &self, request: GetPolicyRequest, ) -> Result<GetPolicyResponse, TurnkeyClientError>

Get policy

Get details about a policy.

Source

pub async fn create_read_only_session( &self, organization_id: String, timestamp_ms: u128, params: CreateReadOnlySessionIntent, ) -> Result<CreateReadOnlySessionResult, TurnkeyClientError>

Create read only session

Create a read only session for a user (valid for 1 hour).

Source

pub async fn create_read_write_session( &self, organization_id: String, timestamp_ms: u128, params: CreateReadWriteSessionIntentV2, ) -> Result<CreateReadWriteSessionResultV2, TurnkeyClientError>

Create read write session

Create a read write session for a user.

Source

pub async fn oauth_login( &self, organization_id: String, timestamp_ms: u128, params: OauthLoginIntent, ) -> Result<OauthLoginResult, TurnkeyClientError>

Login with Oauth

Create an Oauth session for a user.

Source

pub async fn stamp_login( &self, organization_id: String, timestamp_ms: u128, params: StampLoginIntent, ) -> Result<StampLoginResult, TurnkeyClientError>

Login with a stamp

Create a session for a user through stamping client side (API key, wallet client, or passkey client).

Source

pub async fn otp_login( &self, organization_id: String, timestamp_ms: u128, params: OtpLoginIntent, ) -> Result<OtpLoginResult, TurnkeyClientError>

Login with OTP

Create an OTP session for a user.

Source

pub async fn create_private_keys( &self, organization_id: String, timestamp_ms: u128, params: CreatePrivateKeysIntentV2, ) -> Result<CreatePrivateKeysResultV2, TurnkeyClientError>

Create private keys

Create new private keys.

Source

pub async fn get_private_key( &self, request: GetPrivateKeyRequest, ) -> Result<GetPrivateKeyResponse, TurnkeyClientError>

Get private key

Get details about a private key.

Source

pub async fn get_private_keys( &self, request: GetPrivateKeysRequest, ) -> Result<GetPrivateKeysResponse, TurnkeyClientError>

List private keys

List all private keys within an organization.

Source

pub async fn create_api_keys( &self, organization_id: String, timestamp_ms: u128, params: CreateApiKeysIntentV2, ) -> Result<CreateApiKeysResult, TurnkeyClientError>

Create API keys

Add API keys to an existing user.

Source

pub async fn delete_api_keys( &self, organization_id: String, timestamp_ms: u128, params: DeleteApiKeysIntent, ) -> Result<DeleteApiKeysResult, TurnkeyClientError>

Delete API keys

Remove api keys from a user.

Source

pub async fn get_oauth_providers( &self, request: GetOauthProvidersRequest, ) -> Result<GetOauthProvidersResponse, TurnkeyClientError>

Get Oauth providers

Get details about Oauth providers for a user.

Source

pub async fn get_api_keys( &self, request: GetApiKeysRequest, ) -> Result<GetApiKeysResponse, TurnkeyClientError>

Get API keys

Get details about API keys for a user.

Source

pub async fn get_api_key( &self, request: GetApiKeyRequest, ) -> Result<GetApiKeyResponse, TurnkeyClientError>

Get API key

Get details about an API key.

Source

pub async fn create_authenticators( &self, organization_id: String, timestamp_ms: u128, params: CreateAuthenticatorsIntentV2, ) -> Result<CreateAuthenticatorsResult, TurnkeyClientError>

Create authenticators

Create authenticators to authenticate requests to Turnkey.

Source

pub async fn delete_authenticators( &self, organization_id: String, timestamp_ms: u128, params: DeleteAuthenticatorsIntent, ) -> Result<DeleteAuthenticatorsResult, TurnkeyClientError>

Delete authenticators

Remove authenticators from a user.

Source

pub async fn get_authenticators( &self, request: GetAuthenticatorsRequest, ) -> Result<GetAuthenticatorsResponse, TurnkeyClientError>

Get authenticators

Get details about authenticators for a user.

Source

pub async fn get_authenticator( &self, request: GetAuthenticatorRequest, ) -> Result<GetAuthenticatorResponse, TurnkeyClientError>

Get authenticator

Get details about an authenticator.

Source

pub async fn create_invitations( &self, organization_id: String, timestamp_ms: u128, params: CreateInvitationsIntent, ) -> Result<CreateInvitationsResult, TurnkeyClientError>

Create invitations

Create invitations to join an existing organization.

Source

pub async fn delete_invitation( &self, organization_id: String, timestamp_ms: u128, params: DeleteInvitationIntent, ) -> Result<DeleteInvitationResult, TurnkeyClientError>

Delete invitation

Delete an existing invitation.

Source

pub async fn create_users( &self, organization_id: String, timestamp_ms: u128, params: CreateUsersIntentV3, ) -> Result<CreateUsersResult, TurnkeyClientError>

Create users

Create users in an existing organization.

Source

pub async fn update_user( &self, organization_id: String, timestamp_ms: u128, params: UpdateUserIntent, ) -> Result<UpdateUserResult, TurnkeyClientError>

Update user

Update a user in an existing organization.

Source

pub async fn update_user_name( &self, organization_id: String, timestamp_ms: u128, params: UpdateUserNameIntent, ) -> Result<UpdateUserNameResult, TurnkeyClientError>

Update user’s name

Update a user’s name in an existing organization.

Source

pub async fn update_user_email( &self, organization_id: String, timestamp_ms: u128, params: UpdateUserEmailIntent, ) -> Result<UpdateUserEmailResult, TurnkeyClientError>

Update user’s email

Update a user’s email in an existing organization.

Source

pub async fn update_user_phone_number( &self, organization_id: String, timestamp_ms: u128, params: UpdateUserPhoneNumberIntent, ) -> Result<UpdateUserPhoneNumberResult, TurnkeyClientError>

Update user’s phone number

Update a user’s phone number in an existing organization.

Source

pub async fn create_user_tag( &self, organization_id: String, timestamp_ms: u128, params: CreateUserTagIntent, ) -> Result<CreateUserTagResult, TurnkeyClientError>

Create user tag

Create a user tag and add it to users.

Source

pub async fn create_private_key_tag( &self, organization_id: String, timestamp_ms: u128, params: CreatePrivateKeyTagIntent, ) -> Result<CreatePrivateKeyTagResult, TurnkeyClientError>

Create private key tag

Create a private key tag and add it to private keys.

Source

pub async fn update_user_tag( &self, organization_id: String, timestamp_ms: u128, params: UpdateUserTagIntent, ) -> Result<UpdateUserTagResult, TurnkeyClientError>

Update user tag

Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.

Source

pub async fn list_user_tags( &self, request: ListUserTagsRequest, ) -> Result<ListUserTagsResponse, TurnkeyClientError>

List user tags

List all user tags within an organization.

Source

pub async fn delete_user_tags( &self, organization_id: String, timestamp_ms: u128, params: DeleteUserTagsIntent, ) -> Result<DeleteUserTagsResult, TurnkeyClientError>

Delete user tags

Delete user tags within an organization.

Source

pub async fn update_private_key_tag( &self, organization_id: String, timestamp_ms: u128, params: UpdatePrivateKeyTagIntent, ) -> Result<UpdatePrivateKeyTagResult, TurnkeyClientError>

Update private key tag

Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.

Source

pub async fn list_private_key_tags( &self, request: ListPrivateKeyTagsRequest, ) -> Result<ListPrivateKeyTagsResponse, TurnkeyClientError>

List private key tags

List all private key tags within an organization.

Source

pub async fn delete_private_key_tags( &self, organization_id: String, timestamp_ms: u128, params: DeletePrivateKeyTagsIntent, ) -> Result<DeletePrivateKeyTagsResult, TurnkeyClientError>

Delete private key tags

Delete private key tags within an organization.

Source

pub async fn sign_raw_payload( &self, organization_id: String, timestamp_ms: u128, params: SignRawPayloadIntentV2, ) -> Result<SignRawPayloadResult, TurnkeyClientError>

Sign raw payload

Sign a raw payload.

Source

pub async fn sign_raw_payloads( &self, organization_id: String, timestamp_ms: u128, params: SignRawPayloadsIntent, ) -> Result<SignRawPayloadsResult, TurnkeyClientError>

Sign raw payloads

Sign multiple raw payloads with the same signing parameters.

Source

pub async fn sign_transaction( &self, organization_id: String, timestamp_ms: u128, params: SignTransactionIntentV2, ) -> Result<SignTransactionResult, TurnkeyClientError>

Sign transaction

Sign a transaction.

Source

pub async fn create_smart_contract_interface( &self, organization_id: String, timestamp_ms: u128, params: CreateSmartContractInterfaceIntent, ) -> Result<CreateSmartContractInterfaceResult, TurnkeyClientError>

Create smart contract interface

Create an ABI/IDL in JSON.

Source

pub async fn delete_smart_contract_interface( &self, organization_id: String, timestamp_ms: u128, params: DeleteSmartContractInterfaceIntent, ) -> Result<DeleteSmartContractInterfaceResult, TurnkeyClientError>

Delete smart contract interface

Delete a smart contract interface.

Source

pub async fn get_smart_contract_interfaces( &self, request: GetSmartContractInterfacesRequest, ) -> Result<GetSmartContractInterfacesResponse, TurnkeyClientError>

List smart contract interfaces

List all smart contract interfaces within an organization.

Source

pub async fn get_smart_contract_interface( &self, request: GetSmartContractInterfaceRequest, ) -> Result<GetSmartContractInterfaceResponse, TurnkeyClientError>

Get smart contract interface

Get details about a smart contract interface.

Source

pub async fn update_root_quorum( &self, organization_id: String, timestamp_ms: u128, params: UpdateRootQuorumIntent, ) -> Result<UpdateRootQuorumResult, TurnkeyClientError>

Update root quorum

Set the threshold and members of the root quorum. This activity must be approved by the current root quorum.

Source

pub async fn create_wallet( &self, organization_id: String, timestamp_ms: u128, params: CreateWalletIntent, ) -> Result<CreateWalletResult, TurnkeyClientError>

Create wallet

Create a wallet and derive addresses.

Source

pub async fn get_wallets( &self, request: GetWalletsRequest, ) -> Result<GetWalletsResponse, TurnkeyClientError>

List wallets

List all wallets within an organization.

Source

pub async fn get_wallet( &self, request: GetWalletRequest, ) -> Result<GetWalletResponse, TurnkeyClientError>

Get wallet

Get details about a wallet.

Source

pub async fn create_wallet_accounts( &self, organization_id: String, timestamp_ms: u128, params: CreateWalletAccountsIntent, ) -> Result<CreateWalletAccountsResult, TurnkeyClientError>

Create wallet accounts

Derive additional addresses using an existing wallet.

Source

pub async fn get_wallet_accounts( &self, request: GetWalletAccountsRequest, ) -> Result<GetWalletAccountsResponse, TurnkeyClientError>

List wallets accounts

List all accounts within a wallet.

Source

pub async fn get_wallet_account( &self, request: GetWalletAccountRequest, ) -> Result<GetWalletAccountResponse, TurnkeyClientError>

Get wallet account

Get a single wallet account.

Source

pub async fn create_sub_organization( &self, organization_id: String, timestamp_ms: u128, params: CreateSubOrganizationIntentV7, ) -> Result<CreateSubOrganizationResultV7, TurnkeyClientError>

Create sub-organization

Create a new sub-organization.

Source

pub async fn init_user_email_recovery( &self, organization_id: String, timestamp_ms: u128, params: InitUserEmailRecoveryIntent, ) -> Result<InitUserEmailRecoveryResult, TurnkeyClientError>

Init email recovery

Initialize a new email recovery.

Source

pub async fn recover_user( &self, organization_id: String, timestamp_ms: u128, params: RecoverUserIntent, ) -> Result<RecoverUserResult, TurnkeyClientError>

Recover a user

Complete the process of recovering a user by adding an authenticator.

Source

pub async fn set_organization_feature( &self, organization_id: String, timestamp_ms: u128, params: SetOrganizationFeatureIntent, ) -> Result<SetOrganizationFeatureResult, TurnkeyClientError>

Set organization feature

Set an organization feature. This activity must be approved by the current root quorum.

Source

pub async fn remove_organization_feature( &self, organization_id: String, timestamp_ms: u128, params: RemoveOrganizationFeatureIntent, ) -> Result<RemoveOrganizationFeatureResult, TurnkeyClientError>

Remove organization feature

Remove an organization feature. This activity must be approved by the current root quorum.

Source

pub async fn export_private_key( &self, organization_id: String, timestamp_ms: u128, params: ExportPrivateKeyIntent, ) -> Result<ExportPrivateKeyResult, TurnkeyClientError>

Export private key

Export a private key.

Source

pub async fn export_wallet( &self, organization_id: String, timestamp_ms: u128, params: ExportWalletIntent, ) -> Result<ExportWalletResult, TurnkeyClientError>

Export wallet

Export a wallet.

Source

pub async fn email_auth( &self, organization_id: String, timestamp_ms: u128, params: EmailAuthIntentV2, ) -> Result<EmailAuthResult, TurnkeyClientError>

Perform email auth

Authenticate a user via email.

Source

pub async fn export_wallet_account( &self, organization_id: String, timestamp_ms: u128, params: ExportWalletAccountIntent, ) -> Result<ExportWalletAccountResult, TurnkeyClientError>

Export wallet account

Export a wallet account.

Source

pub async fn init_fiat_on_ramp( &self, organization_id: String, timestamp_ms: u128, params: InitFiatOnRampIntent, ) -> Result<InitFiatOnRampResult, TurnkeyClientError>

Init fiat on ramp

Initiate a fiat on ramp flow.

Source

pub async fn init_import_wallet( &self, organization_id: String, timestamp_ms: u128, params: InitImportWalletIntent, ) -> Result<InitImportWalletResult, TurnkeyClientError>

Init import wallet

Initialize a new wallet import.

Source

pub async fn import_wallet( &self, organization_id: String, timestamp_ms: u128, params: ImportWalletIntent, ) -> Result<ImportWalletResult, TurnkeyClientError>

Import wallet

Import a wallet.

Source

pub async fn init_import_private_key( &self, organization_id: String, timestamp_ms: u128, params: InitImportPrivateKeyIntent, ) -> Result<InitImportPrivateKeyResult, TurnkeyClientError>

Init import private key

Initialize a new private key import.

Source

pub async fn import_private_key( &self, organization_id: String, timestamp_ms: u128, params: ImportPrivateKeyIntent, ) -> Result<ImportPrivateKeyResult, TurnkeyClientError>

Import private key

Import a private key.

Source

pub async fn oauth( &self, organization_id: String, timestamp_ms: u128, params: OauthIntent, ) -> Result<OauthResult, TurnkeyClientError>

Oauth

Authenticate a user with an OIDC token (Oauth).

Source

pub async fn init_otp( &self, organization_id: String, timestamp_ms: u128, params: InitOtpIntent, ) -> Result<InitOtpResult, TurnkeyClientError>

Init generic OTP

Initiate a generic OTP activity.

Source

pub async fn verify_otp( &self, organization_id: String, timestamp_ms: u128, params: VerifyOtpIntent, ) -> Result<VerifyOtpResult, TurnkeyClientError>

Verify generic OTP

Verify a generic OTP.

Source

pub async fn init_otp_auth( &self, organization_id: String, timestamp_ms: u128, params: InitOtpAuthIntentV2, ) -> Result<InitOtpAuthResultV2, TurnkeyClientError>

Init OTP auth

Initiate an OTP auth activity.

Source

pub async fn otp_auth( &self, organization_id: String, timestamp_ms: u128, params: OtpAuthIntent, ) -> Result<OtpAuthResult, TurnkeyClientError>

OTP auth

Authenticate a user with an OTP code sent via email or SMS.

Source

pub async fn create_oauth_providers( &self, organization_id: String, timestamp_ms: u128, params: CreateOauthProvidersIntent, ) -> Result<CreateOauthProvidersResult, TurnkeyClientError>

Create Oauth providers

Create Oauth providers for a specified user.

Source

pub async fn delete_oauth_providers( &self, organization_id: String, timestamp_ms: u128, params: DeleteOauthProvidersIntent, ) -> Result<DeleteOauthProvidersResult, TurnkeyClientError>

Delete Oauth providers

Remove Oauth providers for a specified user.

Source

pub async fn get_organization_configs( &self, request: GetOrganizationConfigsRequest, ) -> Result<GetOrganizationConfigsResponse, TurnkeyClientError>

Get configs

Get quorum settings and features for an organization.

Source

pub async fn delete_private_keys( &self, organization_id: String, timestamp_ms: u128, params: DeletePrivateKeysIntent, ) -> Result<DeletePrivateKeysResult, TurnkeyClientError>

Delete private keys

Delete private keys for an organization.

Source

pub async fn update_wallet( &self, organization_id: String, timestamp_ms: u128, params: UpdateWalletIntent, ) -> Result<UpdateWalletResult, TurnkeyClientError>

Update wallet

Update a wallet for an organization.

Source

pub async fn delete_wallets( &self, organization_id: String, timestamp_ms: u128, params: DeleteWalletsIntent, ) -> Result<DeleteWalletsResult, TurnkeyClientError>

Delete wallets

Delete wallets for an organization.

Source

pub async fn delete_sub_organization( &self, organization_id: String, timestamp_ms: u128, params: DeleteSubOrganizationIntent, ) -> Result<DeleteSubOrganizationResult, TurnkeyClientError>

Delete sub-organization

Delete a sub-organization.

Source

pub async fn get_policy_evaluations( &self, request: GetPolicyEvaluationsRequest, ) -> Result<GetPolicyEvaluationsResponse, TurnkeyClientError>

Get policy evaluations

Get the policy evaluations for an activity.

Source

pub async fn create_oauth2_credential( &self, organization_id: String, timestamp_ms: u128, params: CreateOauth2CredentialIntent, ) -> Result<CreateOauth2CredentialResult, TurnkeyClientError>

Create an OAuth 2.0 Credential

Enable authentication for end users with an OAuth 2.0 provider

Source

pub async fn update_oauth2_credential( &self, organization_id: String, timestamp_ms: u128, params: UpdateOauth2CredentialIntent, ) -> Result<UpdateOauth2CredentialResult, TurnkeyClientError>

Update an OAuth 2.0 Credential

Update an OAuth 2.0 provider credential

Source

pub async fn delete_oauth2_credential( &self, organization_id: String, timestamp_ms: u128, params: DeleteOauth2CredentialIntent, ) -> Result<DeleteOauth2CredentialResult, TurnkeyClientError>

Delete an OAuth 2.0 Credential

Disable authentication for end users with an OAuth 2.0 provider

Source

pub async fn list_oauth2_credentials( &self, request: ListOauth2CredentialsRequest, ) -> Result<ListOauth2CredentialsResponse, TurnkeyClientError>

List OAuth 2.0 Credentials

List all OAuth 2.0 credentials within an organization.

Source

pub async fn get_oauth2_credential( &self, request: GetOauth2CredentialRequest, ) -> Result<GetOauth2CredentialResponse, TurnkeyClientError>

Get OAuth 2.0 credential

Get details about an OAuth 2.0 credential.

Source

pub async fn oauth2_authenticate( &self, organization_id: String, timestamp_ms: u128, params: Oauth2AuthenticateIntent, ) -> Result<Oauth2AuthenticateResult, TurnkeyClientError>

OAuth 2.0 authentication

Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities

Source§

impl<S: Stamp> TurnkeyClient<S>

Source

pub fn builder() -> TurnkeyClientBuilder<S>

Creates a new TurnkeyClientBuilder<S>. Configure with .api_key(...) and other options, then call .build().

The type parameter S must implement the Stamp trait.

Source

pub async fn process_activity<Request: Serialize>( &self, request: Request, path: String, ) -> Result<Activity, TurnkeyClientError>

POSTs an activity and polls until the status is “COMPLETE”

process_activity accepts a arbitrary Request and path to POST to the Turnkey API. It encapsulates the polling logic and is generally meant to be called by other activity-specific client functions (e.g. create_sub_organization).

Given the Turnkey API is backwards-compatible, this function can be used to submit old versions of activities. For example, if the latest version for create_sub_organization is “ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7”, you may want to use process_activity to process ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6. Note that this requires manually setting the correct URL and activity request type. The response is an generic Activity. If you’re invoking this function manually you’ll have to manually look at the correct .activity.result enum.

This function is used by our generated client methods and sets the right request type, URL, and deserializes into the proper result type as well. Unless you have good reasons, prefer the type-safe client methods such as sign_raw_payload.

§Returns

This function returns an Activity object which contains the deserialized version of the response.

§Errors

If the server errors with a validation error, a server error, a deserialization error, the proper variant of TurnkeyClientError is returned. If the activity is pending and exceeds the maximum amount of retries allowed, TurnkeyClientError::ExceededRetries is returned. If the activity requires consensus, TurnkeyClientError::ActivityRequiresApproval is returned.

Source

pub fn current_timestamp(&self) -> u128

Returns the current timestamp as a u128.

Source

pub async fn process_request<Request, Response>( &self, request: &Request, path: String, ) -> Result<Response, TurnkeyClientError>
where Request: Serialize, Response: DeserializeOwned,

Processes a Request (at path) by:

  • Serializing the request to JSON
  • Signing the request with the client’s API key
  • POSTing the POST body and the associated stamp to the Turnkey API

This function is generic and can handle POSTing queries or activities.

Trait Implementations§

Source§

impl<S: Stamp> Debug for TurnkeyClient<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> Freeze for TurnkeyClient<S>
where S: Freeze,

§

impl<S> !RefUnwindSafe for TurnkeyClient<S>

§

impl<S> Send for TurnkeyClient<S>
where S: Send,

§

impl<S> Sync for TurnkeyClient<S>
where S: Sync,

§

impl<S> Unpin for TurnkeyClient<S>
where S: Unpin,

§

impl<S> !UnwindSafe for TurnkeyClient<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T