Skip to main content

Client

Struct Client 

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

Client for brokkr-broker

Brokkr broker: the central control-plane API server for distributing Kubernetes objects across clusters.

Version: 0.8.1

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 fn list_audit_logs(&self) -> ListAuditLogs<'_>

Lists audit logs with optional filtering and pagination

Returns audit log entries matching the specified filters, ordered by timestamp descending (most recent first).

§Authentication

Requires admin PAK authentication.

§Query Parameters
  • actor_type: Filter by actor type (admin, agent, generator, system).
  • actor_id: Filter by actor UUID.
  • action: Filter by action (exact match or prefix with *).
  • resource_type: Filter by resource type.
  • resource_id: Filter by resource UUID.
  • from: Filter by start time (inclusive).
  • to: Filter by end time (exclusive).
  • limit: Maximum results (default 100, max 1000).
  • offset: Number of results to skip.
§Returns
  • 200 OK: List of audit logs with pagination info.
  • 401 UNAUTHORIZED: Missing or invalid authentication.
  • 403 FORBIDDEN: Authenticated but not an admin.
  • 500 INTERNAL_SERVER_ERROR: Database error.

Sends a GET request to /admin/audit-logs

Arguments:

  • action: Filter by action (exact match or prefix with *).
  • actor_id: Filter by actor ID.
  • actor_type: Filter by actor type (admin, agent, generator, system).
  • from: Filter by start time (inclusive, ISO 8601).
  • limit: Maximum number of results (default 100, max 1000).
  • offset: Number of results to skip.
  • resource_id: Filter by resource ID.
  • resource_type: Filter by resource type.
  • to: Filter by end time (exclusive, ISO 8601).
let response = client.list_audit_logs()
    .action(action)
    .actor_id(actor_id)
    .actor_type(actor_type)
    .from(from)
    .limit(limit)
    .offset(offset)
    .resource_id(resource_id)
    .resource_type(resource_type)
    .to(to)
    .send()
    .await;
Source

pub fn reload_config(&self) -> ReloadConfig<'_>

Reloads the broker configuration from disk

This endpoint triggers a hot-reload of configurable settings without requiring a broker restart. Only settings marked as “dynamic” can be reloaded; static settings (like database URL) require a restart.

§Authentication

Requires admin PAK authentication.

§Returns
  • 200 OK: Configuration reloaded successfully with list of changes.
  • 401 UNAUTHORIZED: Missing or invalid authentication.
  • 403 FORBIDDEN: Authenticated but not an admin.
  • 500 INTERNAL_SERVER_ERROR: Failed to reload configuration.

Sends a POST request to /admin/config/reload

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

pub fn list_ws_connections(&self) -> ListWsConnections<'_>

Sends a GET request to /admin/ws/connections

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

pub fn list_agent_events(&self) -> ListAgentEvents<'_>

Sends a GET request to /agent-events

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

pub fn get_agent_event(&self) -> GetAgentEvent<'_>

Sends a GET request to /agent-events/{id}

Arguments:

  • id: Agent event id
let response = client.get_agent_event()
    .id(id)
    .send()
    .await;
Source

pub fn list_agents(&self) -> ListAgents<'_>

Sends a GET request to /agents

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

pub fn create_agent(&self) -> CreateAgent<'_>

Sends a POST request to /agents

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

pub fn search_agent(&self) -> SearchAgent<'_>

Sends a GET request to /agents/

Arguments:

  • cluster_name: Name of the cluster to search in
  • name: Name of the agent to search for
let response = client.search_agent()
    .cluster_name(cluster_name)
    .name(name)
    .send()
    .await;
Source

pub fn get_pending_agent_webhooks(&self) -> GetPendingAgentWebhooks<'_>

Sends a GET request to /agents/{agent_id}/webhooks/pending

Arguments:

  • agent_id: Agent ID
let response = client.get_pending_agent_webhooks()
    .agent_id(agent_id)
    .send()
    .await;
Source

pub fn list_pending_for_agent(&self) -> ListPendingForAgent<'_>

Sends a GET request to /agents/{agent_id}/work-orders/pending

