Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Blocking HTTP client for the Releasy API.

Implementations§

Source§

impl Client

Source

pub fn builder(base_url: impl Into<String>, auth: Auth) -> Result<ClientBuilder>

Start building a client with the given base URL and auth.

Source

pub fn new(base_url: impl Into<String>, auth: Auth) -> Result<Self>

Build a client with default configuration.

Source

pub fn with_auth(&self, auth: Auth) -> Self

Return a cloned client with updated authentication.

Source

pub fn openapi_json(&self) -> Result<Value>

Fetch the OpenAPI document from the server.

Source

pub fn health_check(&self) -> Result<HealthResponse>

Check service health (API + database).

Source

pub fn live_check(&self) -> Result<HealthResponse>

Check service liveness.

Source

pub fn ready_check(&self) -> Result<HealthResponse>

Check service readiness.

Source

pub fn list_audit_events( &self, query: &AuditEventListQuery, ) -> Result<AuditEventListResponse>

List audit events with optional filters.

Source

pub fn list_customers( &self, query: &AdminCustomerListQuery, ) -> Result<AdminCustomerListResponse>

List customers with optional filters.

Source

pub fn admin_create_customer( &self, body: &AdminCreateCustomerRequest, ) -> Result<AdminCreateCustomerResponse>

Create a customer (admin only).

Source

pub fn admin_create_customer_with_idempotency( &self, body: &AdminCreateCustomerRequest, idempotency_key: Option<&str>, ) -> Result<AdminCreateCustomerResponse>

Create a customer with an optional idempotency key.

Source

pub fn get_customer(&self, customer_id: &str) -> Result<AdminCustomerResponse>

Fetch a customer by id.

Source

pub fn update_customer( &self, customer_id: &str, body: &AdminUpdateCustomerRequest, ) -> Result<AdminCustomerResponse>

Update customer fields.

Source

pub fn list_users(&self, query: &UserListQuery) -> Result<UserListResponse>

List users with optional filters.

Source

pub fn create_user(&self, body: &UserCreateRequest) -> Result<UserResponse>

Create a user (admin only).

Source

pub fn create_user_with_idempotency( &self, body: &UserCreateRequest, idempotency_key: Option<&str>, ) -> Result<UserResponse>

Create a user with an optional idempotency key.

Source

pub fn get_user(&self, user_id: &str) -> Result<UserResponse>

Fetch a user by id.

Source

pub fn patch_user( &self, user_id: &str, body: &UserPatchRequest, ) -> Result<UserResponse>

Patch a user by id.

Source

pub fn replace_groups( &self, user_id: &str, body: &UserGroupsReplaceRequest, ) -> Result<UserResponse>

Replace the user’s groups.

Source

pub fn reset_credentials( &self, user_id: &str, body: &ResetCredentialsRequest, ) -> Result<()>

Trigger a credential reset email for the user.

Source

pub fn list_entitlements( &self, customer_id: &str, query: &EntitlementListQuery, ) -> Result<EntitlementListResponse>

Source

pub fn create_entitlement( &self, customer_id: &str, body: &EntitlementCreateRequest, ) -> Result<EntitlementResponse>

Source

pub fn update_entitlement( &self, customer_id: &str, entitlement_id: &str, body: &EntitlementUpdateRequest, ) -> Result<EntitlementResponse>

Source

pub fn delete_entitlement( &self, customer_id: &str, entitlement_id: &str, ) -> Result<()>

Source

pub fn admin_create_key( &self, body: &AdminCreateKeyRequest, ) -> Result<AdminCreateKeyResponse>

Source

pub fn admin_revoke_key( &self, body: &AdminRevokeKeyRequest, ) -> Result<AdminRevokeKeyResponse>

Source

pub fn auth_introspect(&self) -> Result<ApiKeyIntrospection>

Source

pub fn create_download_token( &self, body: &DownloadTokenRequest, ) -> Result<DownloadTokenResponse>

Source

pub fn resolve_download_token(&self, token: &str) -> Result<DownloadResolution>

Source

pub fn list_releases( &self, query: &ReleaseListQuery, ) -> Result<ReleaseListResponse>

List releases with optional filters.

Source

pub fn create_release( &self, body: &ReleaseCreateRequest, ) -> Result<ReleaseResponse>

Create a new release.

Source

pub fn delete_release(&self, release_id: &str) -> Result<()>

Source

pub fn register_release_artifact( &self, release_id: &str, body: &ArtifactRegisterRequest, ) -> Result<ArtifactRegisterResponse>

Register a release artifact.

Source

pub fn presign_release_artifact_upload( &self, release_id: &str, body: &ArtifactPresignRequest, ) -> Result<ArtifactPresignResponse>

Request a presigned upload URL for an artifact.

Source

pub fn upload_presigned_artifact( &self, upload_url: &str, file_path: impl AsRef<Path>, ) -> Result<()>

Upload artifact bytes to a presigned URL.

Source

pub fn publish_release(&self, release_id: &str) -> Result<ReleaseResponse>

Publish a release.

Source

pub fn unpublish_release(&self, release_id: &str) -> Result<ReleaseResponse>

Unpublish a release.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.