pub struct Client { /* private fields */ }Expand description
Client for Edgee API
Version: 1
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
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.
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 fn list_api_tokens(&self) -> ListApiTokens<'_>
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;Sourcepub fn create_api_token(&self) -> CreateApiToken<'_>
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;Sourcepub fn get_api_token(&self) -> GetApiToken<'_>
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;Sourcepub fn delete_api_token(&self) -> DeleteApiToken<'_>
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;Sourcepub fn list_organizations(&self) -> ListOrganizations<'_>
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)
.order_direction(order_direction)
.start_key(start_key)
.type_(type_)
.send()
.await;Sourcepub fn create_organization(&self) -> CreateOrganization<'_>
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;Sourcepub fn get_my_organization(&self) -> GetMyOrganization<'_>
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;Sourcepub fn get_organization(&self) -> GetOrganization<'_>
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;Sourcepub fn update_organization(&self) -> UpdateOrganization<'_>
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;Sourcepub fn delete_organization(&self) -> DeleteOrganization<'_>
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;Sourcepub fn list_organizations_users(&self) -> ListOrganizationsUsers<'_>
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;Sourcepub fn update_organization_user(&self) -> UpdateOrganizationUser<'_>
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;Sourcepub fn delete_organization_user(&self) -> DeleteOrganizationUser<'_>
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;Sourcepub fn list_projects(&self) -> ListProjects<'_>
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;Sourcepub fn create_project(&self) -> CreateProject<'_>
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;Sourcepub fn get_project(&self) -> GetProject<'_>
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;Sourcepub fn update_project(&self) -> UpdateProject<'_>
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;Sourcepub fn delete_project(&self) -> DeleteProject<'_>
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;Sourcepub fn get_project_counters(&self) -> GetProjectCounters<'_>
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;Sourcepub fn get_project_component_counters(&self) -> GetProjectComponentCounters<'_>
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;Sourcepub fn list_project_domains(&self) -> ListProjectDomains<'_>
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;Sourcepub fn create_project_domain(&self) -> CreateProjectDomain<'_>
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;Sourcepub fn get_project_domain(&self) -> GetProjectDomain<'_>
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;Sourcepub fn update_project_domain(&self) -> UpdateProjectDomain<'_>
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;Sourcepub fn delete_project_domain(&self) -> DeleteProjectDomain<'_>
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;Sourcepub fn list_project_proxy_settings(&self) -> ListProjectProxySettings<'_>
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;Sourcepub fn create_project_proxy_settings(&self) -> CreateProjectProxySettings<'_>
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;Sourcepub fn update_project_proxy_settings(&self) -> UpdateProjectProxySettings<'_>
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;Sourcepub fn list_project_components(&self) -> ListProjectComponents<'_>
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;Sourcepub fn create_project_component(&self) -> CreateProjectComponent<'_>
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;Sourcepub fn get_project_component(&self) -> GetProjectComponent<'_>
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;Sourcepub fn update_project_component(&self) -> UpdateProjectComponent<'_>
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;Sourcepub fn delete_project_component(&self) -> DeleteProjectComponent<'_>
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;Sourcepub fn purge_project_cache(&self) -> PurgeProjectCache<'_>
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 IDbody
let response = client.purge_project_cache()
.id(id)
.body(body)
.send()
.await;Sourcepub fn list_public_components(&self) -> ListPublicComponents<'_>
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;Sourcepub fn create_component(&self) -> CreateComponent<'_>
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;Sourcepub fn get_component_by_uuid(&self) -> GetComponentByUuid<'_>
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;Sourcepub fn update_component_by_uuid(&self) -> UpdateComponentByUuid<'_>
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;Sourcepub fn delete_component_by_uuid(&self) -> DeleteComponentByUuid<'_>
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;Sourcepub fn get_component_by_slug(&self) -> GetComponentBySlug<'_>
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;Sourcepub fn update_component_by_slug(&self) -> UpdateComponentBySlug<'_>
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;Sourcepub fn delete_component_by_slug(&self) -> DeleteComponentBySlug<'_>
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;Sourcepub fn create_component_version_by_uuid(
&self,
) -> CreateComponentVersionByUuid<'_>
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;Sourcepub fn create_component_version_by_slug(
&self,
) -> CreateComponentVersionBySlug<'_>
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;Sourcepub fn update_component_version_by_slug(
&self,
) -> UpdateComponentVersionBySlug<'_>
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;Sourcepub fn list_organization_components(&self) -> ListOrganizationComponents<'_>
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;Sourcepub fn list_invitations(&self) -> ListInvitations<'_>
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;Sourcepub fn create_invitation(&self) -> CreateInvitation<'_>
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;Sourcepub fn get_invitation(&self) -> GetInvitation<'_>
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;Sourcepub fn delete_invitation(&self) -> DeleteInvitation<'_>
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;Sourcepub fn get_me(&self) -> GetMe<'_>
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;Sourcepub fn get_user(&self) -> GetUser<'_>
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;Sourcepub fn update_user(&self) -> UpdateUser<'_>
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;Sourcepub fn get_incoming_data_collection_events(
&self,
) -> GetIncomingDataCollectionEvents<'_>
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;Sourcepub fn get_outgoing_data_collection_events(
&self,
) -> GetOutgoingDataCollectionEvents<'_>
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;Sourcepub fn get_upload_presigned_url(&self) -> GetUploadPresignedUrl<'_>
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;