Arguments:

  • agent_id: Agent ID
  • work_type: Filter by work type
let response = client.list_pending_for_agent()
    .agent_id(agent_id)
    .work_type(work_type)
    .send()
    .await;
Source

pub fn get_agent(&self) -> GetAgent<'_>

Sends a GET request to /agents/{id}

Arguments:

  • id: ID of the agent to retrieve
let response = client.get_agent()
    .id(id)
    .send()
    .await;
Source

pub fn update_agent(&self) -> UpdateAgent<'_>

Sends a PUT request to /agents/{id}

Arguments:

  • id: ID of the agent to update
  • body
let response = client.update_agent()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_agent(&self) -> DeleteAgent<'_>

Sends a DELETE request to /agents/{id}

Arguments:

  • id: ID of the agent to delete
let response = client.delete_agent()
    .id(id)
    .send()
    .await;
Source

pub fn agents_list_annotations(&self) -> AgentsListAnnotations<'_>

Sends a GET request to /agents/{id}/annotations

Arguments:

  • id: ID of the agent
let response = client.agents_list_annotations()
    .id(id)
    .send()
    .await;
Source

pub fn agents_add_annotation(&self) -> AgentsAddAnnotation<'_>

Sends a POST request to /agents/{id}/annotations

Arguments:

  • id: ID of the agent
  • body
let response = client.agents_add_annotation()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn agents_remove_annotation(&self) -> AgentsRemoveAnnotation<'_>

Sends a DELETE request to /agents/{id}/annotations/{key}

Arguments:

  • id: ID of the agent
  • key: Annotation key to remove
let response = client.agents_remove_annotation()
    .id(id)
    .key(key)
    .send()
    .await;
Source

pub fn get_pending_diagnostics(&self) -> GetPendingDiagnostics<'_>

Sends a GET request to /agents/{id}/diagnostics/pending

Arguments:

  • id: ID of the agent
let response = client.get_pending_diagnostics()
    .id(id)
    .send()
    .await;
Source

pub fn list_events(&self) -> ListEvents<'_>

Sends a GET request to /agents/{id}/events

Arguments:

  • id: ID of the agent to list events for
let response = client.list_events()
    .id(id)
    .send()
    .await;
Source

pub fn create_event(&self) -> CreateEvent<'_>

Sends a POST request to /agents/{id}/events

Arguments:

  • id: ID of the agent to create an event for
  • body
let response = client.create_event()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn get_agent_fleet_status(&self) -> GetAgentFleetStatus<'_>

Sends a GET request to /agents/{id}/fleet-status

Arguments:

  • id: ID of the agent
let response = client.get_agent_fleet_status()
    .id(id)
    .send()
    .await;
Source

pub fn update_health_status(&self) -> UpdateHealthStatus<'_>

Updates health status for deployment objects from an agent

§Authorization

Requires matching agent ID.

Sends a PATCH request to /agents/{id}/health-status

Arguments:

  • id: ID of the agent reporting health
  • body
let response = client.update_health_status()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn record_heartbeat(&self) -> RecordHeartbeat<'_>

Sends a POST request to /agents/{id}/heartbeat

Arguments:

  • id: ID of the agent
  • body: Optional agent-reported K8s connectivity
let response = client.record_heartbeat()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn agents_list_labels(&self) -> AgentsListLabels<'_>

Sends a GET request to /agents/{id}/labels

Arguments:

  • id: ID of the agent
let response = client.agents_list_labels()
    .id(id)
    .send()
    .await;
Source

pub fn agents_add_label(&self) -> AgentsAddLabel<'_>

Sends a POST request to /agents/{id}/labels

Arguments:

  • id: ID of the agent
  • body
let response = client.agents_add_label()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn agents_remove_label(&self) -> AgentsRemoveLabel<'_>

Sends a DELETE request to /agents/{id}/labels/{label}

Arguments:

  • id: ID of the agent
  • label: The label to remove
let response = client.agents_remove_label()
    .id(id)
    .label(label)
    .send()
    .await;
Source

pub fn rotate_agent_pak(&self) -> RotateAgentPak<'_>

