Meshagent class

A client to interact with the accounts routes.

Constructors

Meshagent({required String baseUrl, required String token})
Creates an instance of Meshagent.

Properties

baseUrl String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
final

Methods

addUserToProject(String projectId, String userId) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects/:project_id/users Body: { "project_id", "user_id" } Returns JSON like { "ok": true } on success.
addUserToProjectByEmail(String projectId, String email) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects/:project_id/users Body: { "project_id", "user_id" } Returns JSON like { "ok": true } on success.
connectRoom({required String projectId, required String roomName}) Future<RoomConnectionInfo>
POST /accounts/projects/{project_id}/rooms/{room_name}/connect Body: {} Returns { "jwt", "room_name", "project_id", "room_url" } on success.
connectShare(String shareId) Future<RoomShareConnectionInfo>
Corresponds to: POST /shares/:share_id/connect Body: {} Returns JSON dict with { "jwt", "room_url" } on success.
createApiKey(String projectId, String name, String description) Future<ApiKeyInfo>
Corresponds to: POST /accounts/projects/{project_id}/api-keys Body: { "name": "", "description": "" } Returns an Api Key.
createMailbox({required String projectId, required String address, required String room, required String queue}) Future<void>
POST /accounts/projects/{project_id}/mailboxes Body: { "address", "room", "queue" } Returns {} on success.
createOAuthClient(String projectId, {required List<String> grantTypes, required List<String> responseTypes, required List<String> redirectUris, required String scope, Map<String, dynamic>? metadata}) Future<OAuthClient>
POST /accounts/projects/{project_id}/oauth/clients Body: { grant_types, response_types, redirect_uris, scope, metadata? } Returns the newly created OAuthClient (often includes client_secret).
createProject(String name) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects Body: { "name": "<name>" } Returns JSON like { "id", "owner_user_id", "name" } on success.
createRoom({required String projectId, required String name, bool ifNotExists = false, Map<String, dynamic>? metadata, Map<String, ApiScope>? permissions}) Future<Room>
createRoomGrant({required String projectId, required String roomId, required String userId, required ApiScope permissions}) Future<void>
POST /accounts/projects/{project_id}/room-grants Body: { "room_name", "user_id", "permissions" } Returns {} on success.
createRoomGrantByEmail({required String projectId, required String roomId, required String email, required ApiScope permissions}) Future<void>
POST /accounts/projects/{project_id}/room-grants Body: { "room_name", "user_id", "permissions" } Returns {} on success.
createRoomService({required String projectId, required ServiceSpec service, required String roomName}) Future<String>
Corresponds to: POST /accounts/projects/:project_id/services Body: { "name", "image", "pull_secret", "runtime_secrets", "environment_secrets", "environment" : <settings> } Returns JSON like { "id" } on success.
createSecret({required String projectId, required String name, required String type, required Map<String, dynamic> data}) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects/{project_id}/secrets Body: { "name": "...", "type": "...", "data": ... } Returns JSON like { "id": "new_secret_id" } on success.
createService({required String projectId, required ServiceSpec service}) Future<String>
Corresponds to: POST /accounts/projects/:project_id/services Body: { "name", "image", "pull_secret", "runtime_secrets", "environment_secrets", "environment" : <settings> } Returns JSON like { "id" } on success.
createShare(String projectId, {Map<String, dynamic>? settings}) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects/:project_id/shares Body: { "settings" : <settings> } Returns JSON like { "id" } on success.
createWebhook(String projectId, {required String name, required String url, required List<String> events, String description = '', String? action, String? payload}) Future<Map<String, dynamic>>
Corresponds to: POST /accounts/projects/{project_id}/webhooks Body: { "name", "description", "url", "events" } Returns the JSON object the server responds with (could be empty or the new resource data).
deleteApiKey(String projectId, String tokenId) Future<void>
Corresponds to: DELETE /accounts/projects/{project_id}/api-keys/{token_id} Returns 204 No Content on success (no JSON body).
deleteMailbox({required String projectId, required String address}) Future<void>
DELETE /accounts/projects/{project_id}/mailboxes/{address} Returns {} on success.
deleteOAuthClient(String projectId, String clientId) Future<void>
DELETE /accounts/projects/{project_id}/oauth/clients/{client_id} Returns 204 No Content on success.
deleteProject(String projectId) Future<void>
Corresponds to: DELETE /accounts/projects/:project_id
deleteRoom({required String projectId, required String roomId}) Future<void>
DELETE /accounts/projects/{project_id}/rooms/{room_id}
deleteRoomGrant({required String projectId, required String roomId, required String userId}) Future<void>
DELETE /accounts/projects/{project_id}/room-grants/{room_name}/{user_id} Returns {} on success.
deleteRoomService({required String projectId, required String serviceId, required String roomName}) Future<void>
Corresponds to: DELETE /accounts/projects/{project_id}/services/{token_id} Returns 204 No Content on success (no JSON body).
deleteSecret({required String projectId, required String secretId}) Future<void>
Corresponds to: DELETE /accounts/projects/{project_id}/secrets/{secret_id} Returns {} or 204 No Content on success.
deleteService({required String projectId, required String serviceId}) Future<void>
Corresponds to: DELETE /accounts/projects/{project_id}/services/{token_id} Returns 204 No Content on success (no JSON body).
deleteShare(String projectId, String shareId) Future<void>
Corresponds to: DELETE /accounts/projects/:project_id/shares/:share_id No JSON response on success.
deleteWebhook(String projectId, String webhookId) Future<void>
Corresponds to: DELETE /accounts/projects/{project_id}/webhooks/{webhook_id} Typically returns 200 or 204 on success (no JSON body).
download({required String projectId, required String path}) Future<Uint8List>
Corresponds to: POST /projects/:project_id/storage/download
getBalance(String projectId) Future<Balance>
getCheckoutUrl(String projectId, String successUrl, String cancelUrl) Future<String>
getCreditsCheckoutUrl(String projectId, String successUrl, String cancelUrl, double quantity) Future<String>
getOAuthClient(String projectId, String clientId) Future<OAuthClient>
GET /accounts/projects/{project_id}/oauth/clients/{client_id} Returns one OAuthClient (no secret). 404 -> NotFoundException.
getPricing() Future<Map<String, dynamic>>
getProject(String projectId) Future<Map<String, dynamic>>
Corresponds to: GET /accounts/projects Returns JSON like { "projects": ... } on success.
getProjectRole(String projectId) Future<ProjectRole>
Corresponds to: GET /accounts/projects/{project_id} Returns a role
getRecentTransactions(String projectId) Future<List<Transaction>>
getRoom({required String projectId, required String name}) Future<Room>
GET /accounts/projects/{project_id}/rooms/{room_name} Returns a Room (404 -> NotFoundException).
getRoomGrant({required String projectId, required String roomId, required String userId}) Future<ProjectRoomGrant>
GET /accounts/projects/{project_id}/room-grants/{room_name}/{user_id} Returns a ProjectRoomGrant.
getRoomService({required String projectId, required String serviceId, required String roomName}) Future<ServiceSpec>
getService({required String projectId, required String serviceId}) Future<ServiceSpec>
getSession(String projectId, String sessionId) Future<Map<String, dynamic>>
Corresponds to: GET /accounts/projects/{project_id}/sessions/{session_id} Returns a JSON dict: {"id","room_name","created_at"}
getStatus(String projectId) Future<bool>
getSubscription(String projectId) Future<Map<String, dynamic>>
Corresponds to: GET /accounts/projects/{project_id}/sessions/{session_id} Returns a JSON dict: {"id","room_name","created_at"}
getUsage(String projectId, {DateTime? start, DateTime? end, String? interval, String? report}) Future<List<Map<String, dynamic>>>
getUserProfile(String userId) Future<Map<String, dynamic>>
Corresponds to: GET /accounts/profiles/:user_id Returns user profile JSON, e.g. { "id", "first_name", "last_name", "email" } on success or throws an error if not found.
getUsersInProject(String projectId, {String? email}) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/:project_id/users Returns JSON like { "users": ... } on success.
listActiveSessions(String projectId) Future<List<RoomSession>>
GET /accounts/projects/{project_id}/sessions Returns JSON: { "sessions": { "room_name", "started_at", "is_active" }, ... }
listApiKeys(String projectId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/api-keys Returns a JSON dict like: { "tokens": { ... }, ... }.
listMailboxes(String projectId) Future<List<Mailbox>>
GET /accounts/projects/{project_id}/mailboxes Returns { "mailboxes": { "address","room","queue" }, ... }
listOAuthClients(String projectId) Future<List<OAuthClient>>
GET /accounts/projects/{project_id}/oauth/clients Returns a list of OAuthClient (no secrets).
listProjects() Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects Returns JSON like { "projects": ... } on success.
listRecentSessions(String projectId) Future<List<RoomSession>>
Corresponds to: GET /accounts/projects/{project_id}/sessions Returns a JSON dict: { "sessions": ... }
listRoomGrants({required String projectId, int limit = 50, int offset = 0, String orderBy = 'room_name'}) Future<List<ProjectRoomGrant>>
GET /accounts/projects/{project_id}/room-grants?limit=&offset=&order_by=
listRoomGrantsByRoom({required String projectId, required String roomName, int limit = 50, int offset = 0, String orderBy = 'user_id'}) Future<List<ProjectRoomGrant>>
GET /accounts/projects/{project_id}/room-grants/by-room/{room_name}?limit=&offset=&order_by=
listRoomGrantsByUser({required String projectId, required String userId, int limit = 50, int offset = 0, String orderBy = 'room_name'}) Future<List<ProjectRoomGrant>>
GET /accounts/projects/{project_id}/room-grants/by-user/{user_id}?limit=&offset=&order_by=
listRooms({required String projectId, int limit = 50, int offset = 0, String orderBy = 'room_name'}) Future<List<Room>>
GET /accounts/projects/{project_id}/rooms?limit=&offset=&order_by=
listRoomServices({required String projectId, required String roomName}) Future<List<ServiceSpec>>
Corresponds to: GET /accounts/projects/{project_id}/services Returns a JSON dict like: { "tokens": { ... }, ... }.
listSecrets(String projectId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/secrets Returns JSON like { "secrets": { "id": ..., "name": ..., "type": ..., "data": ... } }.
listServices(String projectId) Future<List<ServiceSpec>>
Corresponds to: GET /accounts/projects/{project_id}/services Returns a JSON dict like: { "tokens": { ... }, ... }.
listSessionEvents(String projectId, String sessionId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/sessions/{session_id}/events Returns a JSON dict: { "events": ... }
listSessionMetrics(String projectId, String sessionId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/sessions/{session_id}/spans Returns a JSON dict: { "spans": ... }
listSessionSpans(String projectId, String sessionId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/sessions/{session_id}/spans Returns a JSON dict: { "spans": ... }
listShares(String projectId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/:project_id/shares Returns JSON like { "shares": { "id", "settings" } } on success.
listUniqueRoomsWithGrants({required String projectId, int limit = 50, int offset = 0}) Future<List<ProjectRoomGrantCount>>
GET /accounts/projects/{project_id}/room-grants/by-room?limit=&offset=
listUniqueUsersWithGrants({required String projectId, int limit = 50, int offset = 0}) Future<List<ProjectUserGrantCount>>
GET /accounts/projects/{project_id}/room-grants/by-user?limit=&offset=
listWebhooks(String projectId) Future<List<Map<String, dynamic>>>
Corresponds to: GET /accounts/projects/{project_id}/webhooks Returns a JSON dict like { "webhooks": { ... }, ... }.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeUserFromProject(String projectId, String userId) Future<Map<String, dynamic>>
Corresponds to: DELETE /accounts/projects/:project_id/users Body: { "project_id", "user_id" } Returns JSON like { "ok": true } on success.
setAutoRecharge({required String projectId, required bool enabled, required double amount, required double threshold}) Future<void>
terminate({required String projectId, required String sessionId}) Future<void>
Corresponds to: POST /accounts/projects/{project_id}/sessions/{session_id}/terminate
toString() String
A string representation of this object.
inherited
updateMailbox({required String projectId, required String address, required String room, required String queue}) Future<void>
PUT /accounts/projects/{project_id}/mailboxes/{address} Body: { "room", "queue" } Returns {} on success.
updateOAuthClient(String projectId, String clientId, {List<String>? grantTypes, List<String>? responseTypes, List<String>? redirectUris, String? scope, Map<String, dynamic>? metadata}) Future<Map<String, dynamic>>
PUT /accounts/projects/{project_id}/oauth/clients/{client_id} Body: any subset of { grant_types, response_types, redirect_uris, scope, metadata } Returns a small status JSON (e.g., { "ok": true }).
updateProjectSettings({required String projectId, required Map<String, dynamic> settings}) Future<void>
updateRoom({required String projectId, required String roomId, required String name, Map<String, dynamic>? metadata}) Future<void>
PUT /accounts/projects/{project_id}/rooms/{room_id} Body: { "name": "new name" }
updateRoomGrant({required String projectId, required String roomId, required String userId, required ApiScope permissions, String? grantId}) Future<void>
PUT /accounts/projects/{project_id}/room-grants/{grant_id} Body: { "room_name", "user_id", "permissions" } Note: Many servers ignore {grant_id} and update by (project_id, room_name, user_id).
updateRoomService({required String projectId, required String serviceId, required ServiceSpec service, required String roomName}) Future<void>
Corresponds to: POST /accounts/projects/:project_id/ Body: { "environment" : <settings> } Returns JSON like { "id" } on success.
updateSecret({required String projectId, required String secretId, required String name, required String type, required Map<String, dynamic> data}) Future<void>
Corresponds to: PUT /accounts/projects/{project_id}/secrets/{secret_id} Body: { "name": "...", "type": "...", "data": ... } Returns empty JSON object {} on success.
updateService({required String projectId, required String serviceId, required ServiceSpec service}) Future<void>
Corresponds to: POST /accounts/projects/:project_id/ Body: { "environment" : <settings> } Returns JSON like { "id" } on success.
updateShare(String projectId, String shareId, {Map<String, dynamic>? settings}) Future<void>
Corresponds to: PUT /accounts/projects/:project_id/shares/:share_id Body: { "settings": <settings> } No JSON response on success.
updateUser({required String projectId, required String userId, required bool isAdmin, required bool isDeveloper}) Future<void>
Corresponds to: POST /accounts/projects/:project_id/users/:user_id Body: { "is_admin" } Returns JSON like { "ok": true } on success.
updateUserProfile(String userId, String firstName, String lastName) Future<Map<String, dynamic>>
Corresponds to: PUT /accounts/profiles/:user_id Body: { "first_name", "last_name" } Returns JSON like { "ok": true } on success.
updateWebhook(String projectId, String webhookId, {required String name, required String url, required List<String> events, String description = '', String? action, String? payload}) Future<Map<String, dynamic>>
Corresponds to: PUT /accounts/projects/{project_id}/webhooks/{webhook_id} Body: { "name", "description", "url", "events" } Returns the updated resource JSON or an empty object (depends on your server).
upload({required String projectId, required String path, required Uint8List data}) Future<void>
Corresponds to: POST /projects/:project_id/storage/upload

Operators

operator ==(Object other) bool
The equality operator.
inherited