Skip to main content

Client

Struct Client 

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

Client for RunMat Server API

Version: 0.2.8

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

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.

Source

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

Source

pub async fn auth_me<'a>( &'a self, ) -> Result<ResponseValue<AuthMeResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/auth/me

Source

pub async fn auth_resend_verification<'a>( &'a self, body: &'a AuthResendVerificationRequest, ) -> Result<ResponseValue<AuthResendVerificationResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/auth/resend-verification

Source

pub async fn auth_resolve<'a>( &'a self, body: &'a AuthResolveRequest, ) -> Result<ResponseValue<AuthResolveResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/auth/resolve

Source

pub async fn submit_web_intake<'a>( &'a self, body: &'a WebIntakeRequest, ) -> Result<ResponseValue<WebIntakeResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/lifecycle/intake

Source

pub async fn list_orgs<'a>( &'a self, cursor: Option<&'a str>, limit: Option<u64>, ) -> Result<ResponseValue<OrgListResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/orgs

Source

pub async fn create_org<'a>( &'a self, body: &'a OrgCreateRequest, ) -> Result<ResponseValue<ServerOrgOrg>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/orgs

Source

pub async fn get_policy<'a>( &'a self, org_id: &'a str, ) -> Result<ResponseValue<PolicyResponse>, Error<()>>

Sends a GET request to /v1/orgs/{orgId}/policy

Source

pub async fn list_projects<'a>( &'a self, org_id: &'a str, cursor: Option<&'a str>, limit: Option<u64>, ) -> Result<ResponseValue<ProjectListResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/orgs/{orgId}/projects

Source

pub async fn create_project<'a>( &'a self, org_id: &'a str, body: &'a ProjectCreateRequest, ) -> Result<ResponseValue<ServerOrgProject>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/orgs/{orgId}/projects

Source

pub async fn create_project_import<'a>( &'a self, org_id: &'a str, body: &'a ProjectImportGitRequest, ) -> Result<ResponseValue<ProjectImportGitResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/orgs/{orgId}/projects/import-git

Source

pub async fn create_upgrade_request<'a>( &'a self, org_id: &'a str, body: &'a UpgradeRequestCreateRequest, ) -> Result<ResponseValue<UpgradeRequestCreateResponse>, Error<()>>

Sends a POST request to /v1/orgs/{orgId}/upgrade-request

Source

pub async fn get_usage<'a>( &'a self, org_id: &'a str, end: Option<&'a str>, start: Option<&'a str>, ) -> Result<ResponseValue<UsagePeriodResponse>, Error<()>>

Sends a GET request to /v1/orgs/{orgId}/usage

Source

pub async fn list_usage_notices<'a>( &'a self, org_id: &'a str, ) -> Result<ResponseValue<Vec<UsageNoticeResponse>>, Error<()>>

Sends a GET request to /v1/orgs/{orgId}/usage/notices

Source

pub async fn usage_rollup_event<'a>( &'a self, org_id: &'a str, body: &'a UsageRollupRequest, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/orgs/{orgId}/usage/rollup

Source

pub async fn chunk_upload_targets<'a>( &'a self, project_id: &'a str, body: &'a DataChunkUploadTargetsRequest, ) -> Result<ResponseValue<DataChunkUploadTargetsResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/data/chunks/upload-targets

Source

pub async fn manifest<'a>( &'a self, project_id: &'a str, path: &'a str, version: Option<&'a str>, ) -> Result<ResponseValue<DataManifestDescriptorResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/data/manifest

Source

pub async fn canonicalize<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<FsPathQuery>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/canonicalize

Source

pub async fn commit<'a>( &'a self, project_id: &'a str, body: &'a FsCommitRequest, ) -> Result<ResponseValue<FsCommitResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/commit

Source

pub async fn list_dir<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<Vec<FsDirEntry>>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/fs/dir

Source

pub async fn delete_dir<'a>( &'a self, project_id: &'a str, path: &'a str, recursive: Option<bool>, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a DELETE request to /v1/projects/{projectId}/fs/dir

Source

pub async fn download_url<'a>( &'a self, project_id: &'a str, path: &'a str, version_id: Option<&'a str>, ) -> Result<ResponseValue<FsDownloadUrlResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/fs/download-url