Sends a POST request to /agents/{id}/rotate-pak

Arguments:

  • id: Agent id
let response = client.rotate_agent_pak()
    .id(id)
    .send()
    .await;
Source

pub fn get_associated_stacks(&self) -> GetAssociatedStacks<'_>

Sends a GET request to /agents/{id}/stacks

Arguments:

  • id: ID of the agent
let response = client.get_associated_stacks()
    .id(id)
    .send()
    .await;
Source

pub fn get_target_state(&self) -> GetTargetState<'_>

Sends a GET request to /agents/{id}/target-state

Arguments:

  • id: ID of the agent
  • mode: Mode of operation: ‘incremental’ (default) or ‘full’
let response = client.get_target_state()
    .id(id)
    .mode(mode)
    .send()
    .await;
Source

pub fn list_targets(&self) -> ListTargets<'_>

Sends a GET request to /agents/{id}/targets

Arguments:

  • id: ID of the agent
let response = client.list_targets()
    .id(id)
    .send()
    .await;
Source

pub fn add_target(&self) -> AddTarget<'_>

Sends a POST request to /agents/{id}/targets

Arguments:

  • id: ID of the agent
  • body
let response = client.add_target()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn remove_target(&self) -> RemoveTarget<'_>

Sends a DELETE request to /agents/{id}/targets/{stack_id}

Arguments:

  • id: ID of the agent
  • stack_id: ID of the stack
let response = client.remove_target()
    .id(id)
    .stack_id(stack_id)
    .send()
    .await;
Source

pub fn verify_pak(&self) -> VerifyPak<'_>

Verifies a PAK (Personal Access Key) and returns an AuthResponse

This function handles the authentication process for both admin and agent PAKs.

Sends a POST request to /auth/pak

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

pub fn get_deployment_object(&self) -> GetDeploymentObject<'_>

Retrieves a deployment object by ID, with access control based on user role

§Authorization

Requires either:

  • Admin privileges
  • Agent associated with the deployment object’s stack
  • Generator that owns the deployment object’s stack

Sends a GET request to /deployment-objects/{id}

Arguments:

  • id: ID of the deployment object to retrieve
let response = client.get_deployment_object()
    .id(id)
    .send()
    .await;
Source

pub fn create_diagnostic_request(&self) -> CreateDiagnosticRequest<'_>

Sends a POST request to /deployment-objects/{id}/diagnostics

Arguments:

  • id: ID of the deployment object
  • body
let response = client.create_diagnostic_request()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn get_deployment_health(&self) -> GetDeploymentHealth<'_>

Gets health status for a specific deployment object

§Authorization

Requires admin privileges.

Sends a GET request to /deployment-objects/{id}/health

Arguments:

  • id: ID of the deployment object
let response = client.get_deployment_health()
    .id(id)
    .send()
    .await;
Source

pub fn get_diagnostic(&self) -> GetDiagnostic<'_>

Sends a GET request to /diagnostics/{id}

Arguments:

  • id: ID of the diagnostic request
let response = client.get_diagnostic()
    .id(id)
    .send()
    .await;
Source

pub fn claim_diagnostic(&self) -> ClaimDiagnostic<'_>

Sends a POST request to /diagnostics/{id}/claim

Arguments:

  • id: ID of the diagnostic request to claim
let response = client.claim_diagnostic()
    .id(id)
    .send()
    .await;
Source

pub fn submit_diagnostic_result(&self) -> SubmitDiagnosticResult<'_>

Sends a POST request to /diagnostics/{id}/result

Arguments:

  • id: ID of the diagnostic request
  • body
let response = client.submit_diagnostic_result()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn list_fleet(&self) -> ListFleet<'_>

Sends a GET request to /fleet

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

pub fn list_generators(&self) -> ListGenerators<'_>

Sends a GET request to /generators

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

pub fn create_generator(&self) -> CreateGenerator<'_>

Sends a POST request to /generators

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

pub fn get_generator(&self) -> GetGenerator<'_>

Sends a GET request to /generators/{id}

Arguments:

  • id: Generator id
