Struct Client

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

Client for Edgee API

Version: 1

Implementations§

Source§

impl Client

Source

pub async fn upload_file(&self, path: &Path) -> Result<String>

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 fn list_api_tokens(&self) -> ListApiTokens<'_>

List all ApiTokens

Returns a list of your ApiTokens. The ApiTokens are returned sorted by creation date, with the most recent ApiTokens appearing first.

Sends a GET request to /v1/api_tokens

let response = client.list_api_tokens()
    .limit(limit)
    .name(name)
    .order_direction(order_direction)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn create_api_token(&self) -> CreateApiToken<'_>

Create a new ApiToken

Creates a new ApiToken. The ApiToken is returned, including its token field, which you should record for future reference. Be careful, this token is only returned once, when the token is created.

Sends a POST request to /v1/api_tokens

let response = client.create_api_token()
    .body(body)
    .send()
    .await;
Source

pub fn get_api_token(&self) -> GetApiToken<'_>

Get an ApiToken

Retrieve an ApiToken that has previously been created.

Sends a GET request to /v1/api_tokens/{id}

let response = client.get_api_token()
    .id(id)
    .send()
    .await;
Source

pub fn delete_api_token(&self) -> DeleteApiToken<'_>

Delete an ApiToken

Delete an ApiToken that has previously been created. Once deleted, the ApiToken can no longer be used to authenticate requests.

Sends a DELETE request to /v1/api_tokens/{id}

let response = client.delete_api_token()
    .id(id)
    .send()
    .await;
Source

pub fn list_organizations(&self) -> ListOrganizations<'_>

List all Organizations

Returns a list of your Organizations. The Organizations are returned sorted by creation date, with the most recent Organizations appearing first.

Sends a GET request to /v1/organizations

let response = client.list_organizations()
    .limit(limit)
    .name(name)
    .order_direction(order_direction)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn create_organization(&self) -> CreateOrganization<'_>

Create a new Organization

Creates a new Organization.

Sends a POST request to /v1/organizations

let response = client.create_organization()
    .body(body)
    .send()
    .await;
Source

pub fn get_my_organization(&self) -> GetMyOrganization<'_>

Get my Organization

Retrieve my Organization personal organization.

Sends a GET request to /v1/organizations/me

let response = client.get_my_organization()
    .send()
    .await;
Source

pub fn get_organization(&self) -> GetOrganization<'_>

Get an Organization

Retrieve an Organization that has previously been created.

Sends a GET request to /v1/organizations/{id}

let response = client.get_organization()
    .id(id)
    .send()
    .await;
Source

pub fn update_organization(&self) -> UpdateOrganization<'_>

Update an Organization

Updates an existing Organization.

Sends a POST request to /v1/organizations/{id}

let response = client.update_organization()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_organization(&self) -> DeleteOrganization<'_>

Delete an Organization

Deletes an existing Organization.

Sends a DELETE request to /v1/organizations/{id}

let response = client.delete_organization()
    .id(id)
    .send()
    .await;
Source

pub fn list_organizations_users(&self) -> ListOrganizationsUsers<'_>

List Users of an organizations

Retrieves all the Users of an organizations.

Sends a GET request to /v1/organizations/{id}/users

let response = client.list_organizations_users()
    .id(id)
    .limit(limit)
    .order_direction(order_direction)
    .role(role)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn update_organization_user(&self) -> UpdateOrganizationUser<'_>

Update a User of an Organization

Updates an existing User of an Organization.

Sends a POST request to /v1/organizations/{id}/users/{userId}