Source

pub async fn delete_file<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a DELETE request to /v1/projects/{projectId}/fs/file

Source

pub async fn git_receive<'a, B: Into<Body>>( &'a self, project_id: &'a str, body: B, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/git/receive

Source

pub async fn git_refs<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<FsGitRefsResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/git/refs

Source

pub async fn git_upload<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/git/upload

Source

pub async fn delete_history_version<'a>( &'a self, project_id: &'a str, version_id: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Sends a DELETE request to /v1/projects/{projectId}/fs/history/{versionId}

Source

pub async fn manifest_get_v1_projects_project_id_fs_manifest<'a>( &'a self, project_id: &'a str, path: &'a str, version_id: Option<&'a str>, ) -> Result<ResponseValue<FsManifestResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/manifest

Source

pub async fn manifest_history<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<FsManifestHistoryResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/manifest/history

Source

pub async fn manifest_update<'a>( &'a self, project_id: &'a str, body: &'a FsManifestUpdateRequest, ) -> Result<ResponseValue<FsCommitResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/manifest/update

Source

pub async fn manifest_urls<'a>( &'a self, project_id: &'a str, path: &'a str, version_id: Option<&'a str>, ) -> Result<ResponseValue<FsManifestUrlsResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/manifest/urls

Source

pub async fn metadata<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<FsMetadataResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/fs/metadata

Source

pub async fn mkdir<'a>( &'a self, project_id: &'a str, body: &'a FsMkdirRequest, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/mkdir

Source

pub async fn read<'a>( &'a self, project_id: &'a str, length: Option<i64>, offset: i64, path: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Reads file bytes from the project filesystem. This endpoint also accepts

readonly reference paths like reference:runmat/docs/search.md, resolving them through the bound RunMat reference variant.

Sends a GET request to /v1/projects/{projectId}/fs/read

Source

pub async fn rename<'a>( &'a self, project_id: &'a str, body: &'a FsRenameRequest, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/rename

Source

pub async fn get_retention<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<FsRetentionResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/retention

Source

pub async fn update_retention<'a>( &'a self, project_id: &'a str, body: &'a FsRetentionUpdateRequest, ) -> Result<ResponseValue<FsRetentionResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/retention

Source

pub async fn index<'a>( &'a self, project_id: &'a str, artifact_root: Option<&'a str>, cursor: Option<&'a str>, doc_path: Option<&'a str>, include: Option<&'a str>, limit: Option<u64>, ) -> Result<ResponseValue<FsRunsIndexResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/fs/runs/index

Source

pub async fn set_readonly<'a>( &'a self, project_id: &'a str, body: &'a FsSetReadonlyRequest, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/set-readonly

Source

pub async fn list_snapshots<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<FsSnapshotListResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/snapshots

Source

pub async fn create_snapshot<'a>( &'a self, project_id: &'a str, body: &'a FsSnapshotCreateRequest, ) -> Result<ResponseValue<FsSnapshotResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/snapshots

Source

pub async fn list_snapshot_tags<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<FsSnapshotTagListResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/snapshots/tags

Source

pub async fn delete_snapshot_tag<'a>( &'a self, project_id: &'a str, tag: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a DELETE request to /v1/projects/{projectId}/fs/snapshots/tags/{tag}

Source

pub async fn delete_snapshot<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a DELETE request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}

Source

pub async fn snapshot_diff<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, base_snapshot_id: Option<&'a str>, compare_to_current: Option<bool>, ) -> Result<ResponseValue<FsSnapshotDiffResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}/diff

Source

pub async fn list_snapshot_entries<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, ) -> Result<ResponseValue<FsSnapshotEntryListResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}/entries

Source

pub async fn snapshot_git_export<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}/git-export

Source

pub async fn restore_snapshot<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, body: Option<&'a FsSnapshotRestoreRequest>, ) -> Result<ResponseValue<ByteStream>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}/restore

Source

pub async fn set_snapshot_tag<'a>( &'a self, project_id: &'a str, snapshot_id: &'a str, body: &'a FsSnapshotTagRequest, ) -> Result<ResponseValue<FsSnapshotTagResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/snapshots/{snapshotId}/tags