let response = client.get_generator()
    .id(id)
    .send()
    .await;
Source

pub fn update_generator(&self) -> UpdateGenerator<'_>

Sends a PUT request to /generators/{id}

Arguments:

  • id: Generator id
  • body
let response = client.update_generator()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_generator(&self) -> DeleteGenerator<'_>

Sends a DELETE request to /generators/{id}

Arguments:

  • id: Generator id
let response = client.delete_generator()
    .id(id)
    .send()
    .await;
Source

pub fn rotate_generator_pak(&self) -> RotateGeneratorPak<'_>

Sends a POST request to /generators/{id}/rotate-pak

Arguments:

  • id: Generator id
let response = client.rotate_generator_pak()
    .id(id)
    .send()
    .await;
Source

pub fn list_stacks(&self) -> ListStacks<'_>

Sends a GET request to /stacks

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

pub fn create_stack(&self) -> CreateStack<'_>

Sends a POST request to /stacks

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

pub fn get_stack(&self) -> GetStack<'_>

Sends a GET request to /stacks/{id}

Arguments:

  • id: Stack ID
let response = client.get_stack()
    .id(id)
    .send()
    .await;
Source

pub fn update_stack(&self) -> UpdateStack<'_>

Sends a PUT request to /stacks/{id}

Arguments:

  • id: Stack ID
  • body
let response = client.update_stack()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_stack(&self) -> DeleteStack<'_>

Sends a DELETE request to /stacks/{id}

Arguments:

  • id: Stack ID
let response = client.delete_stack()
    .id(id)
    .send()
    .await;
Source

pub fn stacks_list_annotations(&self) -> StacksListAnnotations<'_>

Sends a GET request to /stacks/{id}/annotations

Arguments:

  • id: Stack ID
let response = client.stacks_list_annotations()
    .id(id)
    .send()
    .await;
Source

pub fn stacks_add_annotation(&self) -> StacksAddAnnotation<'_>

Sends a POST request to /stacks/{id}/annotations

Arguments:

  • id: Stack ID
  • body
let response = client.stacks_add_annotation()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn stacks_remove_annotation(&self) -> StacksRemoveAnnotation<'_>

Sends a DELETE request to /stacks/{id}/annotations/{key}

Arguments:

  • id: Stack ID
  • key: Annotation key to remove
let response = client.stacks_remove_annotation()
    .id(id)
    .key(key)
    .send()
    .await;
Source

pub fn list_deployment_objects(&self) -> ListDeploymentObjects<'_>

Sends a GET request to /stacks/{id}/deployment-objects

Arguments:

  • id: Stack ID
let response = client.list_deployment_objects()
    .id(id)
    .send()
    .await;
Source

pub fn create_deployment_object(&self) -> CreateDeploymentObject<'_>

Sends a POST request to /stacks/{id}/deployment-objects

Arguments:

  • id: Stack ID
  • deletion_marker: Marks the submission as a deletion marker. Only consulted on the raw-YAML path; on the JSON path the body field wins.
  • body
let response = client.create_deployment_object()
    .id(id)
    .deletion_marker(deletion_marker)
    .body(body)
    .send()
    .await;
Source

pub fn list_telemetry_events(&self) -> ListTelemetryEvents<'_>

Sends a GET request to /stacks/{id}/events

Arguments:

  • id: Stack ID
  • limit: Maximum rows to return. Defaults to 500; capped at 5000.
  • since: Earliest created_at to include (ISO-8601). Defaults to now - retention_ceiling_seconds. Values older than the ceiling are silently clamped: only the retained window can be returned.
let response = client.list_telemetry_events()
    .id(id)
    .limit(limit)
    .since(since)
    .send()
    .await;
Source

pub fn get_stack_health(&self) -> GetStackHealth<'_>

Gets health status for all deployment objects in a stack

§Authorization

Requires admin privileges.

Sends a GET request to /stacks/{id}/health

Arguments:

  • id: ID of the stack
let response = client.get_stack_health()
    .id(id)
    .send()
    .await;
Source

pub fn stacks_list_labels(&self) -> StacksListLabels<'_>

