pub struct Client { /* private fields */ }Expand description
Blocking HTTP client for the Releasy API.
Implementations§
Source§impl Client
impl Client
Sourcepub fn builder(base_url: impl Into<String>, auth: Auth) -> Result<ClientBuilder>
pub fn builder(base_url: impl Into<String>, auth: Auth) -> Result<ClientBuilder>
Start building a client with the given base URL and auth.
Sourcepub fn new(base_url: impl Into<String>, auth: Auth) -> Result<Self>
pub fn new(base_url: impl Into<String>, auth: Auth) -> Result<Self>
Build a client with default configuration.
Sourcepub fn with_auth(&self, auth: Auth) -> Self
pub fn with_auth(&self, auth: Auth) -> Self
Return a cloned client with updated authentication.
Sourcepub fn openapi_json(&self) -> Result<Value>
pub fn openapi_json(&self) -> Result<Value>
Fetch the OpenAPI document from the server.
Sourcepub fn health_check(&self) -> Result<HealthResponse>
pub fn health_check(&self) -> Result<HealthResponse>
Check service health (API + database).
Sourcepub fn live_check(&self) -> Result<HealthResponse>
pub fn live_check(&self) -> Result<HealthResponse>
Check service liveness.
Sourcepub fn ready_check(&self) -> Result<HealthResponse>
pub fn ready_check(&self) -> Result<HealthResponse>
Check service readiness.
Sourcepub fn list_audit_events(
&self,
query: &AuditEventListQuery,
) -> Result<AuditEventListResponse>
pub fn list_audit_events( &self, query: &AuditEventListQuery, ) -> Result<AuditEventListResponse>
List audit events with optional filters.
Sourcepub fn list_customers(
&self,
query: &AdminCustomerListQuery,
) -> Result<AdminCustomerListResponse>
pub fn list_customers( &self, query: &AdminCustomerListQuery, ) -> Result<AdminCustomerListResponse>
List customers with optional filters.
Sourcepub fn admin_create_customer(
&self,
body: &AdminCreateCustomerRequest,
) -> Result<AdminCreateCustomerResponse>
pub fn admin_create_customer( &self, body: &AdminCreateCustomerRequest, ) -> Result<AdminCreateCustomerResponse>
Create a customer (admin only).
Sourcepub fn admin_create_customer_with_idempotency(
&self,
body: &AdminCreateCustomerRequest,
idempotency_key: Option<&str>,
) -> Result<AdminCreateCustomerResponse>
pub fn admin_create_customer_with_idempotency( &self, body: &AdminCreateCustomerRequest, idempotency_key: Option<&str>, ) -> Result<AdminCreateCustomerResponse>
Create a customer with an optional idempotency key.
Sourcepub fn get_customer(&self, customer_id: &str) -> Result<AdminCustomerResponse>
pub fn get_customer(&self, customer_id: &str) -> Result<AdminCustomerResponse>
Fetch a customer by id.
Sourcepub fn update_customer(
&self,
customer_id: &str,
body: &AdminUpdateCustomerRequest,
) -> Result<AdminCustomerResponse>
pub fn update_customer( &self, customer_id: &str, body: &AdminUpdateCustomerRequest, ) -> Result<AdminCustomerResponse>
Update customer fields.
Sourcepub fn list_users(&self, query: &UserListQuery) -> Result<UserListResponse>
pub fn list_users(&self, query: &UserListQuery) -> Result<UserListResponse>
List users with optional filters.
Sourcepub fn create_user(&self, body: &UserCreateRequest) -> Result<UserResponse>
pub fn create_user(&self, body: &UserCreateRequest) -> Result<UserResponse>
Create a user (admin only).
Sourcepub fn create_user_with_idempotency(
&self,
body: &UserCreateRequest,
idempotency_key: Option<&str>,
) -> Result<UserResponse>
pub fn create_user_with_idempotency( &self, body: &UserCreateRequest, idempotency_key: Option<&str>, ) -> Result<UserResponse>
Create a user with an optional idempotency key.
Sourcepub fn get_user(&self, user_id: &str) -> Result<UserResponse>
pub fn get_user(&self, user_id: &str) -> Result<UserResponse>
Fetch a user by id.
Sourcepub fn patch_user(
&self,
user_id: &str,
body: &UserPatchRequest,
) -> Result<UserResponse>
pub fn patch_user( &self, user_id: &str, body: &UserPatchRequest, ) -> Result<UserResponse>
Patch a user by id.
Sourcepub fn replace_groups(
&self,
user_id: &str,
body: &UserGroupsReplaceRequest,
) -> Result<UserResponse>
pub fn replace_groups( &self, user_id: &str, body: &UserGroupsReplaceRequest, ) -> Result<UserResponse>
Replace the user’s groups.
Sourcepub fn reset_credentials(
&self,
user_id: &str,
body: &ResetCredentialsRequest,
) -> Result<()>
pub fn reset_credentials( &self, user_id: &str, body: &ResetCredentialsRequest, ) -> Result<()>
Trigger a credential reset email for the user.
pub fn list_entitlements( &self, customer_id: &str, query: &EntitlementListQuery, ) -> Result<EntitlementListResponse>
pub fn create_entitlement( &self, customer_id: &str, body: &EntitlementCreateRequest, ) -> Result<EntitlementResponse>
pub fn update_entitlement( &self, customer_id: &str, entitlement_id: &str, body: &EntitlementUpdateRequest, ) -> Result<EntitlementResponse>
pub fn delete_entitlement( &self, customer_id: &str, entitlement_id: &str, ) -> Result<()>
pub fn admin_create_key( &self, body: &AdminCreateKeyRequest, ) -> Result<AdminCreateKeyResponse>
pub fn admin_revoke_key( &self, body: &AdminRevokeKeyRequest, ) -> Result<AdminRevokeKeyResponse>
pub fn auth_introspect(&self) -> Result<ApiKeyIntrospection>
pub fn create_download_token( &self, body: &DownloadTokenRequest, ) -> Result<DownloadTokenResponse>
pub fn resolve_download_token(&self, token: &str) -> Result<DownloadResolution>
Sourcepub fn list_releases(
&self,
query: &ReleaseListQuery,
) -> Result<ReleaseListResponse>
pub fn list_releases( &self, query: &ReleaseListQuery, ) -> Result<ReleaseListResponse>
List releases with optional filters.
Sourcepub fn create_release(
&self,
body: &ReleaseCreateRequest,
) -> Result<ReleaseResponse>
pub fn create_release( &self, body: &ReleaseCreateRequest, ) -> Result<ReleaseResponse>
Create a new release.
pub fn delete_release(&self, release_id: &str) -> Result<()>
Sourcepub fn register_release_artifact(
&self,
release_id: &str,
body: &ArtifactRegisterRequest,
) -> Result<ArtifactRegisterResponse>
pub fn register_release_artifact( &self, release_id: &str, body: &ArtifactRegisterRequest, ) -> Result<ArtifactRegisterResponse>
Register a release artifact.
Sourcepub fn presign_release_artifact_upload(
&self,
release_id: &str,
body: &ArtifactPresignRequest,
) -> Result<ArtifactPresignResponse>
pub fn presign_release_artifact_upload( &self, release_id: &str, body: &ArtifactPresignRequest, ) -> Result<ArtifactPresignResponse>
Request a presigned upload URL for an artifact.
Sourcepub fn upload_presigned_artifact(
&self,
upload_url: &str,
file_path: impl AsRef<Path>,
) -> Result<()>
pub fn upload_presigned_artifact( &self, upload_url: &str, file_path: impl AsRef<Path>, ) -> Result<()>
Upload artifact bytes to a presigned URL.
Sourcepub fn publish_release(&self, release_id: &str) -> Result<ReleaseResponse>
pub fn publish_release(&self, release_id: &str) -> Result<ReleaseResponse>
Publish a release.
Sourcepub fn unpublish_release(&self, release_id: &str) -> Result<ReleaseResponse>
pub fn unpublish_release(&self, release_id: &str) -> Result<ReleaseResponse>
Unpublish a release.