Source

pub async fn storage_summary<'a>( &'a self, project_id: &'a str, artifact_root: Option<&'a str>, ) -> Result<ResponseValue<FsStorageSummaryResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/fs/storage-summary

Source

pub async fn delete_storage_category<'a>( &'a self, project_id: &'a str, body: &'a FsStorageDeleteCategoryRequest, ) -> Result<ResponseValue<FsStorageDeleteCategoryResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/storage/delete-category

Source

pub async fn upload_session<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionRequest, ) -> Result<ResponseValue<FsUploadSessionResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session

Source

pub async fn upload_session_abort<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionAbortRequest, ) -> Result<ResponseValue<FsUploadSessionAbortResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session/abort

Source

pub async fn upload_session_chunks<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionChunksRequest, ) -> Result<ResponseValue<FsUploadSessionChunksResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session/chunks

Source

pub async fn upload_session_complete<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionCompleteRequest, ) -> Result<ResponseValue<FsCommitResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session/complete

Source

pub async fn upload_session_keepalive<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionKeepaliveRequest, ) -> Result<ResponseValue<FsUploadSessionKeepaliveResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session/keepalive

Source

pub async fn upload_session_start<'a>( &'a self, project_id: &'a str, body: &'a FsUploadSessionStartRequest, ) -> Result<ResponseValue<FsUploadSessionStartResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/fs/upload-session/start

Source

pub async fn upload_session_status<'a>( &'a self, project_id: &'a str, session_id: &'a str, blob_key: &'a str, ) -> Result<ResponseValue<FsUploadSessionStatusResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/fs/upload-session/{sessionId}

Source

pub async fn write<'a>( &'a self, project_id: &'a str, final_: Option<bool>, hash: Option<&'a str>, offset: i64, path: &'a str, truncate: bool, ) -> Result<ResponseValue<FsCommitResponse>, Error<CrateErrorsErrorResponse>>

Sends a PUT request to /v1/projects/{projectId}/fs/write

Source

pub async fn list_history<'a>( &'a self, project_id: &'a str, path: &'a str, ) -> Result<ResponseValue<FsHistoryListResponse>, Error<()>>

Sends a GET request to /v1/projects/{projectId}/history

Source

pub async fn restore_history<'a>( &'a self, project_id: &'a str, body: &'a FsHistoryRestoreRequest, ) -> Result<ResponseValue<FsCommitResponse>, Error<()>>

Sends a POST request to /v1/projects/{projectId}/history/restore

Source

pub async fn get_project_import_status<'a>( &'a self, project_id: &'a str, ) -> Result<ResponseValue<Option<ProjectImportStatusResponse>>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/import

Source

pub async fn list_project_memberships<'a>( &'a self, project_id: &'a str, cursor: Option<&'a str>, limit: Option<u64>, ) -> Result<ResponseValue<ProjectMembershipListResponse>, Error<CrateErrorsErrorResponse>>

Sends a GET request to /v1/projects/{projectId}/memberships

Source

pub async fn create_project_membership<'a>( &'a self, project_id: &'a str, body: &'a ProjectMembershipCreateRequest, ) -> Result<ResponseValue<ServerOrgProjectMembership>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/projects/{projectId}/memberships

Source

pub async fn delete_project_membership<'a>( &'a self, project_id: &'a str, membership_id: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<CrateErrorsErrorResponse>>

Sends a DELETE request to /v1/projects/{projectId}/memberships/{membershipId}

Source

pub async fn update_project_membership<'a>( &'a self, project_id: &'a str, membership_id: &'a str, body: &'a ProjectMembershipUpdateRequest, ) -> Result<ResponseValue<ServerOrgProjectMembership>, Error<CrateErrorsErrorResponse>>

Sends a PATCH request to /v1/projects/{projectId}/memberships/{membershipId}

Source

pub async fn ingest_telemetry<'a>( &'a self, body: &'a TelemetryIngestRequest, ) -> Result<ResponseValue<TelemetryIngestResponse>, Error<CrateErrorsErrorResponse>>

Sends a POST request to /v1/t

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
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§

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> 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> 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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,