Sends a GET request to /stacks/{id}/labels

Arguments:

  • id: Stack ID
let response = client.stacks_list_labels()
    .id(id)
    .send()
    .await;
Source

pub fn stacks_add_label(&self) -> StacksAddLabel<'_>

Sends a POST request to /stacks/{id}/labels

Arguments:

  • id: Stack ID
  • body: JSON-encoded label string, e.g. “mylabel”
let response = client.stacks_add_label()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn stacks_remove_label(&self) -> StacksRemoveLabel<'_>

Sends a DELETE request to /stacks/{id}/labels/{label}

Arguments:

  • id: Stack ID
  • label: Label to remove
let response = client.stacks_remove_label()
    .id(id)
    .label(label)
    .send()
    .await;
Source

pub fn list_telemetry_logs(&self) -> ListTelemetryLogs<'_>

Sends a GET request to /stacks/{id}/logs

Arguments:

  • id: Stack ID
  • limit: Maximum rows to return. Defaults to 500; capped at 5000.
  • since: Earliest created_at to include (ISO-8601). Defaults to now - retention_ceiling_seconds. Values older than the ceiling are silently clamped: only the retained window can be returned.
let response = client.list_telemetry_logs()
    .id(id)
    .limit(limit)
    .since(since)
    .send()
    .await;
Source

pub fn instantiate_template(&self) -> InstantiateTemplate<'_>

Sends a POST request to /stacks/{stack_id}/deployment-objects/from-template

Arguments:

  • stack_id: Stack ID
  • body
let response = client.instantiate_template()
    .stack_id(stack_id)
    .body(body)
    .send()
    .await;
Source

pub fn list_templates(&self) -> ListTemplates<'_>

Sends a GET request to /templates

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

pub fn create_template(&self) -> CreateTemplate<'_>

Sends a POST request to /templates

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

pub fn get_template(&self) -> GetTemplate<'_>

Sends a GET request to /templates/{id}

Arguments:

  • id: Template ID
let response = client.get_template()
    .id(id)
    .send()
    .await;
Source

pub fn update_template(&self) -> UpdateTemplate<'_>

Sends a PUT request to /templates/{id}

Arguments:

  • id: Template ID
  • body
let response = client.update_template()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_template(&self) -> DeleteTemplate<'_>

Sends a DELETE request to /templates/{id}

Arguments:

  • id: Template ID
let response = client.delete_template()
    .id(id)
    .send()
    .await;
Source

pub fn templates_list_annotations(&self) -> TemplatesListAnnotations<'_>

Sends a GET request to /templates/{id}/annotations

Arguments:

  • id: Template ID
let response = client.templates_list_annotations()
    .id(id)
    .send()
    .await;
Source

pub fn templates_add_annotation(&self) -> TemplatesAddAnnotation<'_>

Sends a POST request to /templates/{id}/annotations

Arguments:

  • id: Template ID
  • body
let response = client.templates_add_annotation()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn templates_remove_annotation(&self) -> TemplatesRemoveAnnotation<'_>

Sends a DELETE request to /templates/{id}/annotations/{key}

Arguments:

  • id: Template ID
  • key: Annotation key to remove
let response = client.templates_remove_annotation()
    .id(id)
    .key(key)
    .send()
    .await;
Source

pub fn templates_list_labels(&self) -> TemplatesListLabels<'_>

Sends a GET request to /templates/{id}/labels

Arguments:

  • id: Template ID
let response = client.templates_list_labels()
    .id(id)
    .send()
    .await;
Source

pub fn templates_add_label(&self) -> TemplatesAddLabel<'_>

Sends a POST request to /templates/{id}/labels

Arguments:

  • id: Template ID
  • body: JSON-encoded label string, e.g. “mylabel”
let response = client.templates_add_label()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn templates_remove_label(&self) -> TemplatesRemoveLabel<'_>

Sends a DELETE request to /templates/{id}/labels/{label}

Arguments:

  • id: Template ID
  • label: Label to remove
let response = client.templates_remove_label()
    .id(id)
    .label(label)
    .send()
    .await;