let response = client.update_organization_user()
    .id(id)
    .user_id(user_id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_organization_user(&self) -> DeleteOrganizationUser<'_>

Delete a User from an Organization

Remove an existing User from an Organization.

Sends a DELETE request to /v1/organizations/{id}/users/{userId}

let response = client.delete_organization_user()
    .id(id)
    .user_id(user_id)
    .send()
    .await;
Source

pub fn list_projects(&self) -> ListProjects<'_>

List all Projects

Returns a list of your Projects. The Projects are returned sorted by creation date, with the most recent Project appearing first.

Sends a GET request to /v1/projects

let response = client.list_projects()
    .limit(limit)
    .order_direction(order_direction)
    .organization_id(organization_id)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn create_project(&self) -> CreateProject<'_>

Create a new Project

Creates a new Project.

Sends a POST request to /v1/projects

let response = client.create_project()
    .body(body)
    .send()
    .await;
Source

pub fn get_project(&self) -> GetProject<'_>

Get a Project

Retrieve a Project that has previously been created.

Sends a GET request to /v1/projects/{id}

let response = client.get_project()
    .id(id)
    .organization_id(organization_id)
    .send()
    .await;
Source

pub fn update_project(&self) -> UpdateProject<'_>

Update a Project

Updates an existing Project.

Sends a POST request to /v1/projects/{id}

let response = client.update_project()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_project(&self) -> DeleteProject<'_>

Delete a Project

Deletes an existing Project.

Sends a DELETE request to /v1/projects/{id}

let response = client.delete_project()
    .id(id)
    .send()
    .await;
Source

pub fn get_project_counters(&self) -> GetProjectCounters<'_>

List all statistics for a given project

List all statistics for a given project.

Sends a GET request to /v1/projects/{id}/counters

let response = client.get_project_counters()
    .id(id)
    .day(day)
    .month(month)
    .send()
    .await;
Source

pub fn get_project_component_counters(&self) -> GetProjectComponentCounters<'_>

List all Counters for a given project component

List all Counters for a given project component.

Sends a GET request to /v1/projects/{id}/components/{componentId}/counters

let response = client.get_project_component_counters()
    .id(id)
    .component_id(component_id)
    .day(day)
    .month(month)
    .send()
    .await;
Source

pub fn list_project_domains(&self) -> ListProjectDomains<'_>

List all Domains

Retrieves all the Domains of a project.

Sends a GET request to /v1/projects/{id}/domains

let response = client.list_project_domains()
    .id(id)
    .send()
    .await;
Source

pub fn create_project_domain(&self) -> CreateProjectDomain<'_>

Create a new Domain

Creates a new Domain of a project.

Sends a POST request to /v1/projects/{id}/domains

let response = client.create_project_domain()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn get_project_domain(&self) -> GetProjectDomain<'_>

Get a Domain

Retrieve a Domain that has previously been created.

Sends a GET request to /v1/projects/{id}/domains/{name}

let response = client.get_project_domain()
    .id(id)
    .name(name)
    .send()
    .await;
Source

pub fn update_project_domain(&self) -> UpdateProjectDomain<'_>

Update a Domain

Updates an existing Domain.

Sends a POST request to /v1/projects/{id}/domains/{name}

let response = client.update_project_domain()
    .id(id)
    .name(name)
    .body(body)
    .send()
    .await;
Source

pub fn delete_project_domain(&self) -> DeleteProjectDomain<'_>

Delete a Domain

Deletes an existing Domain.

Sends a DELETE request to /v1/projects/{id}/domains/{name}

let response = client.delete_project_domain()
    .id(id)
    .name(name)
    .send()
    .await;
Source

pub fn list_project_proxy_settings(&self) -> ListProjectProxySettings<'_>

List Proxy Settings revisions of a project

Retrieves all the Proxy Settings revisions of a project.

Sends a GET request to /v1/projects/{id}/proxy-settings

let response = client.list_project_proxy_settings()
    .id(id)
    .send()
    .await;
Source

pub fn create_project_proxy_settings(&self) -> CreateProjectProxySettings<'_>

Create a new ProxySettings

Creates a new ProxySettings.

Sends a POST request to /v1/projects/{id}/proxy-settings

let response = client.create_project_proxy_settings()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn update_project_proxy_settings(&self) -> UpdateProjectProxySettings<'_>

Update a ProxySettings by its revision number

Updates a ProxySettings.

Sends a POST request to /v1/projects/{id}/proxy-settings/{revision}

let response = client.update_project_proxy_settings()
    .id(id)
    .revision(revision)
    .body(body)
    .send()
    .await;
Source

pub fn list_project_components(&self) -> ListProjectComponents<'_>

List all Project Components

Retrieves all the Components of a project.

Sends a GET request to /v1/projects/{id}/components

let response = client.list_project_components()
    .id(id)
    .category(category)
    .subcategory(subcategory)
    .send()
    .await;
Source

pub fn create_project_component(&self) -> CreateProjectComponent<'_>

Create a new Project Component

Creates a new Component for a project.

Sends a POST request to /v1/projects/{id}/components

let response = client.create_project_component()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn get_project_component(&self) -> GetProjectComponent<'_>

Get a Component of a project

Retrieve a Project Component that has previously been set up.

Sends a GET request to /v1/projects/{id}/components/{project_component_id}

let response = client.get_project_component()
    .id(id)
    .project_component_id(project_component_id)
    .send()
    .await;
Source

pub fn update_project_component(&self) -> UpdateProjectComponent<'_>

Update a Project Component

Updates an existing Project Component.

Sends a POST request to /v1/projects/{id}/components/{project_component_id}

let response = client.update_project_component()
    .id(id)
    .project_component_id(project_component_id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_project_component(&self) -> DeleteProjectComponent<'_>

Delete a Project Component

Deletes an existing Project Component.

Sends a DELETE request to /v1/projects/{id}/components/{project_component_id}

let response = client.delete_project_component()
    .id(id)
    .project_component_id(project_component_id)
    .send()
    .await;
Source

pub fn purge_project_cache(&self) -> PurgeProjectCache<'_>

Purge cache for a project

Purge the cache for a specific project. You can purge all cache or purge cache for a specific path. When purging by path, the cache for all domains associated with the project will be purged for that path.

Sends a POST request to /v1/projects/{id}/purge-cache

Arguments:

  • id: The project ID
  • body
let response = client.purge_project_cache()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn list_public_components(&self) -> ListPublicComponents<'_>

List public components

Returns a list of public components.

Sends a GET request to /v1/components

let response = client.list_public_components()
    .category(category)
    .subcategory(subcategory)
    .send()
    .await;
Source

pub fn create_component(&self) -> CreateComponent<'_>

Create a Component

Create a Component.

Sends a POST request to /v1/components

let response = client.create_component()
    .body(body)
    .send()
    .await;
Source

pub fn get_component_by_uuid(&self) -> GetComponentByUuid<'_>

Get a Component by Uuid

Retrieve a Component by Uuid.

Sends a GET request to /v1/components/{id}

let response = client.get_component_by_uuid()
    .id(id)
    .send()
    .await;
Source

pub fn update_component_by_uuid(&self) -> UpdateComponentByUuid<'_>

Update a Component by Uuid

Updates an existing Component by Uuid.

Sends a PUT request to /v1/components/{id}

let response = client.update_component_by_uuid()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_component_by_uuid(&self) -> DeleteComponentByUuid<'_>

Delete a Component by Uuid

Delete an existing Component by Uuid.

Sends a DELETE request to /v1/components/{id}

let response = client.delete_component_by_uuid()
    .id(id)
    .send()
    .await;
Source

pub fn get_component_by_slug(&self) -> GetComponentBySlug<'_>

Get a Component by Slug

Retrieve a Component by Slug.

Sends a GET request to /v1/components/{orgSlug}/{componentSlug}

let response = client.get_component_by_slug()
    .org_slug(org_slug)
    .component_slug(component_slug)
    .send()
    .await;
Source

pub fn update_component_by_slug(&self) -> UpdateComponentBySlug<'_>

Update a Component by Slug

Updates an existing Component by Slug.

Sends a PUT request to /v1/components/{orgSlug}/{componentSlug}

let response = client.update_component_by_slug()
    .org_slug(org_slug)
    .component_slug(component_slug)
    .body(body)
    .send()
    .await;
Source

pub fn delete_component_by_slug(&self) -> DeleteComponentBySlug<'_>

Delete a Component by Slug

Delete an existing Component by Slug.

Sends a DELETE request to /v1/components/{orgSlug}/{componentSlug}

let response = client.delete_component_by_slug()
    .org_slug(org_slug)
    .component_slug(component_slug)
    .send()
    .await;
Source

pub fn create_component_version_by_uuid( &self, ) -> CreateComponentVersionByUuid<'_>

Create a Component Version

Create a Component Version.

Sends a POST request to /v1/components/{id}/versions

let response = client.create_component_version_by_uuid()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn create_component_version_by_slug( &self, ) -> CreateComponentVersionBySlug<'_>

Create a Component Version by Slug

Create a Component Version by Slug.

Sends a POST request to /v1/components/{orgSlug}/{componentSlug}/versions

let response = client.create_component_version_by_slug()
    .org_slug(org_slug)
    .component_slug(component_slug)
    .body(body)
    .send()
    .await;
Source

pub fn update_component_version_by_slug( &self, ) -> UpdateComponentVersionBySlug<'_>

Update a Component Version by Slug

Update a Component Version by Slug.

Sends a PUT request to /v1/components/{orgSlug}/{componentSlug}/versions/{versionId}

let response = client.update_component_version_by_slug()
    .org_slug(org_slug)
    .component_slug(component_slug)
    .version_id(version_id)
    .body(body)
    .send()
    .await;
Source

pub fn list_organization_components(&self) -> ListOrganizationComponents<'_>

List organization components

Returns a list of organization components.

Sends a GET request to /v1/organizations/{id}/components

let response = client.list_organization_components()
    .id(id)
    .category(category)
    .subcategory(subcategory)
    .send()
    .await;
Source

pub fn list_invitations(&self) -> ListInvitations<'_>

List all Invitations

Returns a list of the invitation of your organizations. The Invitations are returned sorted by creation date, with the most recent Invitation appearing first.

Sends a GET request to /v1/invitations

let response = client.list_invitations()
    .limit(limit)
    .order_direction(order_direction)
    .organization_id(organization_id)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn create_invitation(&self) -> CreateInvitation<'_>

Create a new Invitation

Creates a new Invitation.

Sends a POST request to /v1/invitations

let response = client.create_invitation()
    .body(body)
    .send()
    .await;
Source

pub fn get_invitation(&self) -> GetInvitation<'_>

Get an Invitation

Retrieve an Invitation that has previously been created.

Sends a GET request to /v1/invitations/{id}

let response = client.get_invitation()
    .id(id)
    .send()
    .await;
Source

pub fn delete_invitation(&self) -> DeleteInvitation<'_>

Delete an Invitation

Deletes an existing Invitation.

Sends a DELETE request to /v1/invitations/{id}

let response = client.delete_invitation()
    .id(id)
    .send()
    .await;
Source

pub fn get_me(&self) -> GetMe<'_>

Get my User object

Retrieves my current User object.

Sends a GET request to /v1/users/me

let response = client.get_me()
    .send()
    .await;
Source

pub fn get_user(&self) -> GetUser<'_>

Get a User

Retrieve a User that has previously been created.

Sends a GET request to /v1/users/{id}

let response = client.get_user()
    .id(id)
    .send()
    .await;
Source

pub fn update_user(&self) -> UpdateUser<'_>

Update a User

Update a User that has previously been created.

Sends a POST request to /v1/users/{id}

let response = client.update_user()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn get_incoming_data_collection_events( &self, ) -> GetIncomingDataCollectionEvents<'_>

List all Incoming Data Collection Events

Retrieves all the Incoming Data Collection Events of a project.

Sends a GET request to /v1/projects/{id}/debug/data-collection/incoming

let response = client.get_incoming_data_collection_events()
    .id(id)
    .limit(limit)
    .order_direction(order_direction)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn get_outgoing_data_collection_events( &self, ) -> GetOutgoingDataCollectionEvents<'_>

List all Outgoing Data Collection Events

Retrieves all the Outgoing Data Collection Events of a project.

Sends a GET request to /v1/projects/{id}/debug/data-collection/outgoing/{event_id}

let response = client.get_outgoing_data_collection_events()
    .id(id)
    .event_id(event_id)
    .limit(limit)
    .order_direction(order_direction)
    .start_key(start_key)
    .send()
    .await;
Source

pub fn get_upload_presigned_url(&self) -> GetUploadPresignedUrl<'_>

Get Upload Presigned URL

Sends a GET request to /v1/upload/presign

let response = client.get_upload_presigned_url()
    .send()
    .await;

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§

§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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<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,