pub struct Client { /* private fields */ }Expand description
Client for One SDK
Curated One API surface for the One SDK.
Version: 0.1.0
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Result<Self, Error>
pub fn new(baseurl: &str) -> Result<Self, Error>
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Returns an error if the reqwest::Client cannot be built,
for example when the TLS backend fails to initialize.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub async fn list_reachable_connections<'a>(
&'a self,
limit: Option<i64>,
page: Option<i64>,
skip: Option<i64>,
x_one_organization_id: Option<&'a Uuid>,
x_one_project_id: Option<&'a Uuid>,
) -> Result<ResponseValue<PaginatedReachableConnectionView>, Error<ErrorResponse>>
pub async fn list_reachable_connections<'a>( &'a self, limit: Option<i64>, page: Option<i64>, skip: Option<i64>, x_one_organization_id: Option<&'a Uuid>, x_one_project_id: Option<&'a Uuid>, ) -> Result<ResponseValue<PaginatedReachableConnectionView>, Error<ErrorResponse>>
List reachable connections
Lists every connection the caller’s grant reaches - the connections it can read plus the ones it can only run a custom action on - each labelled with the access it confers. A connection the grant cannot read carries only its key, connector and access label, never the connection record.
Sends a GET request to /v1/connections/reachable
Arguments:
limit: Items per page. Default 20, hard-capped at 150.limit=0is treated as 1. Larger values silently clamp. Absent until the request or a caller names one, so a route with its own default can tell.page: Page number for pagination (1-indexed). Defaults to 1.skip: Number of items to skip before the first returned item. Defaults to 0. Most callers should leave this at 0 and rely onpage+limit.x_one_organization_id: Selects the tenant this request acts in. Omit it to act in your personal scope.x_one_project_id: Selects the tenant this request acts in. Omit it to act in your personal scope.
Sourcepub async fn list_vault_connections<'a>(
&'a self,
identity: Option<&'a str>,
identity_type: Option<ConnectionIdentityType>,
key: Option<&'a str>,
limit: Option<i64>,
page: Option<i64>,
platform: Option<&'a str>,
skip: Option<i64>,
tags: Option<&'a str>,
x_one_organization_id: Option<&'a Uuid>,
x_one_project_id: Option<&'a Uuid>,
) -> Result<ResponseValue<PaginatedVaultConnectionView>, Error<ErrorResponse>>
pub async fn list_vault_connections<'a>( &'a self, identity: Option<&'a str>, identity_type: Option<ConnectionIdentityType>, key: Option<&'a str>, limit: Option<i64>, page: Option<i64>, platform: Option<&'a str>, skip: Option<i64>, tags: Option<&'a str>, x_one_organization_id: Option<&'a Uuid>, x_one_project_id: Option<&'a Uuid>, ) -> Result<ResponseValue<PaginatedVaultConnectionView>, Error<ErrorResponse>>
List vault connections
Returns the connections you have access to. The result is filtered to your scope automatically — your own connections, your organization’s, or your project’s, depending on the key you use. Filter further by platform, identity, key, or tags.
Sends a GET request to /v1/vault/connections
Arguments:
identity: Filter by the upstream platform identity (e.g. the user’s email or remote account id) the connection authenticates as.identity_type: Restrict the result to connections of the given identity type (user,account,workspace, etc.).key: Filter by exact connection key. Accepts a single key or a comma-separated list.limit: Items per page. Default 20, hard-capped at 150.limit=0is treated as 1. Larger values silently clamp. Absent until the request or a caller names one, so a route with its own default can tell.page: Page number for pagination (1-indexed). Defaults to 1.platform: Filter by platform identifier (e.g.gmail,shopify).skip: Number of items to skip before the first returned item. Defaults to 0. Most callers should leave this at 0 and rely onpage+limit.tags: Filter by tags attached to the connection. Accepts a single tag or a comma-separated list.x_one_organization_id: Selects the tenant this request acts in. Omit it to act in your personal scope.x_one_project_id: Selects the tenant this request acts in. Omit it to act in your personal scope.
Sourcepub async fn upsert_webhook_subscription<'a>(
&'a self,
key: &'a str,
body: &'a UpsertSubscriptionParams,
) -> Result<ResponseValue<WebhookSubscriptionView>, Error<ErrorResponse>>
pub async fn upsert_webhook_subscription<'a>( &'a self, key: &'a str, body: &'a UpsertSubscriptionParams, ) -> Result<ResponseValue<WebhookSubscriptionView>, Error<ErrorResponse>>
Create or reconcile a webhook listener
Registers a listener under a stable name you choose. Calling it again with the same name reconciles the existing listener instead of creating a second one, so it is safe to run on every application boot. A signing secret is required, because deliveries are only signed when the subscription has one.
Sends a PUT request to /v1/webhooks/subscriptions/by-key/{key}
Arguments:
key: Stable listener name, unique per accountbody