Source

pub fn report_delivery_result(&self) -> ReportDeliveryResult<'_>

Sends a POST request to /webhook-deliveries/{id}/result

Arguments:

  • id: Delivery ID
  • body
let response = client.report_delivery_result()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn list_webhooks(&self) -> ListWebhooks<'_>

Sends a GET request to /webhooks

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

pub fn create_webhook(&self) -> CreateWebhook<'_>

Sends a POST request to /webhooks

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

pub fn list_event_types(&self) -> ListEventTypes<'_>

Sends a GET request to /webhooks/event-types

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

pub fn get_webhook(&self) -> GetWebhook<'_>

Sends a GET request to /webhooks/{id}

Arguments:

  • id: Webhook subscription ID
let response = client.get_webhook()
    .id(id)
    .send()
    .await;
Source

pub fn update_webhook(&self) -> UpdateWebhook<'_>

Sends a PUT request to /webhooks/{id}

Arguments:

  • id: Webhook subscription ID
  • body
let response = client.update_webhook()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn delete_webhook(&self) -> DeleteWebhook<'_>

Sends a DELETE request to /webhooks/{id}

Arguments:

  • id: Webhook subscription ID
let response = client.delete_webhook()
    .id(id)
    .send()
    .await;
Source

pub fn list_deliveries(&self) -> ListDeliveries<'_>

Sends a GET request to /webhooks/{id}/deliveries

Arguments:

  • id: Webhook subscription ID
  • limit: Maximum number of results
  • offset: Offset for pagination
  • status: Filter by delivery status
let response = client.list_deliveries()
    .id(id)
    .limit(limit)
    .offset(offset)
    .status(status)
    .send()
    .await;
Source

pub fn test_webhook(&self) -> TestWebhook<'_>

Sends a POST request to /webhooks/{id}/test

Arguments:

  • id: Webhook subscription ID
let response = client.test_webhook()
    .id(id)
    .send()
    .await;
Source

pub fn list_work_order_log(&self) -> ListWorkOrderLog<'_>

Sends a GET request to /work-order-log

Arguments:

  • agent_id: Filter by agent ID
  • limit: Limit number of results
  • success: Filter by success status
  • work_type: Filter by work type
let response = client.list_work_order_log()
    .agent_id(agent_id)
    .limit(limit)
    .success(success)
    .work_type(work_type)
    .send()
    .await;
Source

pub fn get_work_order_log(&self) -> GetWorkOrderLog<'_>

Sends a GET request to /work-order-log/{id}

Arguments:

  • id: Work order log ID
let response = client.get_work_order_log()
    .id(id)
    .send()
    .await;
Source

pub fn list_work_orders(&self) -> ListWorkOrders<'_>

Sends a GET request to /work-orders

Arguments:

  • status: Filter by status
  • work_type: Filter by work type
let response = client.list_work_orders()
    .status(status)
    .work_type(work_type)
    .send()
    .await;
Source

pub fn create_work_order(&self) -> CreateWorkOrder<'_>

Sends a POST request to /work-orders

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

pub fn get_work_order(&self) -> GetWorkOrder<'_>

Sends a GET request to /work-orders/{id}

Arguments:

  • id: Work order ID
let response = client.get_work_order()
    .id(id)
    .send()
    .await;
Source

pub fn delete_work_order(&self) -> DeleteWorkOrder<'_>

Sends a DELETE request to /work-orders/{id}

Arguments:

  • id: Work order ID
let response = client.delete_work_order()
    .id(id)
    .send()
    .await;
Source

pub fn claim_work_order(&self) -> ClaimWorkOrder<'_>

Sends a POST request to /work-orders/{id}/claim

Arguments:

  • id: Work order ID
  • body
let response = client.claim_work_order()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn complete_work_order(&self) -> CompleteWorkOrder<'_>

Sends a POST request to /work-orders/{id}/complete

Arguments:

  • id: Work order ID
  • body
let response = client.complete_work_order()
    .id(id)
    .body(body)
    .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 (const: unstable) · 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> 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: Sized + 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: Sized + 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<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