mirror of
https://github.com/appwrite/sdk-for-dart.git
synced 2026-04-07 19:17:49 +00:00
feat: updates for Appwrite 1.6
This commit is contained in:
@@ -1 +1 @@
|
||||
export 'src/client_browser.dart';
|
||||
export 'src/client_browser.dart';
|
||||
+1
-1
@@ -1 +1 @@
|
||||
export 'src/client_io.dart';
|
||||
export 'src/client_io.dart';
|
||||
@@ -1,6 +1,6 @@
|
||||
/// Appwrite Dart SDK
|
||||
///
|
||||
/// This SDK is compatible with Appwrite server version 1.6.x.
|
||||
/// This SDK is compatible with Appwrite server version 1.6.x.
|
||||
/// For older versions, please check
|
||||
/// [previous releases](https://github.com/appwrite/sdk-for-dart/releases).
|
||||
library dart_appwrite;
|
||||
|
||||
+2
-1
@@ -10,7 +10,8 @@ class ID {
|
||||
final now = DateTime.now();
|
||||
final sec = (now.millisecondsSinceEpoch / 1000).floor();
|
||||
final usec = now.microsecondsSinceEpoch - (sec * 1000000);
|
||||
return sec.toRadixString(16) + usec.toRadixString(16).padLeft(5, '0');
|
||||
return sec.toRadixString(16) +
|
||||
usec.toRadixString(16).padLeft(5, '0');
|
||||
}
|
||||
|
||||
// Generate a unique ID with padding to have a longer ID
|
||||
|
||||
+19
-26
@@ -1,5 +1,6 @@
|
||||
part of 'dart_appwrite.dart';
|
||||
|
||||
|
||||
/// Helper class to generate query strings.
|
||||
class Query {
|
||||
final String method;
|
||||
@@ -13,11 +14,11 @@ class Query {
|
||||
'method': method,
|
||||
};
|
||||
|
||||
if (attribute != null) {
|
||||
if(attribute != null) {
|
||||
map['attribute'] = attribute;
|
||||
}
|
||||
|
||||
if (values != null) {
|
||||
|
||||
if(values != null) {
|
||||
map['values'] = values is List ? values : [values];
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ class Query {
|
||||
String toString() => jsonEncode(toJson());
|
||||
|
||||
/// Filter resources where [attribute] is equal to [value].
|
||||
///
|
||||
///
|
||||
/// [value] can be a single value or a list. If a list is used
|
||||
/// the query will return resources where [attribute] is equal
|
||||
/// to any of the values in the list.
|
||||
@@ -60,12 +61,10 @@ class Query {
|
||||
Query._('search', attribute, value).toString();
|
||||
|
||||
/// Filter resources where [attribute] is null.
|
||||
static String isNull(String attribute) =>
|
||||
Query._('isNull', attribute).toString();
|
||||
static String isNull(String attribute) => Query._('isNull', attribute).toString();
|
||||
|
||||
/// Filter resources where [attribute] is not null.
|
||||
static String isNotNull(String attribute) =>
|
||||
Query._('isNotNull', attribute).toString();
|
||||
static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString();
|
||||
|
||||
/// Filter resources where [attribute] is between [start] and [end] (inclusive).
|
||||
static String between(String attribute, dynamic start, dynamic end) =>
|
||||
@@ -85,46 +84,40 @@ class Query {
|
||||
Query._('contains', attribute, value).toString();
|
||||
|
||||
static String or(List<String> queries) =>
|
||||
Query._('or', null, queries.map((query) => jsonDecode(query)).toList())
|
||||
.toString();
|
||||
Query._('or', null, queries.map((query) => jsonDecode(query)).toList()).toString();
|
||||
|
||||
static String and(List<String> queries) =>
|
||||
Query._('and', null, queries.map((query) => jsonDecode(query)).toList())
|
||||
.toString();
|
||||
Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString();
|
||||
|
||||
/// Specify which attributes should be returned by the API call.
|
||||
static String select(List<String> attributes) =>
|
||||
Query._('select', null, attributes).toString();
|
||||
|
||||
/// Sort results by [attribute] ascending.
|
||||
static String orderAsc(String attribute) =>
|
||||
Query._('orderAsc', attribute).toString();
|
||||
static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString();
|
||||
|
||||
/// Sort results by [attribute] descending.
|
||||
static String orderDesc(String attribute) =>
|
||||
Query._('orderDesc', attribute).toString();
|
||||
static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString();
|
||||
|
||||
/// Return results before [id].
|
||||
///
|
||||
///
|
||||
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
|
||||
/// docs for more information.
|
||||
static String cursorBefore(String id) =>
|
||||
Query._('cursorBefore', null, id).toString();
|
||||
static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString();
|
||||
|
||||
/// Return results after [id].
|
||||
///
|
||||
///
|
||||
/// Refer to the [Cursor Based Pagination](https://appwrite.io/docs/pagination#cursor-pagination)
|
||||
/// docs for more information.
|
||||
static String cursorAfter(String id) =>
|
||||
Query._('cursorAfter', null, id).toString();
|
||||
static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString();
|
||||
|
||||
/// Return only [limit] results.
|
||||
static String limit(int limit) => Query._('limit', null, limit).toString();
|
||||
|
||||
/// Return results from [offset].
|
||||
///
|
||||
///
|
||||
/// Refer to the [Offset Pagination](https://appwrite.io/docs/pagination#offset-pagination)
|
||||
/// docs for more information.
|
||||
static String offset(int offset) =>
|
||||
Query._('offset', null, offset).toString();
|
||||
}
|
||||
static String offset(int offset) => Query._('offset', null, offset).toString();
|
||||
|
||||
}
|
||||
+55
-55
@@ -2,65 +2,65 @@ part of 'dart_appwrite.dart';
|
||||
|
||||
/// Helper class to generate role strings for [Permission].
|
||||
class Role {
|
||||
Role._();
|
||||
|
||||
/// Grants access to anyone.
|
||||
///
|
||||
/// This includes authenticated and unauthenticated users.
|
||||
static String any() {
|
||||
return 'any';
|
||||
}
|
||||
|
||||
/// Grants access to a specific user by user ID.
|
||||
///
|
||||
/// You can optionally pass verified or unverified for
|
||||
/// [status] to target specific types of users.
|
||||
static String user(String id, [String status = '']) {
|
||||
if (status.isEmpty) {
|
||||
return 'user:$id';
|
||||
Role._();
|
||||
|
||||
/// Grants access to anyone.
|
||||
///
|
||||
/// This includes authenticated and unauthenticated users.
|
||||
static String any() {
|
||||
return 'any';
|
||||
}
|
||||
return 'user:$id/$status';
|
||||
}
|
||||
|
||||
/// Grants access to any authenticated or anonymous user.
|
||||
///
|
||||
/// You can optionally pass verified or unverified for
|
||||
/// [status] to target specific types of users.
|
||||
static String users([String status = '']) {
|
||||
if (status.isEmpty) {
|
||||
return 'users';
|
||||
/// Grants access to a specific user by user ID.
|
||||
///
|
||||
/// You can optionally pass verified or unverified for
|
||||
/// [status] to target specific types of users.
|
||||
static String user(String id, [String status = '']) {
|
||||
if(status.isEmpty) {
|
||||
return 'user:$id';
|
||||
}
|
||||
return 'user:$id/$status';
|
||||
}
|
||||
return 'users/$status';
|
||||
}
|
||||
|
||||
/// Grants access to any guest user without a session.
|
||||
///
|
||||
/// Authenticated users don't have access to this role.
|
||||
static String guests() {
|
||||
return 'guests';
|
||||
}
|
||||
|
||||
/// Grants access to a team by team ID.
|
||||
///
|
||||
/// You can optionally pass a role for [role] to target
|
||||
/// team members with the specified role.
|
||||
static String team(String id, [String role = '']) {
|
||||
if (role.isEmpty) {
|
||||
return 'team:$id';
|
||||
/// Grants access to any authenticated or anonymous user.
|
||||
///
|
||||
/// You can optionally pass verified or unverified for
|
||||
/// [status] to target specific types of users.
|
||||
static String users([String status = '']) {
|
||||
if(status.isEmpty) {
|
||||
return 'users';
|
||||
}
|
||||
return 'users/$status';
|
||||
}
|
||||
return 'team:$id/$role';
|
||||
}
|
||||
|
||||
/// Grants access to a specific member of a team.
|
||||
///
|
||||
/// When the member is removed from the team, they will
|
||||
/// no longer have access.
|
||||
static String member(String id) {
|
||||
return 'member:$id';
|
||||
}
|
||||
/// Grants access to any guest user without a session.
|
||||
///
|
||||
/// Authenticated users don't have access to this role.
|
||||
static String guests() {
|
||||
return 'guests';
|
||||
}
|
||||
|
||||
/// Grants access to a user with the specified label.
|
||||
static String label(String name) {
|
||||
return 'label:$name';
|
||||
}
|
||||
}
|
||||
/// Grants access to a team by team ID.
|
||||
///
|
||||
/// You can optionally pass a role for [role] to target
|
||||
/// team members with the specified role.
|
||||
static String team(String id, [String role = '']) {
|
||||
if(role.isEmpty) {
|
||||
return 'team:$id';
|
||||
}
|
||||
return 'team:$id/$role';
|
||||
}
|
||||
|
||||
/// Grants access to a specific member of a team.
|
||||
///
|
||||
/// When the member is removed from the team, they will
|
||||
/// no longer have access.
|
||||
static String member(String id) {
|
||||
return 'member:$id';
|
||||
}
|
||||
|
||||
/// Grants access to a user with the specified label.
|
||||
static String label(String name) {
|
||||
return 'label:$name';
|
||||
}
|
||||
}
|
||||
+1174
-1069
File diff suppressed because it is too large
Load Diff
+177
-185
@@ -3,209 +3,201 @@ part of '../dart_appwrite.dart';
|
||||
/// The Avatars service aims to help you complete everyday tasks related to
|
||||
/// your app image, icons, and avatars.
|
||||
class Avatars extends Service {
|
||||
Avatars(super.client);
|
||||
Avatars(super.client);
|
||||
|
||||
/// Get browser icon
|
||||
///
|
||||
/// You can use this endpoint to show different browser icons to your users.
|
||||
/// The code argument receives the browser code as it appears in your user [GET
|
||||
/// /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
||||
/// endpoint. Use width, height and quality arguments to change the output
|
||||
/// settings.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
Future<Uint8List> getBrowser(
|
||||
{required enums.Browser code,
|
||||
int? width,
|
||||
int? height,
|
||||
int? quality}) async {
|
||||
final String apiPath =
|
||||
'/avatars/browsers/{code}'.replaceAll('{code}', code.value);
|
||||
/// Get browser icon
|
||||
///
|
||||
/// You can use this endpoint to show different browser icons to your users.
|
||||
/// The code argument receives the browser code as it appears in your user [GET
|
||||
/// /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
||||
/// endpoint. Use width, height and quality arguments to change the output
|
||||
/// settings.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
Future<Uint8List> getBrowser({required enums.Browser code, int? width, int? height, int? quality}) async {
|
||||
final String apiPath = '/avatars/browsers/{code}'.replaceAll('{code}', code.value);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
/// Get credit card icon
|
||||
///
|
||||
/// The credit card endpoint will return you the icon of the credit card
|
||||
/// provider you need. Use width, height and quality arguments to change the
|
||||
/// output settings.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getCreditCard(
|
||||
{required enums.CreditCard code,
|
||||
int? width,
|
||||
int? height,
|
||||
int? quality}) async {
|
||||
final String apiPath =
|
||||
'/avatars/credit-cards/{code}'.replaceAll('{code}', code.value);
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
/// Get credit card icon
|
||||
///
|
||||
/// The credit card endpoint will return you the icon of the credit card
|
||||
/// provider you need. Use width, height and quality arguments to change the
|
||||
/// output settings.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getCreditCard({required enums.CreditCard code, int? width, int? height, int? quality}) async {
|
||||
final String apiPath = '/avatars/credit-cards/{code}'.replaceAll('{code}', code.value);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
|
||||
/// Get favicon
|
||||
///
|
||||
/// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
||||
/// website URL.
|
||||
///
|
||||
/// This endpoint does not follow HTTP redirects.
|
||||
Future<Uint8List> getFavicon({required String url}) async {
|
||||
final String apiPath = '/avatars/favicon';
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
/// Get favicon
|
||||
///
|
||||
/// Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
||||
/// website URL.
|
||||
///
|
||||
/// This endpoint does not follow HTTP redirects.
|
||||
Future<Uint8List> getFavicon({required String url}) async {
|
||||
final String apiPath = '/avatars/favicon';
|
||||
|
||||
/// Get country flag
|
||||
///
|
||||
/// You can use this endpoint to show different country flags icons to your
|
||||
/// users. The code argument receives the 2 letter country code. Use width,
|
||||
/// height and quality arguments to change the output settings. Country codes
|
||||
/// follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getFlag(
|
||||
{required enums.Flag code, int? width, int? height, int? quality}) async {
|
||||
final String apiPath =
|
||||
'/avatars/flags/{code}'.replaceAll('{code}', code.value);
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get image from URL
|
||||
///
|
||||
/// Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
/// you want. This endpoint is very useful if you need to crop and display
|
||||
/// remote images in your app or in case you want to make sure a 3rd party
|
||||
/// image is properly served using a TLS protocol.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 400x400px.
|
||||
///
|
||||
/// This endpoint does not follow HTTP redirects.
|
||||
Future<Uint8List> getImage(
|
||||
{required String url, int? width, int? height}) async {
|
||||
final String apiPath = '/avatars/image';
|
||||
/// Get country flag
|
||||
///
|
||||
/// You can use this endpoint to show different country flags icons to your
|
||||
/// users. The code argument receives the 2 letter country code. Use width,
|
||||
/// height and quality arguments to change the output settings. Country codes
|
||||
/// follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getFlag({required enums.Flag code, int? width, int? height, int? quality}) async {
|
||||
final String apiPath = '/avatars/flags/{code}'.replaceAll('{code}', code.value);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'quality': quality,
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
/// Get user initials
|
||||
///
|
||||
/// Use this endpoint to show your user initials avatar icon on your website or
|
||||
/// app. By default, this route will try to print your logged-in user name or
|
||||
/// email initials. You can also overwrite the user name if you pass the 'name'
|
||||
/// parameter. If no name is given and no user is logged, an empty avatar will
|
||||
/// be returned.
|
||||
///
|
||||
/// You can use the color and background params to change the avatar colors. By
|
||||
/// default, a random theme will be selected. The random theme will persist for
|
||||
/// the user's initials when reloading the same theme will always return for
|
||||
/// the same initials.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getInitials(
|
||||
{String? name, int? width, int? height, String? background}) async {
|
||||
final String apiPath = '/avatars/initials';
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'name': name,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'background': background,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
/// Get image from URL
|
||||
///
|
||||
/// Use this endpoint to fetch a remote image URL and crop it to any image size
|
||||
/// you want. This endpoint is very useful if you need to crop and display
|
||||
/// remote images in your app or in case you want to make sure a 3rd party
|
||||
/// image is properly served using a TLS protocol.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 400x400px.
|
||||
///
|
||||
/// This endpoint does not follow HTTP redirects.
|
||||
Future<Uint8List> getImage({required String url, int? width, int? height}) async {
|
||||
final String apiPath = '/avatars/image';
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
'width': width,
|
||||
'height': height,
|
||||
|
||||
/// Get QR code
|
||||
///
|
||||
/// Converts a given plain text to a QR code image. You can use the query
|
||||
/// parameters to change the size and style of the resulting image.
|
||||
///
|
||||
Future<Uint8List> getQR(
|
||||
{required String text, int? size, int? margin, bool? download}) async {
|
||||
final String apiPath = '/avatars/qr';
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'text': text,
|
||||
'size': size,
|
||||
'margin': margin,
|
||||
'download': download,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
/// Get user initials
|
||||
///
|
||||
/// Use this endpoint to show your user initials avatar icon on your website or
|
||||
/// app. By default, this route will try to print your logged-in user name or
|
||||
/// email initials. You can also overwrite the user name if you pass the 'name'
|
||||
/// parameter. If no name is given and no user is logged, an empty avatar will
|
||||
/// be returned.
|
||||
///
|
||||
/// You can use the color and background params to change the avatar colors. By
|
||||
/// default, a random theme will be selected. The random theme will persist for
|
||||
/// the user's initials when reloading the same theme will always return for
|
||||
/// the same initials.
|
||||
///
|
||||
/// When one dimension is specified and the other is 0, the image is scaled
|
||||
/// with preserved aspect ratio. If both dimensions are 0, the API provides an
|
||||
/// image at source quality. If dimensions are not specified, the default size
|
||||
/// of image returned is 100x100px.
|
||||
///
|
||||
Future<Uint8List> getInitials({String? name, int? width, int? height, String? background}) async {
|
||||
final String apiPath = '/avatars/initials';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'name': name,
|
||||
'width': width,
|
||||
'height': height,
|
||||
'background': background,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get QR code
|
||||
///
|
||||
/// Converts a given plain text to a QR code image. You can use the query
|
||||
/// parameters to change the size and style of the resulting image.
|
||||
///
|
||||
Future<Uint8List> getQR({required String text, int? size, int? margin, bool? download}) async {
|
||||
final String apiPath = '/avatars/qr';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'text': text,
|
||||
'size': size,
|
||||
'margin': margin,
|
||||
'download': download,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
+1079
-1255
File diff suppressed because it is too large
Load Diff
+668
-697
File diff suppressed because it is too large
Load Diff
+40
-34
@@ -3,47 +3,53 @@ part of '../dart_appwrite.dart';
|
||||
/// The GraphQL API allows you to query and mutate your Appwrite server using
|
||||
/// GraphQL.
|
||||
class Graphql extends Service {
|
||||
Graphql(super.client);
|
||||
Graphql(super.client);
|
||||
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future query({required Map query}) async {
|
||||
final String apiPath = '/graphql';
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future query({required Map query}) async {
|
||||
final String apiPath = '/graphql';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'query': query,
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'query': query,
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'x-sdk-graphql': 'true',
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'x-sdk-graphql': 'true',
|
||||
'content-type': 'application/json',
|
||||
|
||||
return res.data;
|
||||
}
|
||||
};
|
||||
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future mutation({required Map query}) async {
|
||||
final String apiPath = '/graphql/mutation';
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'query': query,
|
||||
};
|
||||
return res.data;
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'x-sdk-graphql': 'true',
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
/// GraphQL endpoint
|
||||
///
|
||||
/// Execute a GraphQL mutation.
|
||||
Future mutation({required Map query}) async {
|
||||
final String apiPath = '/graphql/mutation';
|
||||
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'query': query,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'x-sdk-graphql': 'true',
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
|
||||
}
|
||||
}
|
||||
+502
-427
@@ -3,473 +3,548 @@ part of '../dart_appwrite.dart';
|
||||
/// The Health service allows you to both validate and monitor your Appwrite
|
||||
/// server's health.
|
||||
class Health extends Service {
|
||||
Health(super.client);
|
||||
Health(super.client);
|
||||
|
||||
/// Get HTTP
|
||||
///
|
||||
/// Check the Appwrite HTTP server is up and responsive.
|
||||
Future<models.HealthStatus> get() async {
|
||||
final String apiPath = '/health';
|
||||
/// Get HTTP
|
||||
///
|
||||
/// Check the Appwrite HTTP server is up and responsive.
|
||||
Future<models.HealthStatus> get() async {
|
||||
final String apiPath = '/health';
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
};
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
/// Get antivirus
|
||||
///
|
||||
/// Check the Appwrite Antivirus server is up and connection is successful.
|
||||
Future<models.HealthAntivirus> getAntivirus() async {
|
||||
final String apiPath = '/health/anti-virus';
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
}
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
/// Get antivirus
|
||||
///
|
||||
/// Check the Appwrite Antivirus server is up and connection is successful.
|
||||
Future<models.HealthAntivirus> getAntivirus() async {
|
||||
final String apiPath = '/health/anti-virus';
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
return models.HealthAntivirus.fromMap(res.data);
|
||||
}
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
/// Get cache
|
||||
///
|
||||
/// Check the Appwrite in-memory cache servers are up and connection is
|
||||
/// successful.
|
||||
Future<models.HealthStatus> getCache() async {
|
||||
final String apiPath = '/health/cache';
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
return models.HealthAntivirus.fromMap(res.data);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
}
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
/// Get cache
|
||||
///
|
||||
/// Check the Appwrite in-memory cache servers are up and connection is
|
||||
/// successful.
|
||||
Future<models.HealthStatus> getCache() async {
|
||||
final String apiPath = '/health/cache';
|
||||
|
||||
/// Get the SSL certificate for a domain
|
||||
///
|
||||
/// Get the SSL certificate for a domain
|
||||
Future<models.HealthCertificate> getCertificate({String? domain}) async {
|
||||
final String apiPath = '/health/certificate';
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'domain': domain,
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthCertificate.fromMap(res.data);
|
||||
}
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
/// Get DB
|
||||
///
|
||||
/// Check the Appwrite database servers are up and connection is successful.
|
||||
Future<models.HealthStatus> getDB() async {
|
||||
final String apiPath = '/health/db';
|
||||
}
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
/// Get the SSL certificate for a domain
|
||||
///
|
||||
/// Get the SSL certificate for a domain
|
||||
Future<models.HealthCertificate> getCertificate({String? domain}) async {
|
||||
final String apiPath = '/health/certificate';
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'domain': domain,
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
};
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
/// Get pubsub
|
||||
///
|
||||
/// Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
Future<models.HealthStatus> getPubSub() async {
|
||||
final String apiPath = '/health/pubsub';
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
return models.HealthCertificate.fromMap(res.data);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
}
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
/// Get DB
|
||||
///
|
||||
/// Check the Appwrite database servers are up and connection is successful.
|
||||
Future<models.HealthStatus> getDB() async {
|
||||
final String apiPath = '/health/db';
|
||||
|
||||
/// Get queue
|
||||
///
|
||||
/// Check the Appwrite queue messaging servers are up and connection is
|
||||
/// successful.
|
||||
Future<models.HealthStatus> getQueue() async {
|
||||
final String apiPath = '/health/queue';
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
/// Get builds queue
|
||||
///
|
||||
/// Get the number of builds that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueBuilds({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/builds';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get certificates queue
|
||||
///
|
||||
/// Get the number of certificates that are waiting to be issued against
|
||||
/// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
||||
/// server.
|
||||
Future<models.HealthQueue> getQueueCertificates({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/certificates';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get databases queue
|
||||
///
|
||||
/// Get the number of database changes that are waiting to be processed in the
|
||||
/// Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueDatabases(
|
||||
{String? name, int? threshold}) async {
|
||||
final String apiPath = '/health/queue/databases';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'name': name,
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get deletes queue
|
||||
///
|
||||
/// Get the number of background destructive changes that are waiting to be
|
||||
/// processed in the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueDeletes({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/deletes';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get number of failed queue jobs
|
||||
///
|
||||
/// Returns the amount of failed jobs in a given queue.
|
||||
///
|
||||
Future<models.HealthQueue> getFailedJobs(
|
||||
{required enums.Name name, int? threshold}) async {
|
||||
final String apiPath =
|
||||
'/health/queue/failed/{name}'.replaceAll('{name}', name.value);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get functions queue
|
||||
///
|
||||
/// Get the number of function executions that are waiting to be processed in
|
||||
/// the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueFunctions({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/functions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get logs queue
|
||||
///
|
||||
/// Get the number of logs that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueLogs({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/logs';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get mails queue
|
||||
///
|
||||
/// Get the number of mails that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueMails({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/mails';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get messaging queue
|
||||
///
|
||||
/// Get the number of messages that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueMessaging({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/messaging';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get migrations queue
|
||||
///
|
||||
/// Get the number of migrations that are waiting to be processed in the
|
||||
/// Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueMigrations({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/migrations';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
|
||||
/// Get usage queue
|
||||
///
|
||||
/// Get the number of metrics that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueUsage({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/usage';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get usage dump queue
|
||||
///
|
||||
/// Get the number of projects containing metrics that are waiting to be
|
||||
/// processed in the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueUsageDump({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/usage-dump';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get webhooks queue
|
||||
///
|
||||
/// Get the number of webhooks that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueWebhooks({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/webhooks';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get storage
|
||||
///
|
||||
/// Check the Appwrite storage device is up and connection is successful.
|
||||
Future<models.HealthStatus> getStorage() async {
|
||||
final String apiPath = '/health/storage';
|
||||
/// Get pubsub
|
||||
///
|
||||
/// Check the Appwrite pub-sub servers are up and connection is successful.
|
||||
Future<models.HealthStatus> getPubSub() async {
|
||||
final String apiPath = '/health/pubsub';
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get local storage
|
||||
///
|
||||
/// Check the Appwrite local storage device is up and connection is successful.
|
||||
Future<models.HealthStatus> getStorageLocal() async {
|
||||
final String apiPath = '/health/storage/local';
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get time
|
||||
///
|
||||
/// Check the Appwrite server time is synced with Google remote NTP server. We
|
||||
/// use this technology to smoothly handle leap seconds with no disruptive
|
||||
/// events. The [Network Time
|
||||
/// Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
|
||||
/// used by hundreds of millions of computers and devices to synchronize their
|
||||
/// clocks over the Internet. If your computer sets its own clock, it likely
|
||||
/// uses NTP.
|
||||
Future<models.HealthTime> getTime() async {
|
||||
final String apiPath = '/health/time';
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthTime.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Get queue
|
||||
///
|
||||
/// Check the Appwrite queue messaging servers are up and connection is
|
||||
/// successful.
|
||||
Future<models.HealthStatus> getQueue() async {
|
||||
final String apiPath = '/health/queue';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get builds queue
|
||||
///
|
||||
/// Get the number of builds that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueBuilds({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/builds';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get certificates queue
|
||||
///
|
||||
/// Get the number of certificates that are waiting to be issued against
|
||||
/// [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
|
||||
/// server.
|
||||
Future<models.HealthQueue> getQueueCertificates({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/certificates';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get databases queue
|
||||
///
|
||||
/// Get the number of database changes that are waiting to be processed in the
|
||||
/// Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueDatabases({String? name, int? threshold}) async {
|
||||
final String apiPath = '/health/queue/databases';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'name': name,
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get deletes queue
|
||||
///
|
||||
/// Get the number of background destructive changes that are waiting to be
|
||||
/// processed in the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueDeletes({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/deletes';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get number of failed queue jobs
|
||||
///
|
||||
/// Returns the amount of failed jobs in a given queue.
|
||||
///
|
||||
Future<models.HealthQueue> getFailedJobs({required enums.Name name, int? threshold}) async {
|
||||
final String apiPath = '/health/queue/failed/{name}'.replaceAll('{name}', name.value);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get functions queue
|
||||
///
|
||||
/// Get the number of function executions that are waiting to be processed in
|
||||
/// the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueFunctions({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/functions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get logs queue
|
||||
///
|
||||
/// Get the number of logs that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueLogs({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/logs';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get mails queue
|
||||
///
|
||||
/// Get the number of mails that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueMails({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/mails';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get messaging queue
|
||||
///
|
||||
/// Get the number of messages that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueMessaging({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/messaging';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get migrations queue
|
||||
///
|
||||
/// Get the number of migrations that are waiting to be processed in the
|
||||
/// Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueMigrations({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/migrations';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get usage queue
|
||||
///
|
||||
/// Get the number of metrics that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueUsage({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/usage';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get usage dump queue
|
||||
///
|
||||
/// Get the number of projects containing metrics that are waiting to be
|
||||
/// processed in the Appwrite internal queue server.
|
||||
Future<models.HealthQueue> getQueueUsageDump({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/usage-dump';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get webhooks queue
|
||||
///
|
||||
/// Get the number of webhooks that are waiting to be processed in the Appwrite
|
||||
/// internal queue server.
|
||||
Future<models.HealthQueue> getQueueWebhooks({int? threshold}) async {
|
||||
final String apiPath = '/health/queue/webhooks';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'threshold': threshold,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthQueue.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get storage
|
||||
///
|
||||
/// Check the Appwrite storage device is up and connection is successful.
|
||||
Future<models.HealthStatus> getStorage() async {
|
||||
final String apiPath = '/health/storage';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get local storage
|
||||
///
|
||||
/// Check the Appwrite local storage device is up and connection is successful.
|
||||
Future<models.HealthStatus> getStorageLocal() async {
|
||||
final String apiPath = '/health/storage/local';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthStatus.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get time
|
||||
///
|
||||
/// Check the Appwrite server time is synced with Google remote NTP server. We
|
||||
/// use this technology to smoothly handle leap seconds with no disruptive
|
||||
/// events. The [Network Time
|
||||
/// Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is
|
||||
/// used by hundreds of millions of computers and devices to synchronize their
|
||||
/// clocks over the Internet. If your computer sets its own clock, it likely
|
||||
/// uses NTP.
|
||||
Future<models.HealthTime> getTime() async {
|
||||
final String apiPath = '/health/time';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.HealthTime.fromMap(res.data);
|
||||
|
||||
}
|
||||
}
|
||||
+151
-119
@@ -3,162 +3,194 @@ part of '../dart_appwrite.dart';
|
||||
/// The Locale service allows you to customize your app based on your users'
|
||||
/// location.
|
||||
class Locale extends Service {
|
||||
Locale(super.client);
|
||||
Locale(super.client);
|
||||
|
||||
/// Get user locale
|
||||
///
|
||||
/// Get the current user location based on IP. Returns an object with user
|
||||
/// country code, country name, continent name, continent code, ip address and
|
||||
/// suggested currency. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
///
|
||||
/// ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
Future<models.Locale> get() async {
|
||||
final String apiPath = '/locale';
|
||||
/// Get user locale
|
||||
///
|
||||
/// Get the current user location based on IP. Returns an object with user
|
||||
/// country code, country name, continent name, continent code, ip address and
|
||||
/// suggested currency. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
///
|
||||
/// ([IP Geolocation by DB-IP](https://db-ip.com))
|
||||
Future<models.Locale> get() async {
|
||||
final String apiPath = '/locale';
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
};
|
||||
|
||||
return models.Locale.fromMap(res.data);
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
/// List Locale Codes
|
||||
///
|
||||
/// List of all locale codes in [ISO
|
||||
/// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
Future<models.LocaleCodeList> listCodes() async {
|
||||
final String apiPath = '/locale/codes';
|
||||
return models.Locale.fromMap(res.data);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
}
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
/// List Locale Codes
|
||||
///
|
||||
/// List of all locale codes in [ISO
|
||||
/// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
||||
Future<models.LocaleCodeList> listCodes() async {
|
||||
final String apiPath = '/locale/codes';
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
return models.LocaleCodeList.fromMap(res.data);
|
||||
}
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
/// List continents
|
||||
///
|
||||
/// List of all continents. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
Future<models.ContinentList> listContinents() async {
|
||||
final String apiPath = '/locale/continents';
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
return models.LocaleCodeList.fromMap(res.data);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
}
|
||||
|
||||
return models.ContinentList.fromMap(res.data);
|
||||
}
|
||||
/// List continents
|
||||
///
|
||||
/// List of all continents. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
Future<models.ContinentList> listContinents() async {
|
||||
final String apiPath = '/locale/continents';
|
||||
|
||||
/// List countries
|
||||
///
|
||||
/// List of all countries. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
Future<models.CountryList> listCountries() async {
|
||||
final String apiPath = '/locale/countries';
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
}
|
||||
return models.ContinentList.fromMap(res.data);
|
||||
|
||||
/// List EU countries
|
||||
///
|
||||
/// List of all countries that are currently members of the EU. You can use the
|
||||
/// locale header to get the data in a supported language.
|
||||
Future<models.CountryList> listCountriesEU() async {
|
||||
final String apiPath = '/locale/countries/eu';
|
||||
}
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
/// List countries
|
||||
///
|
||||
/// List of all countries. You can use the locale header to get the data in a
|
||||
/// supported language.
|
||||
Future<models.CountryList> listCountries() async {
|
||||
final String apiPath = '/locale/countries';
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
}
|
||||
};
|
||||
|
||||
/// List countries phone codes
|
||||
///
|
||||
/// List of all countries phone codes. You can use the locale header to get the
|
||||
/// data in a supported language.
|
||||
Future<models.PhoneList> listCountriesPhones() async {
|
||||
final String apiPath = '/locale/countries/phones';
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
return models.CountryList.fromMap(res.data);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
/// List EU countries
|
||||
///
|
||||
/// List of all countries that are currently members of the EU. You can use the
|
||||
/// locale header to get the data in a supported language.
|
||||
Future<models.CountryList> listCountriesEU() async {
|
||||
final String apiPath = '/locale/countries/eu';
|
||||
|
||||
return models.PhoneList.fromMap(res.data);
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
/// List currencies
|
||||
///
|
||||
/// List of all currencies, including currency symbol, name, plural, and
|
||||
/// decimal digits for all major and minor currencies. You can use the locale
|
||||
/// header to get the data in a supported language.
|
||||
Future<models.CurrencyList> listCurrencies() async {
|
||||
final String apiPath = '/locale/currencies';
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
return models.CountryList.fromMap(res.data);
|
||||
|
||||
return models.CurrencyList.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
|
||||
/// List languages
|
||||
///
|
||||
/// List of all languages classified by ISO 639-1 including 2-letter code, name
|
||||
/// in English, and name in the respective language.
|
||||
Future<models.LanguageList> listLanguages() async {
|
||||
final String apiPath = '/locale/languages';
|
||||
/// List countries phone codes
|
||||
///
|
||||
/// List of all countries phone codes. You can use the locale header to get the
|
||||
/// data in a supported language.
|
||||
Future<models.PhoneList> listCountriesPhones() async {
|
||||
final String apiPath = '/locale/countries/phones';
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
};
|
||||
|
||||
return models.LanguageList.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.PhoneList.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// List currencies
|
||||
///
|
||||
/// List of all currencies, including currency symbol, name, plural, and
|
||||
/// decimal digits for all major and minor currencies. You can use the locale
|
||||
/// header to get the data in a supported language.
|
||||
Future<models.CurrencyList> listCurrencies() async {
|
||||
final String apiPath = '/locale/currencies';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CurrencyList.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// List languages
|
||||
///
|
||||
/// List of all languages classified by ISO 639-1 including 2-letter code, name
|
||||
/// in English, and name in the respective language.
|
||||
Future<models.LanguageList> listLanguages() async {
|
||||
final String apiPath = '/locale/languages';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.LanguageList.fromMap(res.data);
|
||||
|
||||
}
|
||||
}
|
||||
+1248
-1371
File diff suppressed because it is too large
Load Diff
+294
-320
@@ -2,382 +2,356 @@ part of '../dart_appwrite.dart';
|
||||
|
||||
/// The Storage service allows you to manage your project files.
|
||||
class Storage extends Service {
|
||||
Storage(super.client);
|
||||
Storage(super.client);
|
||||
|
||||
/// List buckets
|
||||
///
|
||||
/// Get a list of all the storage buckets. You can use the query params to
|
||||
/// filter your results.
|
||||
Future<models.BucketList> listBuckets(
|
||||
{List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/storage/buckets';
|
||||
/// List buckets
|
||||
///
|
||||
/// Get a list of all the storage buckets. You can use the query params to
|
||||
/// filter your results.
|
||||
Future<models.BucketList> listBuckets({List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/storage/buckets';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
return models.BucketList.fromMap(res.data);
|
||||
}
|
||||
};
|
||||
|
||||
/// Create bucket
|
||||
///
|
||||
/// Create a new storage bucket.
|
||||
Future<models.Bucket> createBucket(
|
||||
{required String bucketId,
|
||||
required String name,
|
||||
List<String>? permissions,
|
||||
bool? fileSecurity,
|
||||
bool? enabled,
|
||||
int? maximumFileSize,
|
||||
List<String>? allowedFileExtensions,
|
||||
enums.Compression? compression,
|
||||
bool? encryption,
|
||||
bool? antivirus}) async {
|
||||
final String apiPath = '/storage/buckets';
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'bucketId': bucketId,
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
'fileSecurity': fileSecurity,
|
||||
'enabled': enabled,
|
||||
'maximumFileSize': maximumFileSize,
|
||||
'allowedFileExtensions': allowedFileExtensions,
|
||||
'compression': compression?.value,
|
||||
'encryption': encryption,
|
||||
'antivirus': antivirus,
|
||||
};
|
||||
return models.BucketList.fromMap(res.data);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
/// Create bucket
|
||||
///
|
||||
/// Create a new storage bucket.
|
||||
Future<models.Bucket> createBucket({required String bucketId, required String name, List<String>? permissions, bool? fileSecurity, bool? enabled, int? maximumFileSize, List<String>? allowedFileExtensions, enums.Compression? compression, bool? encryption, bool? antivirus}) async {
|
||||
final String apiPath = '/storage/buckets';
|
||||
|
||||
return models.Bucket.fromMap(res.data);
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'bucketId': bucketId,
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
'fileSecurity': fileSecurity,
|
||||
'enabled': enabled,
|
||||
'maximumFileSize': maximumFileSize,
|
||||
'allowedFileExtensions': allowedFileExtensions,
|
||||
'compression': compression?.value,
|
||||
'encryption': encryption,
|
||||
'antivirus': antivirus,
|
||||
|
||||
/// Get bucket
|
||||
///
|
||||
/// Get a storage bucket by its unique ID. This endpoint response returns a
|
||||
/// JSON object with the storage bucket metadata.
|
||||
Future<models.Bucket> getBucket({required String bucketId}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Bucket.fromMap(res.data);
|
||||
}
|
||||
return models.Bucket.fromMap(res.data);
|
||||
|
||||
/// Update bucket
|
||||
///
|
||||
/// Update a storage bucket by its unique ID.
|
||||
Future<models.Bucket> updateBucket(
|
||||
{required String bucketId,
|
||||
required String name,
|
||||
List<String>? permissions,
|
||||
bool? fileSecurity,
|
||||
bool? enabled,
|
||||
int? maximumFileSize,
|
||||
List<String>? allowedFileExtensions,
|
||||
enums.Compression? compression,
|
||||
bool? encryption,
|
||||
bool? antivirus}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
'fileSecurity': fileSecurity,
|
||||
'enabled': enabled,
|
||||
'maximumFileSize': maximumFileSize,
|
||||
'allowedFileExtensions': allowedFileExtensions,
|
||||
'compression': compression?.value,
|
||||
'encryption': encryption,
|
||||
'antivirus': antivirus,
|
||||
};
|
||||
/// Get bucket
|
||||
///
|
||||
/// Get a storage bucket by its unique ID. This endpoint response returns a
|
||||
/// JSON object with the storage bucket metadata.
|
||||
Future<models.Bucket> getBucket({required String bucketId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
return models.Bucket.fromMap(res.data);
|
||||
}
|
||||
};
|
||||
|
||||
/// Delete bucket
|
||||
///
|
||||
/// Delete a storage bucket by its unique ID.
|
||||
Future deleteBucket({required String bucketId}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
return models.Bucket.fromMap(res.data);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
/// Update bucket
|
||||
///
|
||||
/// Update a storage bucket by its unique ID.
|
||||
Future<models.Bucket> updateBucket({required String bucketId, required String name, List<String>? permissions, bool? fileSecurity, bool? enabled, int? maximumFileSize, List<String>? allowedFileExtensions, enums.Compression? compression, bool? encryption, bool? antivirus}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
'fileSecurity': fileSecurity,
|
||||
'enabled': enabled,
|
||||
'maximumFileSize': maximumFileSize,
|
||||
'allowedFileExtensions': allowedFileExtensions,
|
||||
'compression': compression?.value,
|
||||
'encryption': encryption,
|
||||
'antivirus': antivirus,
|
||||
|
||||
/// List files
|
||||
///
|
||||
/// Get a list of all the user files. You can use the query params to filter
|
||||
/// your results.
|
||||
Future<models.FileList> listFiles(
|
||||
{required String bucketId, List<String>? queries, String? search}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.FileList.fromMap(res.data);
|
||||
}
|
||||
return models.Bucket.fromMap(res.data);
|
||||
|
||||
/// Create file
|
||||
///
|
||||
/// Create a new file. Before using this route, you should create a new bucket
|
||||
/// resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
|
||||
/// API or directly from your Appwrite console.
|
||||
///
|
||||
/// Larger files should be uploaded using multiple requests with the
|
||||
/// [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
|
||||
/// header to send a partial request with a maximum supported chunk of `5MB`.
|
||||
/// The `content-range` header values should always be in bytes.
|
||||
///
|
||||
/// When the first request is sent, the server will return the **File** object,
|
||||
/// and the subsequent part request must include the file's **id** in
|
||||
/// `x-appwrite-id` header to allow the server to know that the partial upload
|
||||
/// is for the existing file and not for a new one.
|
||||
///
|
||||
/// If you're creating a new file using one of the Appwrite SDKs, all the
|
||||
/// chunking logic will be managed by the SDK internally.
|
||||
///
|
||||
Future<models.File> createFile(
|
||||
{required String bucketId,
|
||||
required String fileId,
|
||||
required InputFile file,
|
||||
List<String>? permissions,
|
||||
Function(UploadProgress)? onProgress}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'fileId': fileId,
|
||||
'file': file,
|
||||
'permissions': permissions,
|
||||
};
|
||||
/// Delete bucket
|
||||
///
|
||||
/// Delete a storage bucket by its unique ID.
|
||||
Future deleteBucket({required String bucketId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'multipart/form-data',
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
String idParamName = '';
|
||||
idParamName = 'fileId';
|
||||
final paramName = 'file';
|
||||
final res = await client.chunkedUpload(
|
||||
path: apiPath,
|
||||
params: apiParams,
|
||||
paramName: paramName,
|
||||
idParamName: idParamName,
|
||||
headers: apiHeaders,
|
||||
onProgress: onProgress,
|
||||
);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
};
|
||||
|
||||
/// Get file
|
||||
///
|
||||
/// Get a file by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the file metadata.
|
||||
Future<models.File> getFile(
|
||||
{required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
final res = await client.call(HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
return res.data;
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
}
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
/// List files
|
||||
///
|
||||
/// Get a list of all the user files. You can use the query params to filter
|
||||
/// your results.
|
||||
Future<models.FileList> listFiles({required String bucketId, List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
|
||||
/// Update file
|
||||
///
|
||||
/// Update a file by its unique ID. Only users with write permissions have
|
||||
/// access to update this resource.
|
||||
Future<models.File> updateFile(
|
||||
{required String bucketId,
|
||||
required String fileId,
|
||||
String? name,
|
||||
List<String>? permissions}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
|
||||
};
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
return models.FileList.fromMap(res.data);
|
||||
|
||||
/// Delete File
|
||||
///
|
||||
/// Delete a file by its unique ID. Only users with write permissions have
|
||||
/// access to delete this resource.
|
||||
Future deleteFile({required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
/// Create file
|
||||
///
|
||||
/// Create a new file. Before using this route, you should create a new bucket
|
||||
/// resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
|
||||
/// API or directly from your Appwrite console.
|
||||
///
|
||||
/// Larger files should be uploaded using multiple requests with the
|
||||
/// [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
|
||||
/// header to send a partial request with a maximum supported chunk of `5MB`.
|
||||
/// The `content-range` header values should always be in bytes.
|
||||
///
|
||||
/// When the first request is sent, the server will return the **File** object,
|
||||
/// and the subsequent part request must include the file's **id** in
|
||||
/// `x-appwrite-id` header to allow the server to know that the partial upload
|
||||
/// is for the existing file and not for a new one.
|
||||
///
|
||||
/// If you're creating a new file using one of the Appwrite SDKs, all the
|
||||
/// chunking logic will be managed by the SDK internally.
|
||||
///
|
||||
Future<models.File> createFile({required String bucketId, required String fileId, required InputFile file, List<String>? permissions, Function(UploadProgress)? onProgress}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'fileId': fileId,
|
||||
'file': file,
|
||||
'permissions': permissions,
|
||||
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
};
|
||||
|
||||
return res.data;
|
||||
}
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'multipart/form-data',
|
||||
|
||||
/// Get file for download
|
||||
///
|
||||
/// Get a file content by its unique ID. The endpoint response return with a
|
||||
/// 'Content-Disposition: attachment' header that tells the browser to start
|
||||
/// downloading the file to user downloads directory.
|
||||
Future<Uint8List> getFileDownload(
|
||||
{required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
};
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
String idParamName = '';
|
||||
idParamName = 'fileId';
|
||||
final paramName = 'file';
|
||||
final res = await client.chunkedUpload(
|
||||
path: apiPath,
|
||||
params: apiParams,
|
||||
paramName: paramName,
|
||||
idParamName: idParamName,
|
||||
headers: apiHeaders,
|
||||
onProgress: onProgress,
|
||||
);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
return models.File.fromMap(res.data);
|
||||
|
||||
/// Get file preview
|
||||
///
|
||||
/// Get a file preview image. Currently, this method supports preview for image
|
||||
/// files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
/// and spreadsheets, will return the file icon image. You can also pass query
|
||||
/// string arguments for cutting and resizing your preview image. Preview is
|
||||
/// supported only for image files smaller than 10MB.
|
||||
Future<Uint8List> getFilePreview(
|
||||
{required String bucketId,
|
||||
required String fileId,
|
||||
int? width,
|
||||
int? height,
|
||||
enums.ImageGravity? gravity,
|
||||
int? quality,
|
||||
int? borderWidth,
|
||||
String? borderColor,
|
||||
int? borderRadius,
|
||||
double? opacity,
|
||||
int? rotation,
|
||||
String? background,
|
||||
enums.ImageFormat? output}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'gravity': gravity?.value,
|
||||
'quality': quality,
|
||||
'borderWidth': borderWidth,
|
||||
'borderColor': borderColor,
|
||||
'borderRadius': borderRadius,
|
||||
'opacity': opacity,
|
||||
'rotation': rotation,
|
||||
'background': background,
|
||||
'output': output?.value,
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
/// Get file
|
||||
///
|
||||
/// Get a file by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the file metadata.
|
||||
Future<models.File> getFile({required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
/// Get file for view
|
||||
///
|
||||
/// Get a file content by its unique ID. This endpoint is similar to the
|
||||
/// download method but returns with no 'Content-Disposition: attachment'
|
||||
/// header.
|
||||
Future<Uint8List> getFileView(
|
||||
{required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Update file
|
||||
///
|
||||
/// Update a file by its unique ID. Only users with write permissions have
|
||||
/// access to update this resource.
|
||||
Future<models.File> updateFile({required String bucketId, required String fileId, String? name, List<String>? permissions}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'name': name,
|
||||
'permissions': permissions,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Delete File
|
||||
///
|
||||
/// Delete a file by its unique ID. Only users with write permissions have
|
||||
/// access to delete this resource.
|
||||
Future deleteFile({required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
|
||||
}
|
||||
|
||||
/// Get file for download
|
||||
///
|
||||
/// Get a file content by its unique ID. The endpoint response return with a
|
||||
/// 'Content-Disposition: attachment' header that tells the browser to start
|
||||
/// downloading the file to user downloads directory.
|
||||
Future<Uint8List> getFileDownload({required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get file preview
|
||||
///
|
||||
/// Get a file preview image. Currently, this method supports preview for image
|
||||
/// files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
||||
/// and spreadsheets, will return the file icon image. You can also pass query
|
||||
/// string arguments for cutting and resizing your preview image. Preview is
|
||||
/// supported only for image files smaller than 10MB.
|
||||
Future<Uint8List> getFilePreview({required String bucketId, required String fileId, int? width, int? height, enums.ImageGravity? gravity, int? quality, int? borderWidth, String? borderColor, int? borderRadius, double? opacity, int? rotation, String? background, enums.ImageFormat? output}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
'width': width,
|
||||
'height': height,
|
||||
'gravity': gravity?.value,
|
||||
'quality': quality,
|
||||
'borderWidth': borderWidth,
|
||||
'borderColor': borderColor,
|
||||
'borderRadius': borderRadius,
|
||||
'opacity': opacity,
|
||||
'rotation': rotation,
|
||||
'background': background,
|
||||
'output': output?.value,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Get file for view
|
||||
///
|
||||
/// Get a file content by its unique ID. This endpoint is similar to the
|
||||
/// download method but returns with no 'Content-Disposition: attachment'
|
||||
/// header.
|
||||
Future<Uint8List> getFileView({required String bucketId, required String fileId}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
'session': client.config['session'],
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: params, responseType: ResponseType.bytes);
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
+347
-337
@@ -3,340 +3,350 @@ part of '../dart_appwrite.dart';
|
||||
/// The Teams service allows you to group users of your project and to enable
|
||||
/// them to share read and write access to your project resources
|
||||
class Teams extends Service {
|
||||
Teams(super.client);
|
||||
|
||||
/// List teams
|
||||
///
|
||||
/// Get a list of all the teams in which the current user is a member. You can
|
||||
/// use the parameters to filter your results.
|
||||
Future<models.TeamList> list({List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TeamList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create team
|
||||
///
|
||||
/// Create a new team. The user who creates the team will automatically be
|
||||
/// assigned as the owner of the team. Only the users with the owner role can
|
||||
/// invite new members, add new owners and delete or update the team.
|
||||
Future<models.Team> create(
|
||||
{required String teamId,
|
||||
required String name,
|
||||
List<String>? roles}) async {
|
||||
final String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'teamId': teamId,
|
||||
'name': name,
|
||||
'roles': roles,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get team
|
||||
///
|
||||
/// Get a team by its ID. All team members have read access for this resource.
|
||||
Future<models.Team> get({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update name
|
||||
///
|
||||
/// Update the team's name by its unique ID.
|
||||
Future<models.Team> updateName(
|
||||
{required String teamId, required String name}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'name': name,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete team
|
||||
///
|
||||
/// Delete a team using its ID. Only team members with the owner role can
|
||||
/// delete the team.
|
||||
Future delete({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// List team memberships
|
||||
///
|
||||
/// Use this endpoint to list a team's members using the team's ID. All team
|
||||
/// members have read access to this endpoint.
|
||||
Future<models.MembershipList> listMemberships(
|
||||
{required String teamId, List<String>? queries, String? search}) async {
|
||||
final String apiPath =
|
||||
'/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.MembershipList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create team membership
|
||||
///
|
||||
/// Invite a new member to join your team. Provide an ID for existing users, or
|
||||
/// invite unregistered users using an email or phone number. If initiated from
|
||||
/// a Client SDK, Appwrite will send an email or sms with a link to join the
|
||||
/// team to the invited user, and an account will be created for them if one
|
||||
/// doesn't exist. If initiated from a Server SDK, the new member will be added
|
||||
/// automatically to the team.
|
||||
///
|
||||
/// You only need to provide one of a user ID, email, or phone number. Appwrite
|
||||
/// will prioritize accepting the user ID > email > phone number if you provide
|
||||
/// more than one of these parameters.
|
||||
///
|
||||
/// Use the `url` parameter to redirect the user from the invitation email to
|
||||
/// your app. After the user is redirected, use the [Update Team Membership
|
||||
/// Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
||||
/// endpoint to allow the user to accept the invitation to the team.
|
||||
///
|
||||
/// Please note that to avoid a [Redirect
|
||||
/// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// Appwrite will accept the only redirect URLs under the domains you have
|
||||
/// added as a platform on the Appwrite Console.
|
||||
///
|
||||
Future<models.Membership> createMembership(
|
||||
{required String teamId,
|
||||
required List<String> roles,
|
||||
String? email,
|
||||
String? userId,
|
||||
String? phone,
|
||||
String? url,
|
||||
String? name}) async {
|
||||
final String apiPath =
|
||||
'/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'email': email,
|
||||
'userId': userId,
|
||||
'phone': phone,
|
||||
'roles': roles,
|
||||
'url': url,
|
||||
'name': name,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get team membership
|
||||
///
|
||||
/// Get a team member by the membership unique id. All team members have read
|
||||
/// access for this resource.
|
||||
Future<models.Membership> getMembership(
|
||||
{required String teamId, required String membershipId}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'
|
||||
.replaceAll('{teamId}', teamId)
|
||||
.replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update membership
|
||||
///
|
||||
/// Modify the roles of a team member. Only team members with the owner role
|
||||
/// have access to this endpoint. Learn more about [roles and
|
||||
/// permissions](https://appwrite.io/docs/permissions).
|
||||
///
|
||||
Future<models.Membership> updateMembership(
|
||||
{required String teamId,
|
||||
required String membershipId,
|
||||
required List<String> roles}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'
|
||||
.replaceAll('{teamId}', teamId)
|
||||
.replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'roles': roles,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete team membership
|
||||
///
|
||||
/// This endpoint allows a user to leave a team or for a team owner to delete
|
||||
/// the membership of any other team member. You can also use this endpoint to
|
||||
/// delete a user membership even if it is not accepted.
|
||||
Future deleteMembership(
|
||||
{required String teamId, required String membershipId}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'
|
||||
.replaceAll('{teamId}', teamId)
|
||||
.replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Update team membership status
|
||||
///
|
||||
/// Use this endpoint to allow a user to accept an invitation to join a team
|
||||
/// after being redirected back to your app from the invitation email received
|
||||
/// by the user.
|
||||
///
|
||||
/// If the request is successful, a session for the user is automatically
|
||||
/// created.
|
||||
///
|
||||
Future<models.Membership> updateMembershipStatus(
|
||||
{required String teamId,
|
||||
required String membershipId,
|
||||
required String userId,
|
||||
required String secret}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}/status'
|
||||
.replaceAll('{teamId}', teamId)
|
||||
.replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'userId': userId,
|
||||
'secret': secret,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get team preferences
|
||||
///
|
||||
/// Get the team's shared preferences by its unique ID. If a preference doesn't
|
||||
/// need to be shared by all team members, prefer storing them in [user
|
||||
/// preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
Future<models.Preferences> getPrefs({required String teamId}) async {
|
||||
final String apiPath =
|
||||
'/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update preferences
|
||||
///
|
||||
/// Update the team's preferences by its unique ID. The object you pass is
|
||||
/// stored as is and replaces any previous value. The maximum allowed prefs
|
||||
/// size is 64kB and throws an error if exceeded.
|
||||
Future<models.Preferences> updatePrefs(
|
||||
{required String teamId, required Map prefs}) async {
|
||||
final String apiPath =
|
||||
'/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'prefs': prefs,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
Teams(super.client);
|
||||
|
||||
/// List teams
|
||||
///
|
||||
/// Get a list of all the teams in which the current user is a member. You can
|
||||
/// use the parameters to filter your results.
|
||||
Future<models.TeamList> list({List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TeamList.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Create team
|
||||
///
|
||||
/// Create a new team. The user who creates the team will automatically be
|
||||
/// assigned as the owner of the team. Only the users with the owner role can
|
||||
/// invite new members, add new owners and delete or update the team.
|
||||
Future<models.Team> create({required String teamId, required String name, List<String>? roles}) async {
|
||||
final String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'teamId': teamId,
|
||||
'name': name,
|
||||
'roles': roles,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get team
|
||||
///
|
||||
/// Get a team by its ID. All team members have read access for this resource.
|
||||
Future<models.Team> get({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Update name
|
||||
///
|
||||
/// Update the team's name by its unique ID.
|
||||
Future<models.Team> updateName({required String teamId, required String name}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'name': name,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Delete team
|
||||
///
|
||||
/// Delete a team using its ID. Only team members with the owner role can
|
||||
/// delete the team.
|
||||
Future delete({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
|
||||
}
|
||||
|
||||
/// List team memberships
|
||||
///
|
||||
/// Use this endpoint to list a team's members using the team's ID. All team
|
||||
/// members have read access to this endpoint.
|
||||
Future<models.MembershipList> listMemberships({required String teamId, List<String>? queries, String? search}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'queries': queries,
|
||||
'search': search,
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.MembershipList.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Create team membership
|
||||
///
|
||||
/// Invite a new member to join your team. Provide an ID for existing users, or
|
||||
/// invite unregistered users using an email or phone number. If initiated from
|
||||
/// a Client SDK, Appwrite will send an email or sms with a link to join the
|
||||
/// team to the invited user, and an account will be created for them if one
|
||||
/// doesn't exist. If initiated from a Server SDK, the new member will be added
|
||||
/// automatically to the team.
|
||||
///
|
||||
/// You only need to provide one of a user ID, email, or phone number. Appwrite
|
||||
/// will prioritize accepting the user ID > email > phone number if you provide
|
||||
/// more than one of these parameters.
|
||||
///
|
||||
/// Use the `url` parameter to redirect the user from the invitation email to
|
||||
/// your app. After the user is redirected, use the [Update Team Membership
|
||||
/// Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
||||
/// endpoint to allow the user to accept the invitation to the team.
|
||||
///
|
||||
/// Please note that to avoid a [Redirect
|
||||
/// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
||||
/// Appwrite will accept the only redirect URLs under the domains you have
|
||||
/// added as a platform on the Appwrite Console.
|
||||
///
|
||||
Future<models.Membership> createMembership({required String teamId, required List<String> roles, String? email, String? userId, String? phone, String? url, String? name}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'email': email,
|
||||
'userId': userId,
|
||||
'phone': phone,
|
||||
'roles': roles,
|
||||
'url': url,
|
||||
'name': name,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get team membership
|
||||
///
|
||||
/// Get a team member by the membership unique id. All team members have read
|
||||
/// access for this resource.
|
||||
Future<models.Membership> getMembership({required String teamId, required String membershipId}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Update membership
|
||||
///
|
||||
/// Modify the roles of a team member. Only team members with the owner role
|
||||
/// have access to this endpoint. Learn more about [roles and
|
||||
/// permissions](https://appwrite.io/docs/permissions).
|
||||
///
|
||||
Future<models.Membership> updateMembership({required String teamId, required String membershipId, required List<String> roles}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'roles': roles,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Delete team membership
|
||||
///
|
||||
/// This endpoint allows a user to leave a team or for a team owner to delete
|
||||
/// the membership of any other team member. You can also use this endpoint to
|
||||
/// delete a user membership even if it is not accepted.
|
||||
Future deleteMembership({required String teamId, required String membershipId}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
|
||||
}
|
||||
|
||||
/// Update team membership status
|
||||
///
|
||||
/// Use this endpoint to allow a user to accept an invitation to join a team
|
||||
/// after being redirected back to your app from the invitation email received
|
||||
/// by the user.
|
||||
///
|
||||
/// If the request is successful, a session for the user is automatically
|
||||
/// created.
|
||||
///
|
||||
Future<models.Membership> updateMembershipStatus({required String teamId, required String membershipId, required String userId, required String secret}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'userId': userId,
|
||||
'secret': secret,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Get team preferences
|
||||
///
|
||||
/// Get the team's shared preferences by its unique ID. If a preference doesn't
|
||||
/// need to be shared by all team members, prefer storing them in [user
|
||||
/// preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
||||
Future<models.Preferences> getPrefs({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
|
||||
}
|
||||
|
||||
/// Update preferences
|
||||
///
|
||||
/// Update the team's preferences by its unique ID. The object you pass is
|
||||
/// stored as is and replaces any previous value. The maximum allowed prefs
|
||||
/// size is 64kB and throws an error if exceeded.
|
||||
Future<models.Preferences> updatePrefs({required String teamId, required Map prefs}) async {
|
||||
final String apiPath = '/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
|
||||
'prefs': prefs,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
|
||||
}
|
||||
}
|
||||
+1052
-1020
File diff suppressed because it is too large
Load Diff
+3
-4
@@ -8,7 +8,7 @@ import 'upload_progress.dart';
|
||||
/// [Client] that handles requests to Appwrite
|
||||
abstract class Client {
|
||||
/// The size for cunked uploads in bytes.
|
||||
static const int CHUNK_SIZE = 5 * 1024 * 1024;
|
||||
static const int CHUNK_SIZE = 5*1024*1024;
|
||||
|
||||
/// Holds configuration such as project.
|
||||
late Map<String, String> config;
|
||||
@@ -27,7 +27,7 @@ abstract class Client {
|
||||
Future<String?> webAuth(Uri url);
|
||||
|
||||
/// Set self signed to [status].
|
||||
///
|
||||
///
|
||||
/// If self signed is true, [Client] will ignore invalid certificates.
|
||||
/// This is helpful in environments where your Appwrite
|
||||
/// instance does not have a valid SSL certificate.
|
||||
@@ -78,8 +78,7 @@ abstract class Client {
|
||||
});
|
||||
|
||||
/// Send the API request.
|
||||
Future<Response> call(
|
||||
HttpMethod method, {
|
||||
Future<Response> call(HttpMethod method, {
|
||||
String path = '',
|
||||
Map<String, String> headers = const {},
|
||||
Map<String, dynamic> params = const {},
|
||||
|
||||
@@ -2,25 +2,21 @@ import 'response.dart';
|
||||
import 'client.dart';
|
||||
import 'enums.dart';
|
||||
|
||||
abstract class ClientBase implements Client {
|
||||
abstract class ClientBase implements Client {
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientBase setProject(value);
|
||||
|
||||
/// Your secret API key
|
||||
@override
|
||||
ClientBase setKey(value);
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientBase setJWT(value);
|
||||
@override
|
||||
ClientBase setLocale(value);
|
||||
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientBase setSession(value);
|
||||
|
||||
/// The user agent string of the client that made the request
|
||||
@override
|
||||
ClientBase setForwardedUserAgent(value);
|
||||
|
||||
+46
-52
@@ -16,7 +16,7 @@ ClientBase createClient({
|
||||
ClientBrowser(endPoint: endPoint, selfSigned: selfSigned);
|
||||
|
||||
class ClientBrowser extends ClientBase with ClientMixin {
|
||||
static const int CHUNK_SIZE = 5 * 1024 * 1024;
|
||||
static const int CHUNK_SIZE = 5*1024*1024;
|
||||
String _endPoint;
|
||||
Map<String, String>? _headers;
|
||||
@override
|
||||
@@ -34,7 +34,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
'x-sdk-platform': 'server',
|
||||
'x-sdk-language': 'dart',
|
||||
'x-sdk-version': '12.0.0',
|
||||
'X-Appwrite-Response-Format': '1.6.0',
|
||||
'X-Appwrite-Response-Format' : '1.6.0',
|
||||
};
|
||||
|
||||
config = {};
|
||||
@@ -46,52 +46,47 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
@override
|
||||
String get endPoint => _endPoint;
|
||||
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientBrowser setProject(value) {
|
||||
config['project'] = value;
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret API key
|
||||
@override
|
||||
ClientBrowser setKey(value) {
|
||||
config['key'] = value;
|
||||
addHeader('X-Appwrite-Key', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientBrowser setJWT(value) {
|
||||
config['jWT'] = value;
|
||||
addHeader('X-Appwrite-JWT', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientBrowser setLocale(value) {
|
||||
config['locale'] = value;
|
||||
addHeader('X-Appwrite-Locale', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientBrowser setSession(value) {
|
||||
config['session'] = value;
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// The user agent string of the client that made the request
|
||||
@override
|
||||
ClientBrowser setForwardedUserAgent(value) {
|
||||
config['forwardedUserAgent'] = value;
|
||||
addHeader('X-Forwarded-User-Agent', value);
|
||||
return this;
|
||||
}
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientBrowser setProject(value) {
|
||||
config['project'] = value;
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
/// Your secret API key
|
||||
@override
|
||||
ClientBrowser setKey(value) {
|
||||
config['key'] = value;
|
||||
addHeader('X-Appwrite-Key', value);
|
||||
return this;
|
||||
}
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientBrowser setJWT(value) {
|
||||
config['jWT'] = value;
|
||||
addHeader('X-Appwrite-JWT', value);
|
||||
return this;
|
||||
}
|
||||
@override
|
||||
ClientBrowser setLocale(value) {
|
||||
config['locale'] = value;
|
||||
addHeader('X-Appwrite-Locale', value);
|
||||
return this;
|
||||
}
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientBrowser setSession(value) {
|
||||
config['session'] = value;
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
/// The user agent string of the client that made the request
|
||||
@override
|
||||
ClientBrowser setForwardedUserAgent(value) {
|
||||
config['forwardedUserAgent'] = value;
|
||||
addHeader('X-Forwarded-User-Agent', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientBrowser setSelfSigned({bool status = true}) {
|
||||
@@ -136,8 +131,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
|
||||
late Response res;
|
||||
if (size <= CHUNK_SIZE) {
|
||||
params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!,
|
||||
filename: file.filename);
|
||||
params[paramName] = http.MultipartFile.fromBytes(paramName, file.bytes!, filename: file.filename);
|
||||
return call(
|
||||
HttpMethod.post,
|
||||
path: path,
|
||||
@@ -164,8 +158,8 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
List<int> chunk = [];
|
||||
final end = min(offset + CHUNK_SIZE, size);
|
||||
chunk = file.bytes!.getRange(offset, end).toList();
|
||||
params[paramName] = http.MultipartFile.fromBytes(paramName, chunk,
|
||||
filename: file.filename);
|
||||
params[paramName] =
|
||||
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
|
||||
headers['content-range'] =
|
||||
'bytes $offset-${min<int>((offset + CHUNK_SIZE - 1), size - 1)}/$size';
|
||||
res = await call(HttpMethod.post,
|
||||
|
||||
+46
-52
@@ -20,7 +20,7 @@ ClientBase createClient({
|
||||
);
|
||||
|
||||
class ClientIO extends ClientBase with ClientMixin {
|
||||
static const int CHUNK_SIZE = 5 * 1024 * 1024;
|
||||
static const int CHUNK_SIZE = 5*1024*1024;
|
||||
String _endPoint;
|
||||
Map<String, String>? _headers;
|
||||
@override
|
||||
@@ -43,9 +43,8 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
'x-sdk-platform': 'server',
|
||||
'x-sdk-language': 'dart',
|
||||
'x-sdk-version': '12.0.0',
|
||||
'user-agent':
|
||||
'AppwriteDartSDK/12.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
|
||||
'X-Appwrite-Response-Format': '1.6.0',
|
||||
'user-agent' : 'AppwriteDartSDK/12.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})',
|
||||
'X-Appwrite-Response-Format' : '1.6.0',
|
||||
};
|
||||
|
||||
config = {};
|
||||
@@ -57,52 +56,47 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
@override
|
||||
String get endPoint => _endPoint;
|
||||
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientIO setProject(value) {
|
||||
config['project'] = value;
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret API key
|
||||
@override
|
||||
ClientIO setKey(value) {
|
||||
config['key'] = value;
|
||||
addHeader('X-Appwrite-Key', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientIO setJWT(value) {
|
||||
config['jWT'] = value;
|
||||
addHeader('X-Appwrite-JWT', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientIO setLocale(value) {
|
||||
config['locale'] = value;
|
||||
addHeader('X-Appwrite-Locale', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientIO setSession(value) {
|
||||
config['session'] = value;
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// The user agent string of the client that made the request
|
||||
@override
|
||||
ClientIO setForwardedUserAgent(value) {
|
||||
config['forwardedUserAgent'] = value;
|
||||
addHeader('X-Forwarded-User-Agent', value);
|
||||
return this;
|
||||
}
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientIO setProject(value) {
|
||||
config['project'] = value;
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
/// Your secret API key
|
||||
@override
|
||||
ClientIO setKey(value) {
|
||||
config['key'] = value;
|
||||
addHeader('X-Appwrite-Key', value);
|
||||
return this;
|
||||
}
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientIO setJWT(value) {
|
||||
config['jWT'] = value;
|
||||
addHeader('X-Appwrite-JWT', value);
|
||||
return this;
|
||||
}
|
||||
@override
|
||||
ClientIO setLocale(value) {
|
||||
config['locale'] = value;
|
||||
addHeader('X-Appwrite-Locale', value);
|
||||
return this;
|
||||
}
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientIO setSession(value) {
|
||||
config['session'] = value;
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
/// The user agent string of the client that made the request
|
||||
@override
|
||||
ClientIO setForwardedUserAgent(value) {
|
||||
config['forwardedUserAgent'] = value;
|
||||
addHeader('X-Forwarded-User-Agent', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
ClientIO setSelfSigned({bool status = true}) {
|
||||
@@ -196,8 +190,8 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
raf!.setPositionSync(offset);
|
||||
chunk = raf.readSync(CHUNK_SIZE);
|
||||
}
|
||||
params[paramName] = http.MultipartFile.fromBytes(paramName, chunk,
|
||||
filename: file.filename);
|
||||
params[paramName] =
|
||||
http.MultipartFile.fromBytes(paramName, chunk, filename: file.filename);
|
||||
headers['content-range'] =
|
||||
'bytes $offset-${min<int>((offset + CHUNK_SIZE - 1), size - 1)}/$size';
|
||||
res = await call(HttpMethod.post,
|
||||
|
||||
+14
-19
@@ -40,7 +40,7 @@ class ClientMixin {
|
||||
}
|
||||
} else if (method == HttpMethod.get) {
|
||||
if (params.isNotEmpty) {
|
||||
params = params.map((key, value) {
|
||||
params = params.map((key, value){
|
||||
if (value is int || value is double) {
|
||||
return MapEntry(key, value.toString());
|
||||
}
|
||||
@@ -106,23 +106,18 @@ class ClientMixin {
|
||||
return Response(data: data);
|
||||
}
|
||||
|
||||
Future<http.Response> toResponse(
|
||||
http.StreamedResponse streamedResponse) async {
|
||||
if (streamedResponse.statusCode == 204) {
|
||||
return http.Response(
|
||||
'',
|
||||
streamedResponse.statusCode,
|
||||
headers: streamedResponse.headers.map((k, v) =>
|
||||
k.toLowerCase() == 'content-type'
|
||||
? MapEntry(k, 'text/plain')
|
||||
: MapEntry(k, v)),
|
||||
request: streamedResponse.request,
|
||||
isRedirect: streamedResponse.isRedirect,
|
||||
persistentConnection: streamedResponse.persistentConnection,
|
||||
reasonPhrase: streamedResponse.reasonPhrase,
|
||||
);
|
||||
} else {
|
||||
return await http.Response.fromStream(streamedResponse);
|
||||
}
|
||||
Future<http.Response> toResponse(http.StreamedResponse streamedResponse) async {
|
||||
if(streamedResponse.statusCode == 204) {
|
||||
return http.Response('',
|
||||
streamedResponse.statusCode,
|
||||
headers: streamedResponse.headers.map((k,v) => k.toLowerCase()=='content-type' ? MapEntry(k, 'text/plain') : MapEntry(k,v)),
|
||||
request: streamedResponse.request,
|
||||
isRedirect: streamedResponse.isRedirect,
|
||||
persistentConnection: streamedResponse.persistentConnection,
|
||||
reasonPhrase: streamedResponse.reasonPhrase,
|
||||
);
|
||||
} else {
|
||||
return await http.Response.fromStream(streamedResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum AuthenticationFactor {
|
||||
email(value: 'email'),
|
||||
phone(value: 'phone'),
|
||||
totp(value: 'totp'),
|
||||
recoverycode(value: 'recoverycode');
|
||||
email(value: 'email'),
|
||||
phone(value: 'phone'),
|
||||
totp(value: 'totp'),
|
||||
recoverycode(value: 'recoverycode');
|
||||
|
||||
const AuthenticationFactor({required this.value});
|
||||
const AuthenticationFactor({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum AuthenticatorType {
|
||||
totp(value: 'totp');
|
||||
totp(value: 'totp');
|
||||
|
||||
const AuthenticatorType({required this.value});
|
||||
const AuthenticatorType({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
+20
-18
@@ -1,24 +1,26 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Browser {
|
||||
avantBrowser(value: 'aa'),
|
||||
androidWebViewBeta(value: 'an'),
|
||||
googleChrome(value: 'ch'),
|
||||
googleChromeIOS(value: 'ci'),
|
||||
googleChromeMobile(value: 'cm'),
|
||||
chromium(value: 'cr'),
|
||||
mozillaFirefox(value: 'ff'),
|
||||
safari(value: 'sf'),
|
||||
mobileSafari(value: 'mf'),
|
||||
microsoftEdge(value: 'ps'),
|
||||
microsoftEdgeIOS(value: 'oi'),
|
||||
operaMini(value: 'om'),
|
||||
opera(value: 'op'),
|
||||
operaNext(value: 'on');
|
||||
avantBrowser(value: 'aa'),
|
||||
androidWebViewBeta(value: 'an'),
|
||||
googleChrome(value: 'ch'),
|
||||
googleChromeIOS(value: 'ci'),
|
||||
googleChromeMobile(value: 'cm'),
|
||||
chromium(value: 'cr'),
|
||||
mozillaFirefox(value: 'ff'),
|
||||
safari(value: 'sf'),
|
||||
mobileSafari(value: 'mf'),
|
||||
microsoftEdge(value: 'ps'),
|
||||
microsoftEdgeIOS(value: 'oi'),
|
||||
operaMini(value: 'om'),
|
||||
opera(value: 'op'),
|
||||
operaNext(value: 'on');
|
||||
|
||||
const Browser({required this.value});
|
||||
const Browser({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Compression {
|
||||
none(value: 'none'),
|
||||
gzip(value: 'gzip'),
|
||||
zstd(value: 'zstd');
|
||||
none(value: 'none'),
|
||||
gzip(value: 'gzip'),
|
||||
zstd(value: 'zstd');
|
||||
|
||||
const Compression({required this.value});
|
||||
const Compression({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,26 +1,28 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum CreditCard {
|
||||
americanExpress(value: 'amex'),
|
||||
argencard(value: 'argencard'),
|
||||
cabal(value: 'cabal'),
|
||||
cencosud(value: 'cencosud'),
|
||||
dinersClub(value: 'diners'),
|
||||
discover(value: 'discover'),
|
||||
elo(value: 'elo'),
|
||||
hipercard(value: 'hipercard'),
|
||||
jCB(value: 'jcb'),
|
||||
mastercard(value: 'mastercard'),
|
||||
naranja(value: 'naranja'),
|
||||
tarjetaShopping(value: 'targeta-shopping'),
|
||||
unionChinaPay(value: 'union-china-pay'),
|
||||
visa(value: 'visa'),
|
||||
mIR(value: 'mir'),
|
||||
maestro(value: 'maestro');
|
||||
americanExpress(value: 'amex'),
|
||||
argencard(value: 'argencard'),
|
||||
cabal(value: 'cabal'),
|
||||
cencosud(value: 'cencosud'),
|
||||
dinersClub(value: 'diners'),
|
||||
discover(value: 'discover'),
|
||||
elo(value: 'elo'),
|
||||
hipercard(value: 'hipercard'),
|
||||
jCB(value: 'jcb'),
|
||||
mastercard(value: 'mastercard'),
|
||||
naranja(value: 'naranja'),
|
||||
tarjetaShopping(value: 'targeta-shopping'),
|
||||
unionChinaPay(value: 'union-china-pay'),
|
||||
visa(value: 'visa'),
|
||||
mIR(value: 'mir'),
|
||||
maestro(value: 'maestro');
|
||||
|
||||
const CreditCard({required this.value});
|
||||
const CreditCard({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ExecutionMethod {
|
||||
gET(value: 'GET'),
|
||||
pOST(value: 'POST'),
|
||||
pUT(value: 'PUT'),
|
||||
pATCH(value: 'PATCH'),
|
||||
dELETE(value: 'DELETE'),
|
||||
oPTIONS(value: 'OPTIONS');
|
||||
gET(value: 'GET'),
|
||||
pOST(value: 'POST'),
|
||||
pUT(value: 'PUT'),
|
||||
pATCH(value: 'PATCH'),
|
||||
dELETE(value: 'DELETE'),
|
||||
oPTIONS(value: 'OPTIONS');
|
||||
|
||||
const ExecutionMethod({required this.value});
|
||||
const ExecutionMethod({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
+201
-199
@@ -1,205 +1,207 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Flag {
|
||||
afghanistan(value: 'af'),
|
||||
angola(value: 'ao'),
|
||||
albania(value: 'al'),
|
||||
andorra(value: 'ad'),
|
||||
unitedArabEmirates(value: 'ae'),
|
||||
argentina(value: 'ar'),
|
||||
armenia(value: 'am'),
|
||||
antiguaAndBarbuda(value: 'ag'),
|
||||
australia(value: 'au'),
|
||||
austria(value: 'at'),
|
||||
azerbaijan(value: 'az'),
|
||||
burundi(value: 'bi'),
|
||||
belgium(value: 'be'),
|
||||
benin(value: 'bj'),
|
||||
burkinaFaso(value: 'bf'),
|
||||
bangladesh(value: 'bd'),
|
||||
bulgaria(value: 'bg'),
|
||||
bahrain(value: 'bh'),
|
||||
bahamas(value: 'bs'),
|
||||
bosniaAndHerzegovina(value: 'ba'),
|
||||
belarus(value: 'by'),
|
||||
belize(value: 'bz'),
|
||||
bolivia(value: 'bo'),
|
||||
brazil(value: 'br'),
|
||||
barbados(value: 'bb'),
|
||||
bruneiDarussalam(value: 'bn'),
|
||||
bhutan(value: 'bt'),
|
||||
botswana(value: 'bw'),
|
||||
centralAfricanRepublic(value: 'cf'),
|
||||
canada(value: 'ca'),
|
||||
switzerland(value: 'ch'),
|
||||
chile(value: 'cl'),
|
||||
china(value: 'cn'),
|
||||
coteDIvoire(value: 'ci'),
|
||||
cameroon(value: 'cm'),
|
||||
democraticRepublicOfTheCongo(value: 'cd'),
|
||||
republicOfTheCongo(value: 'cg'),
|
||||
colombia(value: 'co'),
|
||||
comoros(value: 'km'),
|
||||
capeVerde(value: 'cv'),
|
||||
costaRica(value: 'cr'),
|
||||
cuba(value: 'cu'),
|
||||
cyprus(value: 'cy'),
|
||||
czechRepublic(value: 'cz'),
|
||||
germany(value: 'de'),
|
||||
djibouti(value: 'dj'),
|
||||
dominica(value: 'dm'),
|
||||
denmark(value: 'dk'),
|
||||
dominicanRepublic(value: 'do'),
|
||||
algeria(value: 'dz'),
|
||||
ecuador(value: 'ec'),
|
||||
egypt(value: 'eg'),
|
||||
eritrea(value: 'er'),
|
||||
spain(value: 'es'),
|
||||
estonia(value: 'ee'),
|
||||
ethiopia(value: 'et'),
|
||||
finland(value: 'fi'),
|
||||
fiji(value: 'fj'),
|
||||
france(value: 'fr'),
|
||||
micronesiaFederatedStatesOf(value: 'fm'),
|
||||
gabon(value: 'ga'),
|
||||
unitedKingdom(value: 'gb'),
|
||||
georgia(value: 'ge'),
|
||||
ghana(value: 'gh'),
|
||||
guinea(value: 'gn'),
|
||||
gambia(value: 'gm'),
|
||||
guineaBissau(value: 'gw'),
|
||||
equatorialGuinea(value: 'gq'),
|
||||
greece(value: 'gr'),
|
||||
grenada(value: 'gd'),
|
||||
guatemala(value: 'gt'),
|
||||
guyana(value: 'gy'),
|
||||
honduras(value: 'hn'),
|
||||
croatia(value: 'hr'),
|
||||
haiti(value: 'ht'),
|
||||
hungary(value: 'hu'),
|
||||
indonesia(value: 'id'),
|
||||
india(value: 'in'),
|
||||
ireland(value: 'ie'),
|
||||
iranIslamicRepublicOf(value: 'ir'),
|
||||
iraq(value: 'iq'),
|
||||
iceland(value: 'is'),
|
||||
israel(value: 'il'),
|
||||
italy(value: 'it'),
|
||||
jamaica(value: 'jm'),
|
||||
jordan(value: 'jo'),
|
||||
japan(value: 'jp'),
|
||||
kazakhstan(value: 'kz'),
|
||||
kenya(value: 'ke'),
|
||||
kyrgyzstan(value: 'kg'),
|
||||
cambodia(value: 'kh'),
|
||||
kiribati(value: 'ki'),
|
||||
saintKittsAndNevis(value: 'kn'),
|
||||
southKorea(value: 'kr'),
|
||||
kuwait(value: 'kw'),
|
||||
laoPeopleSDemocraticRepublic(value: 'la'),
|
||||
lebanon(value: 'lb'),
|
||||
liberia(value: 'lr'),
|
||||
libya(value: 'ly'),
|
||||
saintLucia(value: 'lc'),
|
||||
liechtenstein(value: 'li'),
|
||||
sriLanka(value: 'lk'),
|
||||
lesotho(value: 'ls'),
|
||||
lithuania(value: 'lt'),
|
||||
luxembourg(value: 'lu'),
|
||||
latvia(value: 'lv'),
|
||||
morocco(value: 'ma'),
|
||||
monaco(value: 'mc'),
|
||||
moldova(value: 'md'),
|
||||
madagascar(value: 'mg'),
|
||||
maldives(value: 'mv'),
|
||||
mexico(value: 'mx'),
|
||||
marshallIslands(value: 'mh'),
|
||||
northMacedonia(value: 'mk'),
|
||||
mali(value: 'ml'),
|
||||
malta(value: 'mt'),
|
||||
myanmar(value: 'mm'),
|
||||
montenegro(value: 'me'),
|
||||
mongolia(value: 'mn'),
|
||||
mozambique(value: 'mz'),
|
||||
mauritania(value: 'mr'),
|
||||
mauritius(value: 'mu'),
|
||||
malawi(value: 'mw'),
|
||||
malaysia(value: 'my'),
|
||||
namibia(value: 'na'),
|
||||
niger(value: 'ne'),
|
||||
nigeria(value: 'ng'),
|
||||
nicaragua(value: 'ni'),
|
||||
netherlands(value: 'nl'),
|
||||
norway(value: 'no'),
|
||||
nepal(value: 'np'),
|
||||
nauru(value: 'nr'),
|
||||
newZealand(value: 'nz'),
|
||||
oman(value: 'om'),
|
||||
pakistan(value: 'pk'),
|
||||
panama(value: 'pa'),
|
||||
peru(value: 'pe'),
|
||||
philippines(value: 'ph'),
|
||||
palau(value: 'pw'),
|
||||
papuaNewGuinea(value: 'pg'),
|
||||
poland(value: 'pl'),
|
||||
frenchPolynesia(value: 'pf'),
|
||||
northKorea(value: 'kp'),
|
||||
portugal(value: 'pt'),
|
||||
paraguay(value: 'py'),
|
||||
qatar(value: 'qa'),
|
||||
romania(value: 'ro'),
|
||||
russia(value: 'ru'),
|
||||
rwanda(value: 'rw'),
|
||||
saudiArabia(value: 'sa'),
|
||||
sudan(value: 'sd'),
|
||||
senegal(value: 'sn'),
|
||||
singapore(value: 'sg'),
|
||||
solomonIslands(value: 'sb'),
|
||||
sierraLeone(value: 'sl'),
|
||||
elSalvador(value: 'sv'),
|
||||
sanMarino(value: 'sm'),
|
||||
somalia(value: 'so'),
|
||||
serbia(value: 'rs'),
|
||||
southSudan(value: 'ss'),
|
||||
saoTomeAndPrincipe(value: 'st'),
|
||||
suriname(value: 'sr'),
|
||||
slovakia(value: 'sk'),
|
||||
slovenia(value: 'si'),
|
||||
sweden(value: 'se'),
|
||||
eswatini(value: 'sz'),
|
||||
seychelles(value: 'sc'),
|
||||
syria(value: 'sy'),
|
||||
chad(value: 'td'),
|
||||
togo(value: 'tg'),
|
||||
thailand(value: 'th'),
|
||||
tajikistan(value: 'tj'),
|
||||
turkmenistan(value: 'tm'),
|
||||
timorLeste(value: 'tl'),
|
||||
tonga(value: 'to'),
|
||||
trinidadAndTobago(value: 'tt'),
|
||||
tunisia(value: 'tn'),
|
||||
turkey(value: 'tr'),
|
||||
tuvalu(value: 'tv'),
|
||||
tanzania(value: 'tz'),
|
||||
uganda(value: 'ug'),
|
||||
ukraine(value: 'ua'),
|
||||
uruguay(value: 'uy'),
|
||||
unitedStates(value: 'us'),
|
||||
uzbekistan(value: 'uz'),
|
||||
vaticanCity(value: 'va'),
|
||||
saintVincentAndTheGrenadines(value: 'vc'),
|
||||
venezuela(value: 've'),
|
||||
vietnam(value: 'vn'),
|
||||
vanuatu(value: 'vu'),
|
||||
samoa(value: 'ws'),
|
||||
yemen(value: 'ye'),
|
||||
southAfrica(value: 'za'),
|
||||
zambia(value: 'zm'),
|
||||
zimbabwe(value: 'zw');
|
||||
afghanistan(value: 'af'),
|
||||
angola(value: 'ao'),
|
||||
albania(value: 'al'),
|
||||
andorra(value: 'ad'),
|
||||
unitedArabEmirates(value: 'ae'),
|
||||
argentina(value: 'ar'),
|
||||
armenia(value: 'am'),
|
||||
antiguaAndBarbuda(value: 'ag'),
|
||||
australia(value: 'au'),
|
||||
austria(value: 'at'),
|
||||
azerbaijan(value: 'az'),
|
||||
burundi(value: 'bi'),
|
||||
belgium(value: 'be'),
|
||||
benin(value: 'bj'),
|
||||
burkinaFaso(value: 'bf'),
|
||||
bangladesh(value: 'bd'),
|
||||
bulgaria(value: 'bg'),
|
||||
bahrain(value: 'bh'),
|
||||
bahamas(value: 'bs'),
|
||||
bosniaAndHerzegovina(value: 'ba'),
|
||||
belarus(value: 'by'),
|
||||
belize(value: 'bz'),
|
||||
bolivia(value: 'bo'),
|
||||
brazil(value: 'br'),
|
||||
barbados(value: 'bb'),
|
||||
bruneiDarussalam(value: 'bn'),
|
||||
bhutan(value: 'bt'),
|
||||
botswana(value: 'bw'),
|
||||
centralAfricanRepublic(value: 'cf'),
|
||||
canada(value: 'ca'),
|
||||
switzerland(value: 'ch'),
|
||||
chile(value: 'cl'),
|
||||
china(value: 'cn'),
|
||||
coteDIvoire(value: 'ci'),
|
||||
cameroon(value: 'cm'),
|
||||
democraticRepublicOfTheCongo(value: 'cd'),
|
||||
republicOfTheCongo(value: 'cg'),
|
||||
colombia(value: 'co'),
|
||||
comoros(value: 'km'),
|
||||
capeVerde(value: 'cv'),
|
||||
costaRica(value: 'cr'),
|
||||
cuba(value: 'cu'),
|
||||
cyprus(value: 'cy'),
|
||||
czechRepublic(value: 'cz'),
|
||||
germany(value: 'de'),
|
||||
djibouti(value: 'dj'),
|
||||
dominica(value: 'dm'),
|
||||
denmark(value: 'dk'),
|
||||
dominicanRepublic(value: 'do'),
|
||||
algeria(value: 'dz'),
|
||||
ecuador(value: 'ec'),
|
||||
egypt(value: 'eg'),
|
||||
eritrea(value: 'er'),
|
||||
spain(value: 'es'),
|
||||
estonia(value: 'ee'),
|
||||
ethiopia(value: 'et'),
|
||||
finland(value: 'fi'),
|
||||
fiji(value: 'fj'),
|
||||
france(value: 'fr'),
|
||||
micronesiaFederatedStatesOf(value: 'fm'),
|
||||
gabon(value: 'ga'),
|
||||
unitedKingdom(value: 'gb'),
|
||||
georgia(value: 'ge'),
|
||||
ghana(value: 'gh'),
|
||||
guinea(value: 'gn'),
|
||||
gambia(value: 'gm'),
|
||||
guineaBissau(value: 'gw'),
|
||||
equatorialGuinea(value: 'gq'),
|
||||
greece(value: 'gr'),
|
||||
grenada(value: 'gd'),
|
||||
guatemala(value: 'gt'),
|
||||
guyana(value: 'gy'),
|
||||
honduras(value: 'hn'),
|
||||
croatia(value: 'hr'),
|
||||
haiti(value: 'ht'),
|
||||
hungary(value: 'hu'),
|
||||
indonesia(value: 'id'),
|
||||
india(value: 'in'),
|
||||
ireland(value: 'ie'),
|
||||
iranIslamicRepublicOf(value: 'ir'),
|
||||
iraq(value: 'iq'),
|
||||
iceland(value: 'is'),
|
||||
israel(value: 'il'),
|
||||
italy(value: 'it'),
|
||||
jamaica(value: 'jm'),
|
||||
jordan(value: 'jo'),
|
||||
japan(value: 'jp'),
|
||||
kazakhstan(value: 'kz'),
|
||||
kenya(value: 'ke'),
|
||||
kyrgyzstan(value: 'kg'),
|
||||
cambodia(value: 'kh'),
|
||||
kiribati(value: 'ki'),
|
||||
saintKittsAndNevis(value: 'kn'),
|
||||
southKorea(value: 'kr'),
|
||||
kuwait(value: 'kw'),
|
||||
laoPeopleSDemocraticRepublic(value: 'la'),
|
||||
lebanon(value: 'lb'),
|
||||
liberia(value: 'lr'),
|
||||
libya(value: 'ly'),
|
||||
saintLucia(value: 'lc'),
|
||||
liechtenstein(value: 'li'),
|
||||
sriLanka(value: 'lk'),
|
||||
lesotho(value: 'ls'),
|
||||
lithuania(value: 'lt'),
|
||||
luxembourg(value: 'lu'),
|
||||
latvia(value: 'lv'),
|
||||
morocco(value: 'ma'),
|
||||
monaco(value: 'mc'),
|
||||
moldova(value: 'md'),
|
||||
madagascar(value: 'mg'),
|
||||
maldives(value: 'mv'),
|
||||
mexico(value: 'mx'),
|
||||
marshallIslands(value: 'mh'),
|
||||
northMacedonia(value: 'mk'),
|
||||
mali(value: 'ml'),
|
||||
malta(value: 'mt'),
|
||||
myanmar(value: 'mm'),
|
||||
montenegro(value: 'me'),
|
||||
mongolia(value: 'mn'),
|
||||
mozambique(value: 'mz'),
|
||||
mauritania(value: 'mr'),
|
||||
mauritius(value: 'mu'),
|
||||
malawi(value: 'mw'),
|
||||
malaysia(value: 'my'),
|
||||
namibia(value: 'na'),
|
||||
niger(value: 'ne'),
|
||||
nigeria(value: 'ng'),
|
||||
nicaragua(value: 'ni'),
|
||||
netherlands(value: 'nl'),
|
||||
norway(value: 'no'),
|
||||
nepal(value: 'np'),
|
||||
nauru(value: 'nr'),
|
||||
newZealand(value: 'nz'),
|
||||
oman(value: 'om'),
|
||||
pakistan(value: 'pk'),
|
||||
panama(value: 'pa'),
|
||||
peru(value: 'pe'),
|
||||
philippines(value: 'ph'),
|
||||
palau(value: 'pw'),
|
||||
papuaNewGuinea(value: 'pg'),
|
||||
poland(value: 'pl'),
|
||||
frenchPolynesia(value: 'pf'),
|
||||
northKorea(value: 'kp'),
|
||||
portugal(value: 'pt'),
|
||||
paraguay(value: 'py'),
|
||||
qatar(value: 'qa'),
|
||||
romania(value: 'ro'),
|
||||
russia(value: 'ru'),
|
||||
rwanda(value: 'rw'),
|
||||
saudiArabia(value: 'sa'),
|
||||
sudan(value: 'sd'),
|
||||
senegal(value: 'sn'),
|
||||
singapore(value: 'sg'),
|
||||
solomonIslands(value: 'sb'),
|
||||
sierraLeone(value: 'sl'),
|
||||
elSalvador(value: 'sv'),
|
||||
sanMarino(value: 'sm'),
|
||||
somalia(value: 'so'),
|
||||
serbia(value: 'rs'),
|
||||
southSudan(value: 'ss'),
|
||||
saoTomeAndPrincipe(value: 'st'),
|
||||
suriname(value: 'sr'),
|
||||
slovakia(value: 'sk'),
|
||||
slovenia(value: 'si'),
|
||||
sweden(value: 'se'),
|
||||
eswatini(value: 'sz'),
|
||||
seychelles(value: 'sc'),
|
||||
syria(value: 'sy'),
|
||||
chad(value: 'td'),
|
||||
togo(value: 'tg'),
|
||||
thailand(value: 'th'),
|
||||
tajikistan(value: 'tj'),
|
||||
turkmenistan(value: 'tm'),
|
||||
timorLeste(value: 'tl'),
|
||||
tonga(value: 'to'),
|
||||
trinidadAndTobago(value: 'tt'),
|
||||
tunisia(value: 'tn'),
|
||||
turkey(value: 'tr'),
|
||||
tuvalu(value: 'tv'),
|
||||
tanzania(value: 'tz'),
|
||||
uganda(value: 'ug'),
|
||||
ukraine(value: 'ua'),
|
||||
uruguay(value: 'uy'),
|
||||
unitedStates(value: 'us'),
|
||||
uzbekistan(value: 'uz'),
|
||||
vaticanCity(value: 'va'),
|
||||
saintVincentAndTheGrenadines(value: 'vc'),
|
||||
venezuela(value: 've'),
|
||||
vietnam(value: 'vn'),
|
||||
vanuatu(value: 'vu'),
|
||||
samoa(value: 'ws'),
|
||||
yemen(value: 'ye'),
|
||||
southAfrica(value: 'za'),
|
||||
zambia(value: 'zm'),
|
||||
zimbabwe(value: 'zw');
|
||||
|
||||
const Flag({required this.value});
|
||||
const Flag({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ImageFormat {
|
||||
jpg(value: 'jpg'),
|
||||
jpeg(value: 'jpeg'),
|
||||
gif(value: 'gif'),
|
||||
png(value: 'png'),
|
||||
webp(value: 'webp');
|
||||
jpg(value: 'jpg'),
|
||||
jpeg(value: 'jpeg'),
|
||||
gif(value: 'gif'),
|
||||
png(value: 'png'),
|
||||
webp(value: 'webp');
|
||||
|
||||
const ImageFormat({required this.value});
|
||||
const ImageFormat({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ImageGravity {
|
||||
center(value: 'center'),
|
||||
topLeft(value: 'top-left'),
|
||||
top(value: 'top'),
|
||||
topRight(value: 'top-right'),
|
||||
left(value: 'left'),
|
||||
right(value: 'right'),
|
||||
bottomLeft(value: 'bottom-left'),
|
||||
bottom(value: 'bottom'),
|
||||
bottomRight(value: 'bottom-right');
|
||||
center(value: 'center'),
|
||||
topLeft(value: 'top-left'),
|
||||
top(value: 'top'),
|
||||
topRight(value: 'top-right'),
|
||||
left(value: 'left'),
|
||||
right(value: 'right'),
|
||||
bottomLeft(value: 'bottom-left'),
|
||||
bottom(value: 'bottom'),
|
||||
bottomRight(value: 'bottom-right');
|
||||
|
||||
const ImageGravity({required this.value});
|
||||
const ImageGravity({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum IndexType {
|
||||
key(value: 'key'),
|
||||
fulltext(value: 'fulltext'),
|
||||
unique(value: 'unique');
|
||||
key(value: 'key'),
|
||||
fulltext(value: 'fulltext'),
|
||||
unique(value: 'unique');
|
||||
|
||||
const IndexType({required this.value});
|
||||
const IndexType({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum MessagingProviderType {
|
||||
email(value: 'email'),
|
||||
sms(value: 'sms'),
|
||||
push(value: 'push');
|
||||
email(value: 'email'),
|
||||
sms(value: 'sms'),
|
||||
push(value: 'push');
|
||||
|
||||
const MessagingProviderType({required this.value});
|
||||
const MessagingProviderType({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
+18
-16
@@ -1,22 +1,24 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Name {
|
||||
v1Database(value: 'v1-database'),
|
||||
v1Deletes(value: 'v1-deletes'),
|
||||
v1Audits(value: 'v1-audits'),
|
||||
v1Mails(value: 'v1-mails'),
|
||||
v1Functions(value: 'v1-functions'),
|
||||
v1Usage(value: 'v1-usage'),
|
||||
v1UsageDump(value: 'v1-usage-dump'),
|
||||
v1Webhooks(value: 'v1-webhooks'),
|
||||
v1Certificates(value: 'v1-certificates'),
|
||||
v1Builds(value: 'v1-builds'),
|
||||
v1Messaging(value: 'v1-messaging'),
|
||||
v1Migrations(value: 'v1-migrations');
|
||||
v1Database(value: 'v1-database'),
|
||||
v1Deletes(value: 'v1-deletes'),
|
||||
v1Audits(value: 'v1-audits'),
|
||||
v1Mails(value: 'v1-mails'),
|
||||
v1Functions(value: 'v1-functions'),
|
||||
v1Usage(value: 'v1-usage'),
|
||||
v1UsageDump(value: 'v1-usage-dump'),
|
||||
v1Webhooks(value: 'v1-webhooks'),
|
||||
v1Certificates(value: 'v1-certificates'),
|
||||
v1Builds(value: 'v1-builds'),
|
||||
v1Messaging(value: 'v1-messaging'),
|
||||
v1Migrations(value: 'v1-migrations');
|
||||
|
||||
const Name({required this.value});
|
||||
const Name({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,49 +1,51 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum OAuthProvider {
|
||||
amazon(value: 'amazon'),
|
||||
apple(value: 'apple'),
|
||||
auth0(value: 'auth0'),
|
||||
authentik(value: 'authentik'),
|
||||
autodesk(value: 'autodesk'),
|
||||
bitbucket(value: 'bitbucket'),
|
||||
bitly(value: 'bitly'),
|
||||
box(value: 'box'),
|
||||
dailymotion(value: 'dailymotion'),
|
||||
discord(value: 'discord'),
|
||||
disqus(value: 'disqus'),
|
||||
dropbox(value: 'dropbox'),
|
||||
etsy(value: 'etsy'),
|
||||
facebook(value: 'facebook'),
|
||||
github(value: 'github'),
|
||||
gitlab(value: 'gitlab'),
|
||||
google(value: 'google'),
|
||||
linkedin(value: 'linkedin'),
|
||||
microsoft(value: 'microsoft'),
|
||||
notion(value: 'notion'),
|
||||
oidc(value: 'oidc'),
|
||||
okta(value: 'okta'),
|
||||
paypal(value: 'paypal'),
|
||||
paypalSandbox(value: 'paypalSandbox'),
|
||||
podio(value: 'podio'),
|
||||
salesforce(value: 'salesforce'),
|
||||
slack(value: 'slack'),
|
||||
spotify(value: 'spotify'),
|
||||
stripe(value: 'stripe'),
|
||||
tradeshift(value: 'tradeshift'),
|
||||
tradeshiftBox(value: 'tradeshiftBox'),
|
||||
twitch(value: 'twitch'),
|
||||
wordpress(value: 'wordpress'),
|
||||
yahoo(value: 'yahoo'),
|
||||
yammer(value: 'yammer'),
|
||||
yandex(value: 'yandex'),
|
||||
zoho(value: 'zoho'),
|
||||
zoom(value: 'zoom'),
|
||||
mock(value: 'mock');
|
||||
amazon(value: 'amazon'),
|
||||
apple(value: 'apple'),
|
||||
auth0(value: 'auth0'),
|
||||
authentik(value: 'authentik'),
|
||||
autodesk(value: 'autodesk'),
|
||||
bitbucket(value: 'bitbucket'),
|
||||
bitly(value: 'bitly'),
|
||||
box(value: 'box'),
|
||||
dailymotion(value: 'dailymotion'),
|
||||
discord(value: 'discord'),
|
||||
disqus(value: 'disqus'),
|
||||
dropbox(value: 'dropbox'),
|
||||
etsy(value: 'etsy'),
|
||||
facebook(value: 'facebook'),
|
||||
github(value: 'github'),
|
||||
gitlab(value: 'gitlab'),
|
||||
google(value: 'google'),
|
||||
linkedin(value: 'linkedin'),
|
||||
microsoft(value: 'microsoft'),
|
||||
notion(value: 'notion'),
|
||||
oidc(value: 'oidc'),
|
||||
okta(value: 'okta'),
|
||||
paypal(value: 'paypal'),
|
||||
paypalSandbox(value: 'paypalSandbox'),
|
||||
podio(value: 'podio'),
|
||||
salesforce(value: 'salesforce'),
|
||||
slack(value: 'slack'),
|
||||
spotify(value: 'spotify'),
|
||||
stripe(value: 'stripe'),
|
||||
tradeshift(value: 'tradeshift'),
|
||||
tradeshiftBox(value: 'tradeshiftBox'),
|
||||
twitch(value: 'twitch'),
|
||||
wordpress(value: 'wordpress'),
|
||||
yahoo(value: 'yahoo'),
|
||||
yammer(value: 'yammer'),
|
||||
yandex(value: 'yandex'),
|
||||
zoho(value: 'zoho'),
|
||||
zoom(value: 'zoom'),
|
||||
mock(value: 'mock');
|
||||
|
||||
const OAuthProvider({required this.value});
|
||||
const OAuthProvider({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum PasswordHash {
|
||||
sha1(value: 'sha1'),
|
||||
sha224(value: 'sha224'),
|
||||
sha256(value: 'sha256'),
|
||||
sha384(value: 'sha384'),
|
||||
sha512224(value: 'sha512/224'),
|
||||
sha512256(value: 'sha512/256'),
|
||||
sha512(value: 'sha512'),
|
||||
sha3224(value: 'sha3-224'),
|
||||
sha3256(value: 'sha3-256'),
|
||||
sha3384(value: 'sha3-384'),
|
||||
sha3512(value: 'sha3-512');
|
||||
sha1(value: 'sha1'),
|
||||
sha224(value: 'sha224'),
|
||||
sha256(value: 'sha256'),
|
||||
sha384(value: 'sha384'),
|
||||
sha512224(value: 'sha512/224'),
|
||||
sha512256(value: 'sha512/256'),
|
||||
sha512(value: 'sha512'),
|
||||
sha3224(value: 'sha3-224'),
|
||||
sha3256(value: 'sha3-256'),
|
||||
sha3384(value: 'sha3-384'),
|
||||
sha3512(value: 'sha3-512');
|
||||
|
||||
const PasswordHash({required this.value});
|
||||
const PasswordHash({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum RelationMutate {
|
||||
cascade(value: 'cascade'),
|
||||
restrict(value: 'restrict'),
|
||||
setNull(value: 'setNull');
|
||||
cascade(value: 'cascade'),
|
||||
restrict(value: 'restrict'),
|
||||
setNull(value: 'setNull');
|
||||
|
||||
const RelationMutate({required this.value});
|
||||
const RelationMutate({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum RelationshipType {
|
||||
oneToOne(value: 'oneToOne'),
|
||||
manyToOne(value: 'manyToOne'),
|
||||
manyToMany(value: 'manyToMany'),
|
||||
oneToMany(value: 'oneToMany');
|
||||
oneToOne(value: 'oneToOne'),
|
||||
manyToOne(value: 'manyToOne'),
|
||||
manyToMany(value: 'manyToMany'),
|
||||
oneToMany(value: 'oneToMany');
|
||||
|
||||
const RelationshipType({required this.value});
|
||||
const RelationshipType({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
+52
-50
@@ -1,56 +1,58 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Runtime {
|
||||
node145(value: 'node-14.5'),
|
||||
node160(value: 'node-16.0'),
|
||||
node180(value: 'node-18.0'),
|
||||
node190(value: 'node-19.0'),
|
||||
node200(value: 'node-20.0'),
|
||||
node210(value: 'node-21.0'),
|
||||
php80(value: 'php-8.0'),
|
||||
php81(value: 'php-8.1'),
|
||||
php82(value: 'php-8.2'),
|
||||
php83(value: 'php-8.3'),
|
||||
ruby30(value: 'ruby-3.0'),
|
||||
ruby31(value: 'ruby-3.1'),
|
||||
ruby32(value: 'ruby-3.2'),
|
||||
ruby33(value: 'ruby-3.3'),
|
||||
python38(value: 'python-3.8'),
|
||||
python39(value: 'python-3.9'),
|
||||
python310(value: 'python-3.10'),
|
||||
python311(value: 'python-3.11'),
|
||||
python312(value: 'python-3.12'),
|
||||
pythonMl311(value: 'python-ml-3.11'),
|
||||
deno140(value: 'deno-1.40'),
|
||||
dart215(value: 'dart-2.15'),
|
||||
dart216(value: 'dart-2.16'),
|
||||
dart217(value: 'dart-2.17'),
|
||||
dart218(value: 'dart-2.18'),
|
||||
dart30(value: 'dart-3.0'),
|
||||
dart31(value: 'dart-3.1'),
|
||||
dart33(value: 'dart-3.3'),
|
||||
dotnet31(value: 'dotnet-3.1'),
|
||||
dotnet60(value: 'dotnet-6.0'),
|
||||
dotnet70(value: 'dotnet-7.0'),
|
||||
java80(value: 'java-8.0'),
|
||||
java110(value: 'java-11.0'),
|
||||
java170(value: 'java-17.0'),
|
||||
java180(value: 'java-18.0'),
|
||||
java210(value: 'java-21.0'),
|
||||
swift55(value: 'swift-5.5'),
|
||||
swift58(value: 'swift-5.8'),
|
||||
swift59(value: 'swift-5.9'),
|
||||
kotlin16(value: 'kotlin-1.6'),
|
||||
kotlin18(value: 'kotlin-1.8'),
|
||||
kotlin19(value: 'kotlin-1.9'),
|
||||
cpp17(value: 'cpp-17'),
|
||||
cpp20(value: 'cpp-20'),
|
||||
bun10(value: 'bun-1.0'),
|
||||
go123(value: 'go-1.23');
|
||||
node145(value: 'node-14.5'),
|
||||
node160(value: 'node-16.0'),
|
||||
node180(value: 'node-18.0'),
|
||||
node190(value: 'node-19.0'),
|
||||
node200(value: 'node-20.0'),
|
||||
node210(value: 'node-21.0'),
|
||||
php80(value: 'php-8.0'),
|
||||
php81(value: 'php-8.1'),
|
||||
php82(value: 'php-8.2'),
|
||||
php83(value: 'php-8.3'),
|
||||
ruby30(value: 'ruby-3.0'),
|
||||
ruby31(value: 'ruby-3.1'),
|
||||
ruby32(value: 'ruby-3.2'),
|
||||
ruby33(value: 'ruby-3.3'),
|
||||
python38(value: 'python-3.8'),
|
||||
python39(value: 'python-3.9'),
|
||||
python310(value: 'python-3.10'),
|
||||
python311(value: 'python-3.11'),
|
||||
python312(value: 'python-3.12'),
|
||||
pythonMl311(value: 'python-ml-3.11'),
|
||||
deno140(value: 'deno-1.40'),
|
||||
dart215(value: 'dart-2.15'),
|
||||
dart216(value: 'dart-2.16'),
|
||||
dart217(value: 'dart-2.17'),
|
||||
dart218(value: 'dart-2.18'),
|
||||
dart30(value: 'dart-3.0'),
|
||||
dart31(value: 'dart-3.1'),
|
||||
dart33(value: 'dart-3.3'),
|
||||
dotnet31(value: 'dotnet-3.1'),
|
||||
dotnet60(value: 'dotnet-6.0'),
|
||||
dotnet70(value: 'dotnet-7.0'),
|
||||
java80(value: 'java-8.0'),
|
||||
java110(value: 'java-11.0'),
|
||||
java170(value: 'java-17.0'),
|
||||
java180(value: 'java-18.0'),
|
||||
java210(value: 'java-21.0'),
|
||||
swift55(value: 'swift-5.5'),
|
||||
swift58(value: 'swift-5.8'),
|
||||
swift59(value: 'swift-5.9'),
|
||||
kotlin16(value: 'kotlin-1.6'),
|
||||
kotlin18(value: 'kotlin-1.8'),
|
||||
kotlin19(value: 'kotlin-1.9'),
|
||||
cpp17(value: 'cpp-17'),
|
||||
cpp20(value: 'cpp-20'),
|
||||
bun10(value: 'bun-1.0'),
|
||||
go123(value: 'go-1.23');
|
||||
|
||||
const Runtime({required this.value});
|
||||
const Runtime({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum SmtpEncryption {
|
||||
none(value: 'none'),
|
||||
ssl(value: 'ssl'),
|
||||
tls(value: 'tls');
|
||||
none(value: 'none'),
|
||||
ssl(value: 'ssl'),
|
||||
tls(value: 'tls');
|
||||
|
||||
const SmtpEncryption({required this.value});
|
||||
const SmtpEncryption({
|
||||
required this.value
|
||||
});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class AppwriteException implements Exception {
|
||||
|
||||
/// Initializes an Appwrite Exception.
|
||||
AppwriteException([this.message = "", this.code, this.type, this.response]);
|
||||
|
||||
|
||||
/// Returns the error type, message, and code.
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
@@ -2,40 +2,37 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoArgon2
|
||||
class AlgoArgon2 implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Memory used to compute hash.
|
||||
final int memoryCost;
|
||||
/// Amount of time consumed to compute hash
|
||||
final int timeCost;
|
||||
/// Number of threads used to compute hash.
|
||||
final int threads;
|
||||
|
||||
/// Memory used to compute hash.
|
||||
final int memoryCost;
|
||||
AlgoArgon2({
|
||||
required this.type,
|
||||
required this.memoryCost,
|
||||
required this.timeCost,
|
||||
required this.threads,
|
||||
});
|
||||
|
||||
/// Amount of time consumed to compute hash
|
||||
final int timeCost;
|
||||
factory AlgoArgon2.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoArgon2(
|
||||
type: map['type'].toString(),
|
||||
memoryCost: map['memoryCost'],
|
||||
timeCost: map['timeCost'],
|
||||
threads: map['threads'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Number of threads used to compute hash.
|
||||
final int threads;
|
||||
|
||||
AlgoArgon2({
|
||||
required this.type,
|
||||
required this.memoryCost,
|
||||
required this.timeCost,
|
||||
required this.threads,
|
||||
});
|
||||
|
||||
factory AlgoArgon2.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoArgon2(
|
||||
type: map['type'].toString(),
|
||||
memoryCost: map['memoryCost'],
|
||||
timeCost: map['timeCost'],
|
||||
threads: map['threads'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"memoryCost": memoryCost,
|
||||
"timeCost": timeCost,
|
||||
"threads": threads,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"memoryCost": memoryCost,
|
||||
"timeCost": timeCost,
|
||||
"threads": threads,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoBcrypt
|
||||
class AlgoBcrypt implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
|
||||
AlgoBcrypt({
|
||||
required this.type,
|
||||
});
|
||||
AlgoBcrypt({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
factory AlgoBcrypt.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoBcrypt(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
factory AlgoBcrypt.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoBcrypt(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoMD5
|
||||
class AlgoMd5 implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
|
||||
AlgoMd5({
|
||||
required this.type,
|
||||
});
|
||||
AlgoMd5({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
factory AlgoMd5.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoMd5(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
factory AlgoMd5.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoMd5(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoPHPass
|
||||
class AlgoPhpass implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
|
||||
AlgoPhpass({
|
||||
required this.type,
|
||||
});
|
||||
AlgoPhpass({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
factory AlgoPhpass.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoPhpass(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
factory AlgoPhpass.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoPhpass(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,46 +2,42 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoScrypt
|
||||
class AlgoScrypt implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// CPU complexity of computed hash.
|
||||
final int costCpu;
|
||||
/// Memory complexity of computed hash.
|
||||
final int costMemory;
|
||||
/// Parallelization of computed hash.
|
||||
final int costParallel;
|
||||
/// Length used to compute hash.
|
||||
final int length;
|
||||
|
||||
/// CPU complexity of computed hash.
|
||||
final int costCpu;
|
||||
AlgoScrypt({
|
||||
required this.type,
|
||||
required this.costCpu,
|
||||
required this.costMemory,
|
||||
required this.costParallel,
|
||||
required this.length,
|
||||
});
|
||||
|
||||
/// Memory complexity of computed hash.
|
||||
final int costMemory;
|
||||
factory AlgoScrypt.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoScrypt(
|
||||
type: map['type'].toString(),
|
||||
costCpu: map['costCpu'],
|
||||
costMemory: map['costMemory'],
|
||||
costParallel: map['costParallel'],
|
||||
length: map['length'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Parallelization of computed hash.
|
||||
final int costParallel;
|
||||
|
||||
/// Length used to compute hash.
|
||||
final int length;
|
||||
|
||||
AlgoScrypt({
|
||||
required this.type,
|
||||
required this.costCpu,
|
||||
required this.costMemory,
|
||||
required this.costParallel,
|
||||
required this.length,
|
||||
});
|
||||
|
||||
factory AlgoScrypt.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoScrypt(
|
||||
type: map['type'].toString(),
|
||||
costCpu: map['costCpu'],
|
||||
costMemory: map['costMemory'],
|
||||
costParallel: map['costParallel'],
|
||||
length: map['length'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"costCpu": costCpu,
|
||||
"costMemory": costMemory,
|
||||
"costParallel": costParallel,
|
||||
"length": length,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"costCpu": costCpu,
|
||||
"costMemory": costMemory,
|
||||
"costParallel": costParallel,
|
||||
"length": length,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,40 +2,37 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoScryptModified
|
||||
class AlgoScryptModified implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Salt used to compute hash.
|
||||
final String salt;
|
||||
/// Separator used to compute hash.
|
||||
final String saltSeparator;
|
||||
/// Key used to compute hash.
|
||||
final String signerKey;
|
||||
|
||||
/// Salt used to compute hash.
|
||||
final String salt;
|
||||
AlgoScryptModified({
|
||||
required this.type,
|
||||
required this.salt,
|
||||
required this.saltSeparator,
|
||||
required this.signerKey,
|
||||
});
|
||||
|
||||
/// Separator used to compute hash.
|
||||
final String saltSeparator;
|
||||
factory AlgoScryptModified.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoScryptModified(
|
||||
type: map['type'].toString(),
|
||||
salt: map['salt'].toString(),
|
||||
saltSeparator: map['saltSeparator'].toString(),
|
||||
signerKey: map['signerKey'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Key used to compute hash.
|
||||
final String signerKey;
|
||||
|
||||
AlgoScryptModified({
|
||||
required this.type,
|
||||
required this.salt,
|
||||
required this.saltSeparator,
|
||||
required this.signerKey,
|
||||
});
|
||||
|
||||
factory AlgoScryptModified.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoScryptModified(
|
||||
type: map['type'].toString(),
|
||||
salt: map['salt'].toString(),
|
||||
saltSeparator: map['saltSeparator'].toString(),
|
||||
signerKey: map['signerKey'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"salt": salt,
|
||||
"saltSeparator": saltSeparator,
|
||||
"signerKey": signerKey,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"salt": salt,
|
||||
"saltSeparator": saltSeparator,
|
||||
"signerKey": signerKey,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// AlgoSHA
|
||||
class AlgoSha implements Model {
|
||||
/// Algo type.
|
||||
final String type;
|
||||
/// Algo type.
|
||||
final String type;
|
||||
|
||||
AlgoSha({
|
||||
required this.type,
|
||||
});
|
||||
AlgoSha({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
factory AlgoSha.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoSha(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
factory AlgoSha.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoSha(
|
||||
type: map['type'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,58 +2,52 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeBoolean
|
||||
class AttributeBoolean implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final bool? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeBoolean({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeBoolean.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeBoolean(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
xdefault: map['default'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final bool? xdefault;
|
||||
|
||||
AttributeBoolean({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeBoolean.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeBoolean(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
xdefault: map['default'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,57 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeDatetime
|
||||
class AttributeDatetime implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// ISO 8601 format.
|
||||
final String format;
|
||||
/// Default value for attribute when not provided. Only null is optional
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeDatetime({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeDatetime.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeDatetime(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// ISO 8601 format.
|
||||
final String format;
|
||||
|
||||
/// Default value for attribute when not provided. Only null is optional
|
||||
final String? xdefault;
|
||||
|
||||
AttributeDatetime({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeDatetime.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeDatetime(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,57 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeEmail
|
||||
class AttributeEmail implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// String format.
|
||||
final String format;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeEmail({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeEmail.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeEmail(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// String format.
|
||||
final String format;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
AttributeEmail({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeEmail.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeEmail(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,70 +2,62 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeEnum
|
||||
class AttributeEnum implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// Array of elements in enumerated type.
|
||||
final List elements;
|
||||
/// String format.
|
||||
final String format;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeEnum({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.elements,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeEnum.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeEnum(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
elements: map['elements'] ?? [],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// Array of elements in enumerated type.
|
||||
final List elements;
|
||||
|
||||
/// String format.
|
||||
final String format;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
AttributeEnum({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.elements,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeEnum.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeEnum(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
elements: map['elements'] ?? [],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"elements": elements,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"elements": elements,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,70 +2,62 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeFloat
|
||||
class AttributeFloat implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// Minimum value to enforce for new documents.
|
||||
final double? min;
|
||||
/// Maximum value to enforce for new documents.
|
||||
final double? max;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final double? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeFloat({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.min,
|
||||
this.max,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeFloat.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeFloat(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
min: map['min']?.toDouble(),
|
||||
max: map['max']?.toDouble(),
|
||||
xdefault: map['default']?.toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
final double? min;
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
final double? max;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final double? xdefault;
|
||||
|
||||
AttributeFloat({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.min,
|
||||
this.max,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeFloat.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeFloat(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
min: map['min']?.toDouble(),
|
||||
max: map['max']?.toDouble(),
|
||||
xdefault: map['default']?.toDouble(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"min": min,
|
||||
"max": max,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"min": min,
|
||||
"max": max,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,70 +2,62 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeInteger
|
||||
class AttributeInteger implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// Minimum value to enforce for new documents.
|
||||
final int? min;
|
||||
/// Maximum value to enforce for new documents.
|
||||
final int? max;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final int? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeInteger({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.min,
|
||||
this.max,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeInteger.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeInteger(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
min: map['min'],
|
||||
max: map['max'],
|
||||
xdefault: map['default'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// Minimum value to enforce for new documents.
|
||||
final int? min;
|
||||
|
||||
/// Maximum value to enforce for new documents.
|
||||
final int? max;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final int? xdefault;
|
||||
|
||||
AttributeInteger({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
this.min,
|
||||
this.max,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeInteger.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeInteger(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
min: map['min'],
|
||||
max: map['max'],
|
||||
xdefault: map['default'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"min": min,
|
||||
"max": max,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"min": min,
|
||||
"max": max,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,57 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeIP
|
||||
class AttributeIp implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// String format.
|
||||
final String format;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeIp({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeIp.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeIp(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// String format.
|
||||
final String format;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
AttributeIp({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeIp.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeIp(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Attributes List
|
||||
class AttributeList implements Model {
|
||||
/// Total number of attributes in the given collection.
|
||||
final int total;
|
||||
/// Total number of attributes in the given collection.
|
||||
final int total;
|
||||
/// List of attributes.
|
||||
final List attributes;
|
||||
|
||||
/// List of attributes.
|
||||
final List attributes;
|
||||
AttributeList({
|
||||
required this.total,
|
||||
required this.attributes,
|
||||
});
|
||||
|
||||
AttributeList({
|
||||
required this.total,
|
||||
required this.attributes,
|
||||
});
|
||||
factory AttributeList.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeList(
|
||||
total: map['total'],
|
||||
attributes: map['attributes'] ?? [],
|
||||
);
|
||||
}
|
||||
|
||||
factory AttributeList.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeList(
|
||||
total: map['total'],
|
||||
attributes: map['attributes'] ?? [],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"attributes": attributes,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"attributes": attributes,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,88 +2,77 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeRelationship
|
||||
class AttributeRelationship implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// The ID of the related collection.
|
||||
final String relatedCollection;
|
||||
/// The type of the relationship.
|
||||
final String relationType;
|
||||
/// Is the relationship two-way?
|
||||
final bool twoWay;
|
||||
/// The key of the two-way relationship.
|
||||
final String twoWayKey;
|
||||
/// How deleting the parent document will propagate to child documents.
|
||||
final String onDelete;
|
||||
/// Whether this is the parent or child side of the relationship
|
||||
final String side;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeRelationship({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.relatedCollection,
|
||||
required this.relationType,
|
||||
required this.twoWay,
|
||||
required this.twoWayKey,
|
||||
required this.onDelete,
|
||||
required this.side,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeRelationship.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeRelationship(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
relatedCollection: map['relatedCollection'].toString(),
|
||||
relationType: map['relationType'].toString(),
|
||||
twoWay: map['twoWay'],
|
||||
twoWayKey: map['twoWayKey'].toString(),
|
||||
onDelete: map['onDelete'].toString(),
|
||||
side: map['side'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// The ID of the related collection.
|
||||
final String relatedCollection;
|
||||
|
||||
/// The type of the relationship.
|
||||
final String relationType;
|
||||
|
||||
/// Is the relationship two-way?
|
||||
final bool twoWay;
|
||||
|
||||
/// The key of the two-way relationship.
|
||||
final String twoWayKey;
|
||||
|
||||
/// How deleting the parent document will propagate to child documents.
|
||||
final String onDelete;
|
||||
|
||||
/// Whether this is the parent or child side of the relationship
|
||||
final String side;
|
||||
|
||||
AttributeRelationship({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.relatedCollection,
|
||||
required this.relationType,
|
||||
required this.twoWay,
|
||||
required this.twoWayKey,
|
||||
required this.onDelete,
|
||||
required this.side,
|
||||
});
|
||||
|
||||
factory AttributeRelationship.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeRelationship(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
relatedCollection: map['relatedCollection'].toString(),
|
||||
relationType: map['relationType'].toString(),
|
||||
twoWay: map['twoWay'],
|
||||
twoWayKey: map['twoWayKey'].toString(),
|
||||
onDelete: map['onDelete'].toString(),
|
||||
side: map['side'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"relatedCollection": relatedCollection,
|
||||
"relationType": relationType,
|
||||
"twoWay": twoWay,
|
||||
"twoWayKey": twoWayKey,
|
||||
"onDelete": onDelete,
|
||||
"side": side,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"relatedCollection": relatedCollection,
|
||||
"relationType": relationType,
|
||||
"twoWay": twoWay,
|
||||
"twoWayKey": twoWayKey,
|
||||
"onDelete": onDelete,
|
||||
"side": side,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,57 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeString
|
||||
class AttributeString implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// Attribute size.
|
||||
final int size;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeString({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.size,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeString.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeString(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
size: map['size'],
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// Attribute size.
|
||||
final int size;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
AttributeString({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.size,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeString.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeString(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
size: map['size'],
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"size": size,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"size": size,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,64 +2,57 @@ part of '../../models.dart';
|
||||
|
||||
/// AttributeURL
|
||||
class AttributeUrl implements Model {
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute Key.
|
||||
final String key;
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
/// String format.
|
||||
final String format;
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
/// Attribute type.
|
||||
final String type;
|
||||
AttributeUrl({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
/// Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory AttributeUrl.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeUrl(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an attribute.
|
||||
final String error;
|
||||
|
||||
/// Is attribute required?
|
||||
final bool xrequired;
|
||||
|
||||
/// Is attribute an array?
|
||||
final bool? array;
|
||||
|
||||
/// String format.
|
||||
final String format;
|
||||
|
||||
/// Default value for attribute when not provided. Cannot be set when attribute is required.
|
||||
final String? xdefault;
|
||||
|
||||
AttributeUrl({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.xrequired,
|
||||
this.array,
|
||||
required this.format,
|
||||
this.xdefault,
|
||||
});
|
||||
|
||||
factory AttributeUrl.fromMap(Map<String, dynamic> map) {
|
||||
return AttributeUrl(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
xrequired: map['required'],
|
||||
array: map['array'],
|
||||
format: map['format'].toString(),
|
||||
xdefault: map['default']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"required": xrequired,
|
||||
"array": array,
|
||||
"format": format,
|
||||
"default": xdefault,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+70
-81
@@ -2,88 +2,77 @@ part of '../../models.dart';
|
||||
|
||||
/// Bucket
|
||||
class Bucket implements Model {
|
||||
/// Bucket ID.
|
||||
final String $id;
|
||||
/// Bucket ID.
|
||||
final String $id;
|
||||
/// Bucket creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Bucket update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
/// Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final bool fileSecurity;
|
||||
/// Bucket name.
|
||||
final String name;
|
||||
/// Bucket enabled.
|
||||
final bool enabled;
|
||||
/// Maximum file size supported.
|
||||
final int maximumFileSize;
|
||||
/// Allowed file extensions.
|
||||
final List allowedFileExtensions;
|
||||
/// Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
final String compression;
|
||||
/// Bucket is encrypted.
|
||||
final bool encryption;
|
||||
/// Virus scanning is enabled.
|
||||
final bool antivirus;
|
||||
|
||||
/// Bucket creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Bucket({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.fileSecurity,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.maximumFileSize,
|
||||
required this.allowedFileExtensions,
|
||||
required this.compression,
|
||||
required this.encryption,
|
||||
required this.antivirus,
|
||||
});
|
||||
|
||||
/// Bucket update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Bucket.fromMap(Map<String, dynamic> map) {
|
||||
return Bucket(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
fileSecurity: map['fileSecurity'],
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
maximumFileSize: map['maximumFileSize'],
|
||||
allowedFileExtensions: map['allowedFileExtensions'] ?? [],
|
||||
compression: map['compression'].toString(),
|
||||
encryption: map['encryption'],
|
||||
antivirus: map['antivirus'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
|
||||
/// Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final bool fileSecurity;
|
||||
|
||||
/// Bucket name.
|
||||
final String name;
|
||||
|
||||
/// Bucket enabled.
|
||||
final bool enabled;
|
||||
|
||||
/// Maximum file size supported.
|
||||
final int maximumFileSize;
|
||||
|
||||
/// Allowed file extensions.
|
||||
final List allowedFileExtensions;
|
||||
|
||||
/// Compression algorithm choosen for compression. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
final String compression;
|
||||
|
||||
/// Bucket is encrypted.
|
||||
final bool encryption;
|
||||
|
||||
/// Virus scanning is enabled.
|
||||
final bool antivirus;
|
||||
|
||||
Bucket({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.fileSecurity,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.maximumFileSize,
|
||||
required this.allowedFileExtensions,
|
||||
required this.compression,
|
||||
required this.encryption,
|
||||
required this.antivirus,
|
||||
});
|
||||
|
||||
factory Bucket.fromMap(Map<String, dynamic> map) {
|
||||
return Bucket(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
fileSecurity: map['fileSecurity'],
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
maximumFileSize: map['maximumFileSize'],
|
||||
allowedFileExtensions: map['allowedFileExtensions'] ?? [],
|
||||
compression: map['compression'].toString(),
|
||||
encryption: map['encryption'],
|
||||
antivirus: map['antivirus'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"fileSecurity": fileSecurity,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"maximumFileSize": maximumFileSize,
|
||||
"allowedFileExtensions": allowedFileExtensions,
|
||||
"compression": compression,
|
||||
"encryption": encryption,
|
||||
"antivirus": antivirus,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"fileSecurity": fileSecurity,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"maximumFileSize": maximumFileSize,
|
||||
"allowedFileExtensions": allowedFileExtensions,
|
||||
"compression": compression,
|
||||
"encryption": encryption,
|
||||
"antivirus": antivirus,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Buckets List
|
||||
class BucketList implements Model {
|
||||
/// Total number of buckets documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of buckets documents that matched your query.
|
||||
final int total;
|
||||
/// List of buckets.
|
||||
final List<Bucket> buckets;
|
||||
|
||||
/// List of buckets.
|
||||
final List<Bucket> buckets;
|
||||
BucketList({
|
||||
required this.total,
|
||||
required this.buckets,
|
||||
});
|
||||
|
||||
BucketList({
|
||||
required this.total,
|
||||
required this.buckets,
|
||||
});
|
||||
factory BucketList.fromMap(Map<String, dynamic> map) {
|
||||
return BucketList(
|
||||
total: map['total'],
|
||||
buckets: List<Bucket>.from(map['buckets'].map((p) => Bucket.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory BucketList.fromMap(Map<String, dynamic> map) {
|
||||
return BucketList(
|
||||
total: map['total'],
|
||||
buckets: List<Bucket>.from(map['buckets'].map((p) => Bucket.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"buckets": buckets.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"buckets": buckets.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+55
-63
@@ -2,70 +2,62 @@ part of '../../models.dart';
|
||||
|
||||
/// Build
|
||||
class Build implements Model {
|
||||
/// Build ID.
|
||||
final String $id;
|
||||
/// Build ID.
|
||||
final String $id;
|
||||
/// The deployment that created this build.
|
||||
final String deploymentId;
|
||||
/// The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built
|
||||
final String status;
|
||||
/// The stdout of the build.
|
||||
final String stdout;
|
||||
/// The stderr of the build.
|
||||
final String stderr;
|
||||
/// The deployment creation date in ISO 8601 format.
|
||||
final String startTime;
|
||||
/// The time the build was finished in ISO 8601 format.
|
||||
final String endTime;
|
||||
/// The build duration in seconds.
|
||||
final int duration;
|
||||
/// The code size in bytes.
|
||||
final int size;
|
||||
|
||||
/// The deployment that created this build.
|
||||
final String deploymentId;
|
||||
Build({
|
||||
required this.$id,
|
||||
required this.deploymentId,
|
||||
required this.status,
|
||||
required this.stdout,
|
||||
required this.stderr,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.duration,
|
||||
required this.size,
|
||||
});
|
||||
|
||||
/// The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built
|
||||
final String status;
|
||||
factory Build.fromMap(Map<String, dynamic> map) {
|
||||
return Build(
|
||||
$id: map['\$id'].toString(),
|
||||
deploymentId: map['deploymentId'].toString(),
|
||||
status: map['status'].toString(),
|
||||
stdout: map['stdout'].toString(),
|
||||
stderr: map['stderr'].toString(),
|
||||
startTime: map['startTime'].toString(),
|
||||
endTime: map['endTime'].toString(),
|
||||
duration: map['duration'],
|
||||
size: map['size'],
|
||||
);
|
||||
}
|
||||
|
||||
/// The stdout of the build.
|
||||
final String stdout;
|
||||
|
||||
/// The stderr of the build.
|
||||
final String stderr;
|
||||
|
||||
/// The deployment creation date in ISO 8601 format.
|
||||
final String startTime;
|
||||
|
||||
/// The time the build was finished in ISO 8601 format.
|
||||
final String endTime;
|
||||
|
||||
/// The build duration in seconds.
|
||||
final int duration;
|
||||
|
||||
/// The code size in bytes.
|
||||
final int size;
|
||||
|
||||
Build({
|
||||
required this.$id,
|
||||
required this.deploymentId,
|
||||
required this.status,
|
||||
required this.stdout,
|
||||
required this.stderr,
|
||||
required this.startTime,
|
||||
required this.endTime,
|
||||
required this.duration,
|
||||
required this.size,
|
||||
});
|
||||
|
||||
factory Build.fromMap(Map<String, dynamic> map) {
|
||||
return Build(
|
||||
$id: map['\$id'].toString(),
|
||||
deploymentId: map['deploymentId'].toString(),
|
||||
status: map['status'].toString(),
|
||||
stdout: map['stdout'].toString(),
|
||||
stderr: map['stderr'].toString(),
|
||||
startTime: map['startTime'].toString(),
|
||||
endTime: map['endTime'].toString(),
|
||||
duration: map['duration'],
|
||||
size: map['size'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"deploymentId": deploymentId,
|
||||
"status": status,
|
||||
"stdout": stdout,
|
||||
"stderr": stderr,
|
||||
"startTime": startTime,
|
||||
"endTime": endTime,
|
||||
"duration": duration,
|
||||
"size": size,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"deploymentId": deploymentId,
|
||||
"status": status,
|
||||
"stdout": stdout,
|
||||
"stderr": stderr,
|
||||
"startTime": startTime,
|
||||
"endTime": endTime,
|
||||
"duration": duration,
|
||||
"size": size,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,76 +2,67 @@ part of '../../models.dart';
|
||||
|
||||
/// Collection
|
||||
class Collection implements Model {
|
||||
/// Collection ID.
|
||||
final String $id;
|
||||
/// Collection ID.
|
||||
final String $id;
|
||||
/// Collection creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Collection update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
/// Database ID.
|
||||
final String databaseId;
|
||||
/// Collection name.
|
||||
final String name;
|
||||
/// Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
final bool enabled;
|
||||
/// Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final bool documentSecurity;
|
||||
/// Collection attributes.
|
||||
final List attributes;
|
||||
/// Collection indexes.
|
||||
final List<Index> indexes;
|
||||
|
||||
/// Collection creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Collection({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.databaseId,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.documentSecurity,
|
||||
required this.attributes,
|
||||
required this.indexes,
|
||||
});
|
||||
|
||||
/// Collection update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Collection.fromMap(Map<String, dynamic> map) {
|
||||
return Collection(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
databaseId: map['databaseId'].toString(),
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
documentSecurity: map['documentSecurity'],
|
||||
attributes: map['attributes'] ?? [],
|
||||
indexes: List<Index>.from(map['indexes'].map((p) => Index.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
/// Collection permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
|
||||
/// Database ID.
|
||||
final String databaseId;
|
||||
|
||||
/// Collection name.
|
||||
final String name;
|
||||
|
||||
/// Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
final bool enabled;
|
||||
|
||||
/// Whether document-level permissions are enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final bool documentSecurity;
|
||||
|
||||
/// Collection attributes.
|
||||
final List attributes;
|
||||
|
||||
/// Collection indexes.
|
||||
final List<Index> indexes;
|
||||
|
||||
Collection({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.databaseId,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.documentSecurity,
|
||||
required this.attributes,
|
||||
required this.indexes,
|
||||
});
|
||||
|
||||
factory Collection.fromMap(Map<String, dynamic> map) {
|
||||
return Collection(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
databaseId: map['databaseId'].toString(),
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
documentSecurity: map['documentSecurity'],
|
||||
attributes: map['attributes'] ?? [],
|
||||
indexes: List<Index>.from(map['indexes'].map((p) => Index.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"databaseId": databaseId,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"documentSecurity": documentSecurity,
|
||||
"attributes": attributes,
|
||||
"indexes": indexes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"databaseId": databaseId,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"documentSecurity": documentSecurity,
|
||||
"attributes": attributes,
|
||||
"indexes": indexes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Collections List
|
||||
class CollectionList implements Model {
|
||||
/// Total number of collections documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of collections documents that matched your query.
|
||||
final int total;
|
||||
/// List of collections.
|
||||
final List<Collection> collections;
|
||||
|
||||
/// List of collections.
|
||||
final List<Collection> collections;
|
||||
CollectionList({
|
||||
required this.total,
|
||||
required this.collections,
|
||||
});
|
||||
|
||||
CollectionList({
|
||||
required this.total,
|
||||
required this.collections,
|
||||
});
|
||||
factory CollectionList.fromMap(Map<String, dynamic> map) {
|
||||
return CollectionList(
|
||||
total: map['total'],
|
||||
collections: List<Collection>.from(map['collections'].map((p) => Collection.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory CollectionList.fromMap(Map<String, dynamic> map) {
|
||||
return CollectionList(
|
||||
total: map['total'],
|
||||
collections: List<Collection>.from(
|
||||
map['collections'].map((p) => Collection.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"collections": collections.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"collections": collections.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Continent
|
||||
class Continent implements Model {
|
||||
/// Continent name.
|
||||
final String name;
|
||||
/// Continent name.
|
||||
final String name;
|
||||
/// Continent two letter code.
|
||||
final String code;
|
||||
|
||||
/// Continent two letter code.
|
||||
final String code;
|
||||
Continent({
|
||||
required this.name,
|
||||
required this.code,
|
||||
});
|
||||
|
||||
Continent({
|
||||
required this.name,
|
||||
required this.code,
|
||||
});
|
||||
factory Continent.fromMap(Map<String, dynamic> map) {
|
||||
return Continent(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
factory Continent.fromMap(Map<String, dynamic> map) {
|
||||
return Continent(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Continents List
|
||||
class ContinentList implements Model {
|
||||
/// Total number of continents documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of continents documents that matched your query.
|
||||
final int total;
|
||||
/// List of continents.
|
||||
final List<Continent> continents;
|
||||
|
||||
/// List of continents.
|
||||
final List<Continent> continents;
|
||||
ContinentList({
|
||||
required this.total,
|
||||
required this.continents,
|
||||
});
|
||||
|
||||
ContinentList({
|
||||
required this.total,
|
||||
required this.continents,
|
||||
});
|
||||
factory ContinentList.fromMap(Map<String, dynamic> map) {
|
||||
return ContinentList(
|
||||
total: map['total'],
|
||||
continents: List<Continent>.from(map['continents'].map((p) => Continent.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory ContinentList.fromMap(Map<String, dynamic> map) {
|
||||
return ContinentList(
|
||||
total: map['total'],
|
||||
continents: List<Continent>.from(
|
||||
map['continents'].map((p) => Continent.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"continents": continents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"continents": continents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+20
-21
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Country
|
||||
class Country implements Model {
|
||||
/// Country name.
|
||||
final String name;
|
||||
/// Country name.
|
||||
final String name;
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String code;
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String code;
|
||||
Country({
|
||||
required this.name,
|
||||
required this.code,
|
||||
});
|
||||
|
||||
Country({
|
||||
required this.name,
|
||||
required this.code,
|
||||
});
|
||||
factory Country.fromMap(Map<String, dynamic> map) {
|
||||
return Country(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
factory Country.fromMap(Map<String, dynamic> map) {
|
||||
return Country(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Countries List
|
||||
class CountryList implements Model {
|
||||
/// Total number of countries documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of countries documents that matched your query.
|
||||
final int total;
|
||||
/// List of countries.
|
||||
final List<Country> countries;
|
||||
|
||||
/// List of countries.
|
||||
final List<Country> countries;
|
||||
CountryList({
|
||||
required this.total,
|
||||
required this.countries,
|
||||
});
|
||||
|
||||
CountryList({
|
||||
required this.total,
|
||||
required this.countries,
|
||||
});
|
||||
factory CountryList.fromMap(Map<String, dynamic> map) {
|
||||
return CountryList(
|
||||
total: map['total'],
|
||||
countries: List<Country>.from(map['countries'].map((p) => Country.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory CountryList.fromMap(Map<String, dynamic> map) {
|
||||
return CountryList(
|
||||
total: map['total'],
|
||||
countries:
|
||||
List<Country>.from(map['countries'].map((p) => Country.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"countries": countries.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"countries": countries.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,58 +2,52 @@ part of '../../models.dart';
|
||||
|
||||
/// Currency
|
||||
class Currency implements Model {
|
||||
/// Currency symbol.
|
||||
final String symbol;
|
||||
/// Currency symbol.
|
||||
final String symbol;
|
||||
/// Currency name.
|
||||
final String name;
|
||||
/// Currency native symbol.
|
||||
final String symbolNative;
|
||||
/// Number of decimal digits.
|
||||
final int decimalDigits;
|
||||
/// Currency digit rounding.
|
||||
final double rounding;
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.
|
||||
final String code;
|
||||
/// Currency plural name
|
||||
final String namePlural;
|
||||
|
||||
/// Currency name.
|
||||
final String name;
|
||||
Currency({
|
||||
required this.symbol,
|
||||
required this.name,
|
||||
required this.symbolNative,
|
||||
required this.decimalDigits,
|
||||
required this.rounding,
|
||||
required this.code,
|
||||
required this.namePlural,
|
||||
});
|
||||
|
||||
/// Currency native symbol.
|
||||
final String symbolNative;
|
||||
factory Currency.fromMap(Map<String, dynamic> map) {
|
||||
return Currency(
|
||||
symbol: map['symbol'].toString(),
|
||||
name: map['name'].toString(),
|
||||
symbolNative: map['symbolNative'].toString(),
|
||||
decimalDigits: map['decimalDigits'],
|
||||
rounding: map['rounding'].toDouble(),
|
||||
code: map['code'].toString(),
|
||||
namePlural: map['namePlural'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Number of decimal digits.
|
||||
final int decimalDigits;
|
||||
|
||||
/// Currency digit rounding.
|
||||
final double rounding;
|
||||
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.
|
||||
final String code;
|
||||
|
||||
/// Currency plural name
|
||||
final String namePlural;
|
||||
|
||||
Currency({
|
||||
required this.symbol,
|
||||
required this.name,
|
||||
required this.symbolNative,
|
||||
required this.decimalDigits,
|
||||
required this.rounding,
|
||||
required this.code,
|
||||
required this.namePlural,
|
||||
});
|
||||
|
||||
factory Currency.fromMap(Map<String, dynamic> map) {
|
||||
return Currency(
|
||||
symbol: map['symbol'].toString(),
|
||||
name: map['name'].toString(),
|
||||
symbolNative: map['symbolNative'].toString(),
|
||||
decimalDigits: map['decimalDigits'],
|
||||
rounding: map['rounding'].toDouble(),
|
||||
code: map['code'].toString(),
|
||||
namePlural: map['namePlural'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"symbol": symbol,
|
||||
"name": name,
|
||||
"symbolNative": symbolNative,
|
||||
"decimalDigits": decimalDigits,
|
||||
"rounding": rounding,
|
||||
"code": code,
|
||||
"namePlural": namePlural,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"symbol": symbol,
|
||||
"name": name,
|
||||
"symbolNative": symbolNative,
|
||||
"decimalDigits": decimalDigits,
|
||||
"rounding": rounding,
|
||||
"code": code,
|
||||
"namePlural": namePlural,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Currencies List
|
||||
class CurrencyList implements Model {
|
||||
/// Total number of currencies documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of currencies documents that matched your query.
|
||||
final int total;
|
||||
/// List of currencies.
|
||||
final List<Currency> currencies;
|
||||
|
||||
/// List of currencies.
|
||||
final List<Currency> currencies;
|
||||
CurrencyList({
|
||||
required this.total,
|
||||
required this.currencies,
|
||||
});
|
||||
|
||||
CurrencyList({
|
||||
required this.total,
|
||||
required this.currencies,
|
||||
});
|
||||
factory CurrencyList.fromMap(Map<String, dynamic> map) {
|
||||
return CurrencyList(
|
||||
total: map['total'],
|
||||
currencies: List<Currency>.from(map['currencies'].map((p) => Currency.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory CurrencyList.fromMap(Map<String, dynamic> map) {
|
||||
return CurrencyList(
|
||||
total: map['total'],
|
||||
currencies: List<Currency>.from(
|
||||
map['currencies'].map((p) => Currency.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"currencies": currencies.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"currencies": currencies.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,46 +2,42 @@ part of '../../models.dart';
|
||||
|
||||
/// Database
|
||||
class Database implements Model {
|
||||
/// Database ID.
|
||||
final String $id;
|
||||
/// Database ID.
|
||||
final String $id;
|
||||
/// Database name.
|
||||
final String name;
|
||||
/// Database creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Database update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
final bool enabled;
|
||||
|
||||
/// Database name.
|
||||
final String name;
|
||||
Database({
|
||||
required this.$id,
|
||||
required this.name,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.enabled,
|
||||
});
|
||||
|
||||
/// Database creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
factory Database.fromMap(Map<String, dynamic> map) {
|
||||
return Database(
|
||||
$id: map['\$id'].toString(),
|
||||
name: map['name'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
enabled: map['enabled'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Database update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
|
||||
final bool enabled;
|
||||
|
||||
Database({
|
||||
required this.$id,
|
||||
required this.name,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.enabled,
|
||||
});
|
||||
|
||||
factory Database.fromMap(Map<String, dynamic> map) {
|
||||
return Database(
|
||||
$id: map['\$id'].toString(),
|
||||
name: map['name'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
enabled: map['enabled'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"name": name,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"enabled": enabled,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"name": name,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"enabled": enabled,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Databases List
|
||||
class DatabaseList implements Model {
|
||||
/// Total number of databases documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of databases documents that matched your query.
|
||||
final int total;
|
||||
/// List of databases.
|
||||
final List<Database> databases;
|
||||
|
||||
/// List of databases.
|
||||
final List<Database> databases;
|
||||
DatabaseList({
|
||||
required this.total,
|
||||
required this.databases,
|
||||
});
|
||||
|
||||
DatabaseList({
|
||||
required this.total,
|
||||
required this.databases,
|
||||
});
|
||||
factory DatabaseList.fromMap(Map<String, dynamic> map) {
|
||||
return DatabaseList(
|
||||
total: map['total'],
|
||||
databases: List<Database>.from(map['databases'].map((p) => Database.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory DatabaseList.fromMap(Map<String, dynamic> map) {
|
||||
return DatabaseList(
|
||||
total: map['total'],
|
||||
databases:
|
||||
List<Database>.from(map['databases'].map((p) => Database.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"databases": databases.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"databases": databases.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+130
-153
@@ -2,160 +2,137 @@ part of '../../models.dart';
|
||||
|
||||
/// Deployment
|
||||
class Deployment implements Model {
|
||||
/// Deployment ID.
|
||||
final String $id;
|
||||
/// Deployment ID.
|
||||
final String $id;
|
||||
/// Deployment creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Deployment update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Type of deployment.
|
||||
final String type;
|
||||
/// Resource ID.
|
||||
final String resourceId;
|
||||
/// Resource type.
|
||||
final String resourceType;
|
||||
/// The entrypoint file to use to execute the deployment code.
|
||||
final String entrypoint;
|
||||
/// The code size in bytes.
|
||||
final int size;
|
||||
/// The build output size in bytes.
|
||||
final int buildSize;
|
||||
/// The current build ID.
|
||||
final String buildId;
|
||||
/// Whether the deployment should be automatically activated.
|
||||
final bool activate;
|
||||
/// The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed".
|
||||
final String status;
|
||||
/// The build logs.
|
||||
final String buildLogs;
|
||||
/// The current build time in seconds.
|
||||
final int buildTime;
|
||||
/// The name of the vcs provider repository
|
||||
final String providerRepositoryName;
|
||||
/// The name of the vcs provider repository owner
|
||||
final String providerRepositoryOwner;
|
||||
/// The url of the vcs provider repository
|
||||
final String providerRepositoryUrl;
|
||||
/// The branch of the vcs repository
|
||||
final String providerBranch;
|
||||
/// The commit hash of the vcs commit
|
||||
final String providerCommitHash;
|
||||
/// The url of vcs commit author
|
||||
final String providerCommitAuthorUrl;
|
||||
/// The name of vcs commit author
|
||||
final String providerCommitAuthor;
|
||||
/// The commit message
|
||||
final String providerCommitMessage;
|
||||
/// The url of the vcs commit
|
||||
final String providerCommitUrl;
|
||||
/// The branch of the vcs repository
|
||||
final String providerBranchUrl;
|
||||
|
||||
/// Deployment creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Deployment({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.type,
|
||||
required this.resourceId,
|
||||
required this.resourceType,
|
||||
required this.entrypoint,
|
||||
required this.size,
|
||||
required this.buildSize,
|
||||
required this.buildId,
|
||||
required this.activate,
|
||||
required this.status,
|
||||
required this.buildLogs,
|
||||
required this.buildTime,
|
||||
required this.providerRepositoryName,
|
||||
required this.providerRepositoryOwner,
|
||||
required this.providerRepositoryUrl,
|
||||
required this.providerBranch,
|
||||
required this.providerCommitHash,
|
||||
required this.providerCommitAuthorUrl,
|
||||
required this.providerCommitAuthor,
|
||||
required this.providerCommitMessage,
|
||||
required this.providerCommitUrl,
|
||||
required this.providerBranchUrl,
|
||||
});
|
||||
|
||||
/// Deployment update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Deployment.fromMap(Map<String, dynamic> map) {
|
||||
return Deployment(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
type: map['type'].toString(),
|
||||
resourceId: map['resourceId'].toString(),
|
||||
resourceType: map['resourceType'].toString(),
|
||||
entrypoint: map['entrypoint'].toString(),
|
||||
size: map['size'],
|
||||
buildSize: map['buildSize'],
|
||||
buildId: map['buildId'].toString(),
|
||||
activate: map['activate'],
|
||||
status: map['status'].toString(),
|
||||
buildLogs: map['buildLogs'].toString(),
|
||||
buildTime: map['buildTime'],
|
||||
providerRepositoryName: map['providerRepositoryName'].toString(),
|
||||
providerRepositoryOwner: map['providerRepositoryOwner'].toString(),
|
||||
providerRepositoryUrl: map['providerRepositoryUrl'].toString(),
|
||||
providerBranch: map['providerBranch'].toString(),
|
||||
providerCommitHash: map['providerCommitHash'].toString(),
|
||||
providerCommitAuthorUrl: map['providerCommitAuthorUrl'].toString(),
|
||||
providerCommitAuthor: map['providerCommitAuthor'].toString(),
|
||||
providerCommitMessage: map['providerCommitMessage'].toString(),
|
||||
providerCommitUrl: map['providerCommitUrl'].toString(),
|
||||
providerBranchUrl: map['providerBranchUrl'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Type of deployment.
|
||||
final String type;
|
||||
|
||||
/// Resource ID.
|
||||
final String resourceId;
|
||||
|
||||
/// Resource type.
|
||||
final String resourceType;
|
||||
|
||||
/// The entrypoint file to use to execute the deployment code.
|
||||
final String entrypoint;
|
||||
|
||||
/// The code size in bytes.
|
||||
final int size;
|
||||
|
||||
/// The build output size in bytes.
|
||||
final int buildSize;
|
||||
|
||||
/// The current build ID.
|
||||
final String buildId;
|
||||
|
||||
/// Whether the deployment should be automatically activated.
|
||||
final bool activate;
|
||||
|
||||
/// The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed".
|
||||
final String status;
|
||||
|
||||
/// The build logs.
|
||||
final String buildLogs;
|
||||
|
||||
/// The current build time in seconds.
|
||||
final int buildTime;
|
||||
|
||||
/// The name of the vcs provider repository
|
||||
final String providerRepositoryName;
|
||||
|
||||
/// The name of the vcs provider repository owner
|
||||
final String providerRepositoryOwner;
|
||||
|
||||
/// The url of the vcs provider repository
|
||||
final String providerRepositoryUrl;
|
||||
|
||||
/// The branch of the vcs repository
|
||||
final String providerBranch;
|
||||
|
||||
/// The commit hash of the vcs commit
|
||||
final String providerCommitHash;
|
||||
|
||||
/// The url of vcs commit author
|
||||
final String providerCommitAuthorUrl;
|
||||
|
||||
/// The name of vcs commit author
|
||||
final String providerCommitAuthor;
|
||||
|
||||
/// The commit message
|
||||
final String providerCommitMessage;
|
||||
|
||||
/// The url of the vcs commit
|
||||
final String providerCommitUrl;
|
||||
|
||||
/// The branch of the vcs repository
|
||||
final String providerBranchUrl;
|
||||
|
||||
Deployment({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.type,
|
||||
required this.resourceId,
|
||||
required this.resourceType,
|
||||
required this.entrypoint,
|
||||
required this.size,
|
||||
required this.buildSize,
|
||||
required this.buildId,
|
||||
required this.activate,
|
||||
required this.status,
|
||||
required this.buildLogs,
|
||||
required this.buildTime,
|
||||
required this.providerRepositoryName,
|
||||
required this.providerRepositoryOwner,
|
||||
required this.providerRepositoryUrl,
|
||||
required this.providerBranch,
|
||||
required this.providerCommitHash,
|
||||
required this.providerCommitAuthorUrl,
|
||||
required this.providerCommitAuthor,
|
||||
required this.providerCommitMessage,
|
||||
required this.providerCommitUrl,
|
||||
required this.providerBranchUrl,
|
||||
});
|
||||
|
||||
factory Deployment.fromMap(Map<String, dynamic> map) {
|
||||
return Deployment(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
type: map['type'].toString(),
|
||||
resourceId: map['resourceId'].toString(),
|
||||
resourceType: map['resourceType'].toString(),
|
||||
entrypoint: map['entrypoint'].toString(),
|
||||
size: map['size'],
|
||||
buildSize: map['buildSize'],
|
||||
buildId: map['buildId'].toString(),
|
||||
activate: map['activate'],
|
||||
status: map['status'].toString(),
|
||||
buildLogs: map['buildLogs'].toString(),
|
||||
buildTime: map['buildTime'],
|
||||
providerRepositoryName: map['providerRepositoryName'].toString(),
|
||||
providerRepositoryOwner: map['providerRepositoryOwner'].toString(),
|
||||
providerRepositoryUrl: map['providerRepositoryUrl'].toString(),
|
||||
providerBranch: map['providerBranch'].toString(),
|
||||
providerCommitHash: map['providerCommitHash'].toString(),
|
||||
providerCommitAuthorUrl: map['providerCommitAuthorUrl'].toString(),
|
||||
providerCommitAuthor: map['providerCommitAuthor'].toString(),
|
||||
providerCommitMessage: map['providerCommitMessage'].toString(),
|
||||
providerCommitUrl: map['providerCommitUrl'].toString(),
|
||||
providerBranchUrl: map['providerBranchUrl'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"type": type,
|
||||
"resourceId": resourceId,
|
||||
"resourceType": resourceType,
|
||||
"entrypoint": entrypoint,
|
||||
"size": size,
|
||||
"buildSize": buildSize,
|
||||
"buildId": buildId,
|
||||
"activate": activate,
|
||||
"status": status,
|
||||
"buildLogs": buildLogs,
|
||||
"buildTime": buildTime,
|
||||
"providerRepositoryName": providerRepositoryName,
|
||||
"providerRepositoryOwner": providerRepositoryOwner,
|
||||
"providerRepositoryUrl": providerRepositoryUrl,
|
||||
"providerBranch": providerBranch,
|
||||
"providerCommitHash": providerCommitHash,
|
||||
"providerCommitAuthorUrl": providerCommitAuthorUrl,
|
||||
"providerCommitAuthor": providerCommitAuthor,
|
||||
"providerCommitMessage": providerCommitMessage,
|
||||
"providerCommitUrl": providerCommitUrl,
|
||||
"providerBranchUrl": providerBranchUrl,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"type": type,
|
||||
"resourceId": resourceId,
|
||||
"resourceType": resourceType,
|
||||
"entrypoint": entrypoint,
|
||||
"size": size,
|
||||
"buildSize": buildSize,
|
||||
"buildId": buildId,
|
||||
"activate": activate,
|
||||
"status": status,
|
||||
"buildLogs": buildLogs,
|
||||
"buildTime": buildTime,
|
||||
"providerRepositoryName": providerRepositoryName,
|
||||
"providerRepositoryOwner": providerRepositoryOwner,
|
||||
"providerRepositoryUrl": providerRepositoryUrl,
|
||||
"providerBranch": providerBranch,
|
||||
"providerCommitHash": providerCommitHash,
|
||||
"providerCommitAuthorUrl": providerCommitAuthorUrl,
|
||||
"providerCommitAuthor": providerCommitAuthor,
|
||||
"providerCommitMessage": providerCommitMessage,
|
||||
"providerCommitUrl": providerCommitUrl,
|
||||
"providerBranchUrl": providerBranchUrl,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Deployments List
|
||||
class DeploymentList implements Model {
|
||||
/// Total number of deployments documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of deployments documents that matched your query.
|
||||
final int total;
|
||||
/// List of deployments.
|
||||
final List<Deployment> deployments;
|
||||
|
||||
/// List of deployments.
|
||||
final List<Deployment> deployments;
|
||||
DeploymentList({
|
||||
required this.total,
|
||||
required this.deployments,
|
||||
});
|
||||
|
||||
DeploymentList({
|
||||
required this.total,
|
||||
required this.deployments,
|
||||
});
|
||||
factory DeploymentList.fromMap(Map<String, dynamic> map) {
|
||||
return DeploymentList(
|
||||
total: map['total'],
|
||||
deployments: List<Deployment>.from(map['deployments'].map((p) => Deployment.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory DeploymentList.fromMap(Map<String, dynamic> map) {
|
||||
return DeploymentList(
|
||||
total: map['total'],
|
||||
deployments: List<Deployment>.from(
|
||||
map['deployments'].map((p) => Deployment.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"deployments": deployments.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"deployments": deployments.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,58 +2,53 @@ part of '../../models.dart';
|
||||
|
||||
/// Document
|
||||
class Document implements Model {
|
||||
/// Document ID.
|
||||
final String $id;
|
||||
/// Document ID.
|
||||
final String $id;
|
||||
/// Collection ID.
|
||||
final String $collectionId;
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
/// Document creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Document update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
/// Collection ID.
|
||||
final String $collectionId;
|
||||
Document({
|
||||
required this.$id,
|
||||
required this.$collectionId,
|
||||
required this.$databaseId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
factory Document.fromMap(Map<String, dynamic> map) {
|
||||
return Document(
|
||||
$id: map['\$id'].toString(),
|
||||
$collectionId: map['\$collectionId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
data: map,
|
||||
);
|
||||
}
|
||||
|
||||
/// Document creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$collectionId": $collectionId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
|
||||
/// Document update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
Document({
|
||||
required this.$id,
|
||||
required this.$collectionId,
|
||||
required this.$databaseId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory Document.fromMap(Map<String, dynamic> map) {
|
||||
return Document(
|
||||
$id: map['\$id'].toString(),
|
||||
$collectionId: map['\$collectionId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
data: map,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$collectionId": $collectionId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
|
||||
T convertTo<T>(T Function(Map) fromJson) => fromJson(data);
|
||||
T convertTo<T>(T Function(Map) fromJson) => fromJson(data);
|
||||
}
|
||||
|
||||
@@ -2,32 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Documents List
|
||||
class DocumentList implements Model {
|
||||
/// Total number of documents documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of documents documents that matched your query.
|
||||
final int total;
|
||||
/// List of documents.
|
||||
final List<Document> documents;
|
||||
|
||||
/// List of documents.
|
||||
final List<Document> documents;
|
||||
DocumentList({
|
||||
required this.total,
|
||||
required this.documents,
|
||||
});
|
||||
|
||||
DocumentList({
|
||||
required this.total,
|
||||
required this.documents,
|
||||
});
|
||||
factory DocumentList.fromMap(Map<String, dynamic> map) {
|
||||
return DocumentList(
|
||||
total: map['total'],
|
||||
documents: List<Document>.from(map['documents'].map((p) => Document.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory DocumentList.fromMap(Map<String, dynamic> map) {
|
||||
return DocumentList(
|
||||
total: map['total'],
|
||||
documents:
|
||||
List<Document>.from(map['documents'].map((p) => Document.fromMap(p))),
|
||||
);
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"documents": documents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"documents": documents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
|
||||
List<T> convertTo<T>(T Function(Map) fromJson) =>
|
||||
documents.map((d) => d.convertTo<T>(fromJson)).toList();
|
||||
List<T> convertTo<T>(T Function(Map) fromJson) =>
|
||||
documents.map((d) => d.convertTo<T>(fromJson)).toList();
|
||||
}
|
||||
|
||||
+95
-113
@@ -2,120 +2,102 @@ part of '../../models.dart';
|
||||
|
||||
/// Execution
|
||||
class Execution implements Model {
|
||||
/// Execution ID.
|
||||
final String $id;
|
||||
/// Execution ID.
|
||||
final String $id;
|
||||
/// Execution creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Execution upate date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Execution roles.
|
||||
final List $permissions;
|
||||
/// Function ID.
|
||||
final String functionId;
|
||||
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
|
||||
final String trigger;
|
||||
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.
|
||||
final String status;
|
||||
/// HTTP request method type.
|
||||
final String requestMethod;
|
||||
/// HTTP request path and query.
|
||||
final String requestPath;
|
||||
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
final List<Headers> requestHeaders;
|
||||
/// HTTP response status code.
|
||||
final int responseStatusCode;
|
||||
/// HTTP response body. This will return empty unless execution is created as synchronous.
|
||||
final String responseBody;
|
||||
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
final List<Headers> responseHeaders;
|
||||
/// Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String logs;
|
||||
/// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String errors;
|
||||
/// Function execution duration in seconds.
|
||||
final double duration;
|
||||
/// The scheduled time for execution. If left empty, execution will be queued immediately.
|
||||
final String? scheduledAt;
|
||||
|
||||
/// Execution creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Execution({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.functionId,
|
||||
required this.trigger,
|
||||
required this.status,
|
||||
required this.requestMethod,
|
||||
required this.requestPath,
|
||||
required this.requestHeaders,
|
||||
required this.responseStatusCode,
|
||||
required this.responseBody,
|
||||
required this.responseHeaders,
|
||||
required this.logs,
|
||||
required this.errors,
|
||||
required this.duration,
|
||||
this.scheduledAt,
|
||||
});
|
||||
|
||||
/// Execution upate date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Execution.fromMap(Map<String, dynamic> map) {
|
||||
return Execution(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
functionId: map['functionId'].toString(),
|
||||
trigger: map['trigger'].toString(),
|
||||
status: map['status'].toString(),
|
||||
requestMethod: map['requestMethod'].toString(),
|
||||
requestPath: map['requestPath'].toString(),
|
||||
requestHeaders: List<Headers>.from(map['requestHeaders'].map((p) => Headers.fromMap(p))),
|
||||
responseStatusCode: map['responseStatusCode'],
|
||||
responseBody: map['responseBody'].toString(),
|
||||
responseHeaders: List<Headers>.from(map['responseHeaders'].map((p) => Headers.fromMap(p))),
|
||||
logs: map['logs'].toString(),
|
||||
errors: map['errors'].toString(),
|
||||
duration: map['duration'].toDouble(),
|
||||
scheduledAt: map['scheduledAt']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Execution roles.
|
||||
final List $permissions;
|
||||
|
||||
/// Function ID.
|
||||
final String functionId;
|
||||
|
||||
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
|
||||
final String trigger;
|
||||
|
||||
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.
|
||||
final String status;
|
||||
|
||||
/// HTTP request method type.
|
||||
final String requestMethod;
|
||||
|
||||
/// HTTP request path and query.
|
||||
final String requestPath;
|
||||
|
||||
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
final List<Headers> requestHeaders;
|
||||
|
||||
/// HTTP response status code.
|
||||
final int responseStatusCode;
|
||||
|
||||
/// HTTP response body. This will return empty unless execution is created as synchronous.
|
||||
final String responseBody;
|
||||
|
||||
/// HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.
|
||||
final List<Headers> responseHeaders;
|
||||
|
||||
/// Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String logs;
|
||||
|
||||
/// Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String errors;
|
||||
|
||||
/// Function execution duration in seconds.
|
||||
final double duration;
|
||||
|
||||
/// The scheduled time for execution. If left empty, execution will be queued immediately.
|
||||
final String? scheduledAt;
|
||||
|
||||
Execution({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.functionId,
|
||||
required this.trigger,
|
||||
required this.status,
|
||||
required this.requestMethod,
|
||||
required this.requestPath,
|
||||
required this.requestHeaders,
|
||||
required this.responseStatusCode,
|
||||
required this.responseBody,
|
||||
required this.responseHeaders,
|
||||
required this.logs,
|
||||
required this.errors,
|
||||
required this.duration,
|
||||
this.scheduledAt,
|
||||
});
|
||||
|
||||
factory Execution.fromMap(Map<String, dynamic> map) {
|
||||
return Execution(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
functionId: map['functionId'].toString(),
|
||||
trigger: map['trigger'].toString(),
|
||||
status: map['status'].toString(),
|
||||
requestMethod: map['requestMethod'].toString(),
|
||||
requestPath: map['requestPath'].toString(),
|
||||
requestHeaders: List<Headers>.from(
|
||||
map['requestHeaders'].map((p) => Headers.fromMap(p))),
|
||||
responseStatusCode: map['responseStatusCode'],
|
||||
responseBody: map['responseBody'].toString(),
|
||||
responseHeaders: List<Headers>.from(
|
||||
map['responseHeaders'].map((p) => Headers.fromMap(p))),
|
||||
logs: map['logs'].toString(),
|
||||
errors: map['errors'].toString(),
|
||||
duration: map['duration'].toDouble(),
|
||||
scheduledAt: map['scheduledAt']?.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"functionId": functionId,
|
||||
"trigger": trigger,
|
||||
"status": status,
|
||||
"requestMethod": requestMethod,
|
||||
"requestPath": requestPath,
|
||||
"requestHeaders": requestHeaders.map((p) => p.toMap()).toList(),
|
||||
"responseStatusCode": responseStatusCode,
|
||||
"responseBody": responseBody,
|
||||
"responseHeaders": responseHeaders.map((p) => p.toMap()).toList(),
|
||||
"logs": logs,
|
||||
"errors": errors,
|
||||
"duration": duration,
|
||||
"scheduledAt": scheduledAt,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"functionId": functionId,
|
||||
"trigger": trigger,
|
||||
"status": status,
|
||||
"requestMethod": requestMethod,
|
||||
"requestPath": requestPath,
|
||||
"requestHeaders": requestHeaders.map((p) => p.toMap()).toList(),
|
||||
"responseStatusCode": responseStatusCode,
|
||||
"responseBody": responseBody,
|
||||
"responseHeaders": responseHeaders.map((p) => p.toMap()).toList(),
|
||||
"logs": logs,
|
||||
"errors": errors,
|
||||
"duration": duration,
|
||||
"scheduledAt": scheduledAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Executions List
|
||||
class ExecutionList implements Model {
|
||||
/// Total number of executions documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of executions documents that matched your query.
|
||||
final int total;
|
||||
/// List of executions.
|
||||
final List<Execution> executions;
|
||||
|
||||
/// List of executions.
|
||||
final List<Execution> executions;
|
||||
ExecutionList({
|
||||
required this.total,
|
||||
required this.executions,
|
||||
});
|
||||
|
||||
ExecutionList({
|
||||
required this.total,
|
||||
required this.executions,
|
||||
});
|
||||
factory ExecutionList.fromMap(Map<String, dynamic> map) {
|
||||
return ExecutionList(
|
||||
total: map['total'],
|
||||
executions: List<Execution>.from(map['executions'].map((p) => Execution.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory ExecutionList.fromMap(Map<String, dynamic> map) {
|
||||
return ExecutionList(
|
||||
total: map['total'],
|
||||
executions: List<Execution>.from(
|
||||
map['executions'].map((p) => Execution.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"executions": executions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"executions": executions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+65
-75
@@ -2,82 +2,72 @@ part of '../../models.dart';
|
||||
|
||||
/// File
|
||||
class File implements Model {
|
||||
/// File ID.
|
||||
final String $id;
|
||||
/// File ID.
|
||||
final String $id;
|
||||
/// Bucket ID.
|
||||
final String bucketId;
|
||||
/// File creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// File update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
/// File name.
|
||||
final String name;
|
||||
/// File MD5 signature.
|
||||
final String signature;
|
||||
/// File mime type.
|
||||
final String mimeType;
|
||||
/// File original size in bytes.
|
||||
final int sizeOriginal;
|
||||
/// Total number of chunks available
|
||||
final int chunksTotal;
|
||||
/// Total number of chunks uploaded
|
||||
final int chunksUploaded;
|
||||
|
||||
/// Bucket ID.
|
||||
final String bucketId;
|
||||
File({
|
||||
required this.$id,
|
||||
required this.bucketId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.name,
|
||||
required this.signature,
|
||||
required this.mimeType,
|
||||
required this.sizeOriginal,
|
||||
required this.chunksTotal,
|
||||
required this.chunksUploaded,
|
||||
});
|
||||
|
||||
/// File creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
factory File.fromMap(Map<String, dynamic> map) {
|
||||
return File(
|
||||
$id: map['\$id'].toString(),
|
||||
bucketId: map['bucketId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
name: map['name'].toString(),
|
||||
signature: map['signature'].toString(),
|
||||
mimeType: map['mimeType'].toString(),
|
||||
sizeOriginal: map['sizeOriginal'],
|
||||
chunksTotal: map['chunksTotal'],
|
||||
chunksUploaded: map['chunksUploaded'],
|
||||
);
|
||||
}
|
||||
|
||||
/// File update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List $permissions;
|
||||
|
||||
/// File name.
|
||||
final String name;
|
||||
|
||||
/// File MD5 signature.
|
||||
final String signature;
|
||||
|
||||
/// File mime type.
|
||||
final String mimeType;
|
||||
|
||||
/// File original size in bytes.
|
||||
final int sizeOriginal;
|
||||
|
||||
/// Total number of chunks available
|
||||
final int chunksTotal;
|
||||
|
||||
/// Total number of chunks uploaded
|
||||
final int chunksUploaded;
|
||||
|
||||
File({
|
||||
required this.$id,
|
||||
required this.bucketId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.name,
|
||||
required this.signature,
|
||||
required this.mimeType,
|
||||
required this.sizeOriginal,
|
||||
required this.chunksTotal,
|
||||
required this.chunksUploaded,
|
||||
});
|
||||
|
||||
factory File.fromMap(Map<String, dynamic> map) {
|
||||
return File(
|
||||
$id: map['\$id'].toString(),
|
||||
bucketId: map['bucketId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: map['\$permissions'] ?? [],
|
||||
name: map['name'].toString(),
|
||||
signature: map['signature'].toString(),
|
||||
mimeType: map['mimeType'].toString(),
|
||||
sizeOriginal: map['sizeOriginal'],
|
||||
chunksTotal: map['chunksTotal'],
|
||||
chunksUploaded: map['chunksUploaded'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"bucketId": bucketId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"name": name,
|
||||
"signature": signature,
|
||||
"mimeType": mimeType,
|
||||
"sizeOriginal": sizeOriginal,
|
||||
"chunksTotal": chunksTotal,
|
||||
"chunksUploaded": chunksUploaded,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"bucketId": bucketId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"name": name,
|
||||
"signature": signature,
|
||||
"mimeType": mimeType,
|
||||
"sizeOriginal": sizeOriginal,
|
||||
"chunksTotal": chunksTotal,
|
||||
"chunksUploaded": chunksUploaded,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Files List
|
||||
class FileList implements Model {
|
||||
/// Total number of files documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of files documents that matched your query.
|
||||
final int total;
|
||||
/// List of files.
|
||||
final List<File> files;
|
||||
|
||||
/// List of files.
|
||||
final List<File> files;
|
||||
FileList({
|
||||
required this.total,
|
||||
required this.files,
|
||||
});
|
||||
|
||||
FileList({
|
||||
required this.total,
|
||||
required this.files,
|
||||
});
|
||||
factory FileList.fromMap(Map<String, dynamic> map) {
|
||||
return FileList(
|
||||
total: map['total'],
|
||||
files: List<File>.from(map['files'].map((p) => File.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory FileList.fromMap(Map<String, dynamic> map) {
|
||||
return FileList(
|
||||
total: map['total'],
|
||||
files: List<File>.from(map['files'].map((p) => File.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"files": files.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"files": files.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+130
-153
@@ -2,160 +2,137 @@ part of '../../models.dart';
|
||||
|
||||
/// Function
|
||||
class Func implements Model {
|
||||
/// Function ID.
|
||||
final String $id;
|
||||
/// Function ID.
|
||||
final String $id;
|
||||
/// Function creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Function update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Execution permissions.
|
||||
final List execute;
|
||||
/// Function name.
|
||||
final String name;
|
||||
/// Function enabled.
|
||||
final bool enabled;
|
||||
/// Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
|
||||
final bool live;
|
||||
/// Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
|
||||
final bool logging;
|
||||
/// Function execution runtime.
|
||||
final String runtime;
|
||||
/// Function's active deployment ID.
|
||||
final String deployment;
|
||||
/// Allowed permission scopes.
|
||||
final List scopes;
|
||||
/// Function variables.
|
||||
final List<Variable> vars;
|
||||
/// Function trigger events.
|
||||
final List events;
|
||||
/// Function execution schedult in CRON format.
|
||||
final String schedule;
|
||||
/// Function execution timeout in seconds.
|
||||
final int timeout;
|
||||
/// The entrypoint file used to execute the deployment.
|
||||
final String entrypoint;
|
||||
/// The build command used to build the deployment.
|
||||
final String commands;
|
||||
/// Version of Open Runtimes used for the function.
|
||||
final String version;
|
||||
/// Function VCS (Version Control System) installation id.
|
||||
final String installationId;
|
||||
/// VCS (Version Control System) Repository ID
|
||||
final String providerRepositoryId;
|
||||
/// VCS (Version Control System) branch name
|
||||
final String providerBranch;
|
||||
/// Path to function in VCS (Version Control System) repository
|
||||
final String providerRootDirectory;
|
||||
/// Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
|
||||
final bool providerSilentMode;
|
||||
/// Machine specification for builds and executions.
|
||||
final String specification;
|
||||
|
||||
/// Function creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Func({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.execute,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.live,
|
||||
required this.logging,
|
||||
required this.runtime,
|
||||
required this.deployment,
|
||||
required this.scopes,
|
||||
required this.vars,
|
||||
required this.events,
|
||||
required this.schedule,
|
||||
required this.timeout,
|
||||
required this.entrypoint,
|
||||
required this.commands,
|
||||
required this.version,
|
||||
required this.installationId,
|
||||
required this.providerRepositoryId,
|
||||
required this.providerBranch,
|
||||
required this.providerRootDirectory,
|
||||
required this.providerSilentMode,
|
||||
required this.specification,
|
||||
});
|
||||
|
||||
/// Function update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Func.fromMap(Map<String, dynamic> map) {
|
||||
return Func(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
execute: map['execute'] ?? [],
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
live: map['live'],
|
||||
logging: map['logging'],
|
||||
runtime: map['runtime'].toString(),
|
||||
deployment: map['deployment'].toString(),
|
||||
scopes: map['scopes'] ?? [],
|
||||
vars: List<Variable>.from(map['vars'].map((p) => Variable.fromMap(p))),
|
||||
events: map['events'] ?? [],
|
||||
schedule: map['schedule'].toString(),
|
||||
timeout: map['timeout'],
|
||||
entrypoint: map['entrypoint'].toString(),
|
||||
commands: map['commands'].toString(),
|
||||
version: map['version'].toString(),
|
||||
installationId: map['installationId'].toString(),
|
||||
providerRepositoryId: map['providerRepositoryId'].toString(),
|
||||
providerBranch: map['providerBranch'].toString(),
|
||||
providerRootDirectory: map['providerRootDirectory'].toString(),
|
||||
providerSilentMode: map['providerSilentMode'],
|
||||
specification: map['specification'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Execution permissions.
|
||||
final List execute;
|
||||
|
||||
/// Function name.
|
||||
final String name;
|
||||
|
||||
/// Function enabled.
|
||||
final bool enabled;
|
||||
|
||||
/// Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.
|
||||
final bool live;
|
||||
|
||||
/// Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project.
|
||||
final bool logging;
|
||||
|
||||
/// Function execution runtime.
|
||||
final String runtime;
|
||||
|
||||
/// Function's active deployment ID.
|
||||
final String deployment;
|
||||
|
||||
/// Allowed permission scopes.
|
||||
final List scopes;
|
||||
|
||||
/// Function variables.
|
||||
final List<Variable> vars;
|
||||
|
||||
/// Function trigger events.
|
||||
final List events;
|
||||
|
||||
/// Function execution schedult in CRON format.
|
||||
final String schedule;
|
||||
|
||||
/// Function execution timeout in seconds.
|
||||
final int timeout;
|
||||
|
||||
/// The entrypoint file used to execute the deployment.
|
||||
final String entrypoint;
|
||||
|
||||
/// The build command used to build the deployment.
|
||||
final String commands;
|
||||
|
||||
/// Version of Open Runtimes used for the function.
|
||||
final String version;
|
||||
|
||||
/// Function VCS (Version Control System) installation id.
|
||||
final String installationId;
|
||||
|
||||
/// VCS (Version Control System) Repository ID
|
||||
final String providerRepositoryId;
|
||||
|
||||
/// VCS (Version Control System) branch name
|
||||
final String providerBranch;
|
||||
|
||||
/// Path to function in VCS (Version Control System) repository
|
||||
final String providerRootDirectory;
|
||||
|
||||
/// Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
|
||||
final bool providerSilentMode;
|
||||
|
||||
/// Machine specification for builds and executions.
|
||||
final String specification;
|
||||
|
||||
Func({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.execute,
|
||||
required this.name,
|
||||
required this.enabled,
|
||||
required this.live,
|
||||
required this.logging,
|
||||
required this.runtime,
|
||||
required this.deployment,
|
||||
required this.scopes,
|
||||
required this.vars,
|
||||
required this.events,
|
||||
required this.schedule,
|
||||
required this.timeout,
|
||||
required this.entrypoint,
|
||||
required this.commands,
|
||||
required this.version,
|
||||
required this.installationId,
|
||||
required this.providerRepositoryId,
|
||||
required this.providerBranch,
|
||||
required this.providerRootDirectory,
|
||||
required this.providerSilentMode,
|
||||
required this.specification,
|
||||
});
|
||||
|
||||
factory Func.fromMap(Map<String, dynamic> map) {
|
||||
return Func(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
execute: map['execute'] ?? [],
|
||||
name: map['name'].toString(),
|
||||
enabled: map['enabled'],
|
||||
live: map['live'],
|
||||
logging: map['logging'],
|
||||
runtime: map['runtime'].toString(),
|
||||
deployment: map['deployment'].toString(),
|
||||
scopes: map['scopes'] ?? [],
|
||||
vars: List<Variable>.from(map['vars'].map((p) => Variable.fromMap(p))),
|
||||
events: map['events'] ?? [],
|
||||
schedule: map['schedule'].toString(),
|
||||
timeout: map['timeout'],
|
||||
entrypoint: map['entrypoint'].toString(),
|
||||
commands: map['commands'].toString(),
|
||||
version: map['version'].toString(),
|
||||
installationId: map['installationId'].toString(),
|
||||
providerRepositoryId: map['providerRepositoryId'].toString(),
|
||||
providerBranch: map['providerBranch'].toString(),
|
||||
providerRootDirectory: map['providerRootDirectory'].toString(),
|
||||
providerSilentMode: map['providerSilentMode'],
|
||||
specification: map['specification'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"execute": execute,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"live": live,
|
||||
"logging": logging,
|
||||
"runtime": runtime,
|
||||
"deployment": deployment,
|
||||
"scopes": scopes,
|
||||
"vars": vars.map((p) => p.toMap()).toList(),
|
||||
"events": events,
|
||||
"schedule": schedule,
|
||||
"timeout": timeout,
|
||||
"entrypoint": entrypoint,
|
||||
"commands": commands,
|
||||
"version": version,
|
||||
"installationId": installationId,
|
||||
"providerRepositoryId": providerRepositoryId,
|
||||
"providerBranch": providerBranch,
|
||||
"providerRootDirectory": providerRootDirectory,
|
||||
"providerSilentMode": providerSilentMode,
|
||||
"specification": specification,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"execute": execute,
|
||||
"name": name,
|
||||
"enabled": enabled,
|
||||
"live": live,
|
||||
"logging": logging,
|
||||
"runtime": runtime,
|
||||
"deployment": deployment,
|
||||
"scopes": scopes,
|
||||
"vars": vars.map((p) => p.toMap()).toList(),
|
||||
"events": events,
|
||||
"schedule": schedule,
|
||||
"timeout": timeout,
|
||||
"entrypoint": entrypoint,
|
||||
"commands": commands,
|
||||
"version": version,
|
||||
"installationId": installationId,
|
||||
"providerRepositoryId": providerRepositoryId,
|
||||
"providerBranch": providerBranch,
|
||||
"providerRootDirectory": providerRootDirectory,
|
||||
"providerSilentMode": providerSilentMode,
|
||||
"specification": specification,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Functions List
|
||||
class FunctionList implements Model {
|
||||
/// Total number of functions documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of functions documents that matched your query.
|
||||
final int total;
|
||||
/// List of functions.
|
||||
final List<Func> functions;
|
||||
|
||||
/// List of functions.
|
||||
final List<Func> functions;
|
||||
FunctionList({
|
||||
required this.total,
|
||||
required this.functions,
|
||||
});
|
||||
|
||||
FunctionList({
|
||||
required this.total,
|
||||
required this.functions,
|
||||
});
|
||||
factory FunctionList.fromMap(Map<String, dynamic> map) {
|
||||
return FunctionList(
|
||||
total: map['total'],
|
||||
functions: List<Func>.from(map['functions'].map((p) => Func.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory FunctionList.fromMap(Map<String, dynamic> map) {
|
||||
return FunctionList(
|
||||
total: map['total'],
|
||||
functions: List<Func>.from(map['functions'].map((p) => Func.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"functions": functions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"functions": functions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+20
-21
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Headers
|
||||
class Headers implements Model {
|
||||
/// Header name.
|
||||
final String name;
|
||||
/// Header name.
|
||||
final String name;
|
||||
/// Header value.
|
||||
final String value;
|
||||
|
||||
/// Header value.
|
||||
final String value;
|
||||
Headers({
|
||||
required this.name,
|
||||
required this.value,
|
||||
});
|
||||
|
||||
Headers({
|
||||
required this.name,
|
||||
required this.value,
|
||||
});
|
||||
factory Headers.fromMap(Map<String, dynamic> map) {
|
||||
return Headers(
|
||||
name: map['name'].toString(),
|
||||
value: map['value'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
factory Headers.fromMap(Map<String, dynamic> map) {
|
||||
return Headers(
|
||||
name: map['name'].toString(),
|
||||
value: map['value'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Health Antivirus
|
||||
class HealthAntivirus implements Model {
|
||||
/// Antivirus version.
|
||||
final String version;
|
||||
/// Antivirus version.
|
||||
final String version;
|
||||
/// Antivirus status. Possible values can are: `disabled`, `offline`, `online`
|
||||
final String status;
|
||||
|
||||
/// Antivirus status. Possible values can are: `disabled`, `offline`, `online`
|
||||
final String status;
|
||||
HealthAntivirus({
|
||||
required this.version,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
HealthAntivirus({
|
||||
required this.version,
|
||||
required this.status,
|
||||
});
|
||||
factory HealthAntivirus.fromMap(Map<String, dynamic> map) {
|
||||
return HealthAntivirus(
|
||||
version: map['version'].toString(),
|
||||
status: map['status'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
factory HealthAntivirus.fromMap(Map<String, dynamic> map) {
|
||||
return HealthAntivirus(
|
||||
version: map['version'].toString(),
|
||||
status: map['status'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"version": version,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"version": version,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,52 +2,47 @@ part of '../../models.dart';
|
||||
|
||||
/// Health Certificate
|
||||
class HealthCertificate implements Model {
|
||||
/// Certificate name
|
||||
final String name;
|
||||
/// Certificate name
|
||||
final String name;
|
||||
/// Subject SN
|
||||
final String subjectSN;
|
||||
/// Issuer organisation
|
||||
final String issuerOrganisation;
|
||||
/// Valid from
|
||||
final String validFrom;
|
||||
/// Valid to
|
||||
final String validTo;
|
||||
/// Signature type SN
|
||||
final String signatureTypeSN;
|
||||
|
||||
/// Subject SN
|
||||
final String subjectSN;
|
||||
HealthCertificate({
|
||||
required this.name,
|
||||
required this.subjectSN,
|
||||
required this.issuerOrganisation,
|
||||
required this.validFrom,
|
||||
required this.validTo,
|
||||
required this.signatureTypeSN,
|
||||
});
|
||||
|
||||
/// Issuer organisation
|
||||
final String issuerOrganisation;
|
||||
factory HealthCertificate.fromMap(Map<String, dynamic> map) {
|
||||
return HealthCertificate(
|
||||
name: map['name'].toString(),
|
||||
subjectSN: map['subjectSN'].toString(),
|
||||
issuerOrganisation: map['issuerOrganisation'].toString(),
|
||||
validFrom: map['validFrom'].toString(),
|
||||
validTo: map['validTo'].toString(),
|
||||
signatureTypeSN: map['signatureTypeSN'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Valid from
|
||||
final String validFrom;
|
||||
|
||||
/// Valid to
|
||||
final String validTo;
|
||||
|
||||
/// Signature type SN
|
||||
final String signatureTypeSN;
|
||||
|
||||
HealthCertificate({
|
||||
required this.name,
|
||||
required this.subjectSN,
|
||||
required this.issuerOrganisation,
|
||||
required this.validFrom,
|
||||
required this.validTo,
|
||||
required this.signatureTypeSN,
|
||||
});
|
||||
|
||||
factory HealthCertificate.fromMap(Map<String, dynamic> map) {
|
||||
return HealthCertificate(
|
||||
name: map['name'].toString(),
|
||||
subjectSN: map['subjectSN'].toString(),
|
||||
issuerOrganisation: map['issuerOrganisation'].toString(),
|
||||
validFrom: map['validFrom'].toString(),
|
||||
validTo: map['validTo'].toString(),
|
||||
signatureTypeSN: map['signatureTypeSN'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"subjectSN": subjectSN,
|
||||
"issuerOrganisation": issuerOrganisation,
|
||||
"validFrom": validFrom,
|
||||
"validTo": validTo,
|
||||
"signatureTypeSN": signatureTypeSN,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"subjectSN": subjectSN,
|
||||
"issuerOrganisation": issuerOrganisation,
|
||||
"validFrom": validFrom,
|
||||
"validTo": validTo,
|
||||
"signatureTypeSN": signatureTypeSN,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// Health Queue
|
||||
class HealthQueue implements Model {
|
||||
/// Amount of actions in the queue.
|
||||
final int size;
|
||||
/// Amount of actions in the queue.
|
||||
final int size;
|
||||
|
||||
HealthQueue({
|
||||
required this.size,
|
||||
});
|
||||
HealthQueue({
|
||||
required this.size,
|
||||
});
|
||||
|
||||
factory HealthQueue.fromMap(Map<String, dynamic> map) {
|
||||
return HealthQueue(
|
||||
size: map['size'],
|
||||
);
|
||||
}
|
||||
factory HealthQueue.fromMap(Map<String, dynamic> map) {
|
||||
return HealthQueue(
|
||||
size: map['size'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"size": size,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"size": size,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,34 +2,32 @@ part of '../../models.dart';
|
||||
|
||||
/// Health Status
|
||||
class HealthStatus implements Model {
|
||||
/// Name of the service.
|
||||
final String name;
|
||||
/// Name of the service.
|
||||
final String name;
|
||||
/// Duration in milliseconds how long the health check took.
|
||||
final int ping;
|
||||
/// Service status. Possible values can are: `pass`, `fail`
|
||||
final String status;
|
||||
|
||||
/// Duration in milliseconds how long the health check took.
|
||||
final int ping;
|
||||
HealthStatus({
|
||||
required this.name,
|
||||
required this.ping,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
/// Service status. Possible values can are: `pass`, `fail`
|
||||
final String status;
|
||||
factory HealthStatus.fromMap(Map<String, dynamic> map) {
|
||||
return HealthStatus(
|
||||
name: map['name'].toString(),
|
||||
ping: map['ping'],
|
||||
status: map['status'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
HealthStatus({
|
||||
required this.name,
|
||||
required this.ping,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
factory HealthStatus.fromMap(Map<String, dynamic> map) {
|
||||
return HealthStatus(
|
||||
name: map['name'].toString(),
|
||||
ping: map['ping'],
|
||||
status: map['status'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"ping": ping,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"ping": ping,
|
||||
"status": status,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,34 +2,32 @@ part of '../../models.dart';
|
||||
|
||||
/// Health Time
|
||||
class HealthTime implements Model {
|
||||
/// Current unix timestamp on trustful remote server.
|
||||
final int remoteTime;
|
||||
/// Current unix timestamp on trustful remote server.
|
||||
final int remoteTime;
|
||||
/// Current unix timestamp of local server where Appwrite runs.
|
||||
final int localTime;
|
||||
/// Difference of unix remote and local timestamps in milliseconds.
|
||||
final int diff;
|
||||
|
||||
/// Current unix timestamp of local server where Appwrite runs.
|
||||
final int localTime;
|
||||
HealthTime({
|
||||
required this.remoteTime,
|
||||
required this.localTime,
|
||||
required this.diff,
|
||||
});
|
||||
|
||||
/// Difference of unix remote and local timestamps in milliseconds.
|
||||
final int diff;
|
||||
factory HealthTime.fromMap(Map<String, dynamic> map) {
|
||||
return HealthTime(
|
||||
remoteTime: map['remoteTime'],
|
||||
localTime: map['localTime'],
|
||||
diff: map['diff'],
|
||||
);
|
||||
}
|
||||
|
||||
HealthTime({
|
||||
required this.remoteTime,
|
||||
required this.localTime,
|
||||
required this.diff,
|
||||
});
|
||||
|
||||
factory HealthTime.fromMap(Map<String, dynamic> map) {
|
||||
return HealthTime(
|
||||
remoteTime: map['remoteTime'],
|
||||
localTime: map['localTime'],
|
||||
diff: map['diff'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"remoteTime": remoteTime,
|
||||
"localTime": localTime,
|
||||
"diff": diff,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"remoteTime": remoteTime,
|
||||
"localTime": localTime,
|
||||
"diff": diff,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,76 +2,67 @@ part of '../../models.dart';
|
||||
|
||||
/// Identity
|
||||
class Identity implements Model {
|
||||
/// Identity ID.
|
||||
final String $id;
|
||||
/// Identity ID.
|
||||
final String $id;
|
||||
/// Identity creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Identity update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// Identity Provider.
|
||||
final String provider;
|
||||
/// ID of the User in the Identity Provider.
|
||||
final String providerUid;
|
||||
/// Email of the User in the Identity Provider.
|
||||
final String providerEmail;
|
||||
/// Identity Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
/// Identity Provider Refresh Token.
|
||||
final String providerRefreshToken;
|
||||
|
||||
/// Identity creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
Identity({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.provider,
|
||||
required this.providerUid,
|
||||
required this.providerEmail,
|
||||
required this.providerAccessToken,
|
||||
required this.providerAccessTokenExpiry,
|
||||
required this.providerRefreshToken,
|
||||
});
|
||||
|
||||
/// Identity update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
factory Identity.fromMap(Map<String, dynamic> map) {
|
||||
return Identity(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
provider: map['provider'].toString(),
|
||||
providerUid: map['providerUid'].toString(),
|
||||
providerEmail: map['providerEmail'].toString(),
|
||||
providerAccessToken: map['providerAccessToken'].toString(),
|
||||
providerAccessTokenExpiry: map['providerAccessTokenExpiry'].toString(),
|
||||
providerRefreshToken: map['providerRefreshToken'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Identity Provider.
|
||||
final String provider;
|
||||
|
||||
/// ID of the User in the Identity Provider.
|
||||
final String providerUid;
|
||||
|
||||
/// Email of the User in the Identity Provider.
|
||||
final String providerEmail;
|
||||
|
||||
/// Identity Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
|
||||
/// Identity Provider Refresh Token.
|
||||
final String providerRefreshToken;
|
||||
|
||||
Identity({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.provider,
|
||||
required this.providerUid,
|
||||
required this.providerEmail,
|
||||
required this.providerAccessToken,
|
||||
required this.providerAccessTokenExpiry,
|
||||
required this.providerRefreshToken,
|
||||
});
|
||||
|
||||
factory Identity.fromMap(Map<String, dynamic> map) {
|
||||
return Identity(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
provider: map['provider'].toString(),
|
||||
providerUid: map['providerUid'].toString(),
|
||||
providerEmail: map['providerEmail'].toString(),
|
||||
providerAccessToken: map['providerAccessToken'].toString(),
|
||||
providerAccessTokenExpiry: map['providerAccessTokenExpiry'].toString(),
|
||||
providerRefreshToken: map['providerRefreshToken'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"provider": provider,
|
||||
"providerUid": providerUid,
|
||||
"providerEmail": providerEmail,
|
||||
"providerAccessToken": providerAccessToken,
|
||||
"providerAccessTokenExpiry": providerAccessTokenExpiry,
|
||||
"providerRefreshToken": providerRefreshToken,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"provider": provider,
|
||||
"providerUid": providerUid,
|
||||
"providerEmail": providerEmail,
|
||||
"providerAccessToken": providerAccessToken,
|
||||
"providerAccessTokenExpiry": providerAccessTokenExpiry,
|
||||
"providerRefreshToken": providerRefreshToken,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Identities List
|
||||
class IdentityList implements Model {
|
||||
/// Total number of identities documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of identities documents that matched your query.
|
||||
final int total;
|
||||
/// List of identities.
|
||||
final List<Identity> identities;
|
||||
|
||||
/// List of identities.
|
||||
final List<Identity> identities;
|
||||
IdentityList({
|
||||
required this.total,
|
||||
required this.identities,
|
||||
});
|
||||
|
||||
IdentityList({
|
||||
required this.total,
|
||||
required this.identities,
|
||||
});
|
||||
factory IdentityList.fromMap(Map<String, dynamic> map) {
|
||||
return IdentityList(
|
||||
total: map['total'],
|
||||
identities: List<Identity>.from(map['identities'].map((p) => Identity.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory IdentityList.fromMap(Map<String, dynamic> map) {
|
||||
return IdentityList(
|
||||
total: map['total'],
|
||||
identities: List<Identity>.from(
|
||||
map['identities'].map((p) => Identity.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"identities": identities.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"identities": identities.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+40
-45
@@ -2,52 +2,47 @@ part of '../../models.dart';
|
||||
|
||||
/// Index
|
||||
class Index implements Model {
|
||||
/// Index Key.
|
||||
final String key;
|
||||
/// Index Key.
|
||||
final String key;
|
||||
/// Index type.
|
||||
final String type;
|
||||
/// Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
/// Error message. Displays error generated on failure of creating or deleting an index.
|
||||
final String error;
|
||||
/// Index attributes.
|
||||
final List attributes;
|
||||
/// Index orders.
|
||||
final List? orders;
|
||||
|
||||
/// Index type.
|
||||
final String type;
|
||||
Index({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.attributes,
|
||||
this.orders,
|
||||
});
|
||||
|
||||
/// Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`
|
||||
final String status;
|
||||
factory Index.fromMap(Map<String, dynamic> map) {
|
||||
return Index(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
attributes: map['attributes'] ?? [],
|
||||
orders: map['orders'],
|
||||
);
|
||||
}
|
||||
|
||||
/// Error message. Displays error generated on failure of creating or deleting an index.
|
||||
final String error;
|
||||
|
||||
/// Index attributes.
|
||||
final List attributes;
|
||||
|
||||
/// Index orders.
|
||||
final List? orders;
|
||||
|
||||
Index({
|
||||
required this.key,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.error,
|
||||
required this.attributes,
|
||||
this.orders,
|
||||
});
|
||||
|
||||
factory Index.fromMap(Map<String, dynamic> map) {
|
||||
return Index(
|
||||
key: map['key'].toString(),
|
||||
type: map['type'].toString(),
|
||||
status: map['status'].toString(),
|
||||
error: map['error'].toString(),
|
||||
attributes: map['attributes'] ?? [],
|
||||
orders: map['orders'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"attributes": attributes,
|
||||
"orders": orders,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"key": key,
|
||||
"type": type,
|
||||
"status": status,
|
||||
"error": error,
|
||||
"attributes": attributes,
|
||||
"orders": orders,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Indexes List
|
||||
class IndexList implements Model {
|
||||
/// Total number of indexes documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of indexes documents that matched your query.
|
||||
final int total;
|
||||
/// List of indexes.
|
||||
final List<Index> indexes;
|
||||
|
||||
/// List of indexes.
|
||||
final List<Index> indexes;
|
||||
IndexList({
|
||||
required this.total,
|
||||
required this.indexes,
|
||||
});
|
||||
|
||||
IndexList({
|
||||
required this.total,
|
||||
required this.indexes,
|
||||
});
|
||||
factory IndexList.fromMap(Map<String, dynamic> map) {
|
||||
return IndexList(
|
||||
total: map['total'],
|
||||
indexes: List<Index>.from(map['indexes'].map((p) => Index.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory IndexList.fromMap(Map<String, dynamic> map) {
|
||||
return IndexList(
|
||||
total: map['total'],
|
||||
indexes: List<Index>.from(map['indexes'].map((p) => Index.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"indexes": indexes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"indexes": indexes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -2,22 +2,22 @@ part of '../../models.dart';
|
||||
|
||||
/// JWT
|
||||
class Jwt implements Model {
|
||||
/// JWT encoded string.
|
||||
final String jwt;
|
||||
/// JWT encoded string.
|
||||
final String jwt;
|
||||
|
||||
Jwt({
|
||||
required this.jwt,
|
||||
});
|
||||
Jwt({
|
||||
required this.jwt,
|
||||
});
|
||||
|
||||
factory Jwt.fromMap(Map<String, dynamic> map) {
|
||||
return Jwt(
|
||||
jwt: map['jwt'].toString(),
|
||||
);
|
||||
}
|
||||
factory Jwt.fromMap(Map<String, dynamic> map) {
|
||||
return Jwt(
|
||||
jwt: map['jwt'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"jwt": jwt,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"jwt": jwt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,34 +2,32 @@ part of '../../models.dart';
|
||||
|
||||
/// Language
|
||||
class Language implements Model {
|
||||
/// Language name.
|
||||
final String name;
|
||||
/// Language name.
|
||||
final String name;
|
||||
/// Language two-character ISO 639-1 codes.
|
||||
final String code;
|
||||
/// Language native name.
|
||||
final String nativeName;
|
||||
|
||||
/// Language two-character ISO 639-1 codes.
|
||||
final String code;
|
||||
Language({
|
||||
required this.name,
|
||||
required this.code,
|
||||
required this.nativeName,
|
||||
});
|
||||
|
||||
/// Language native name.
|
||||
final String nativeName;
|
||||
factory Language.fromMap(Map<String, dynamic> map) {
|
||||
return Language(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
nativeName: map['nativeName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Language({
|
||||
required this.name,
|
||||
required this.code,
|
||||
required this.nativeName,
|
||||
});
|
||||
|
||||
factory Language.fromMap(Map<String, dynamic> map) {
|
||||
return Language(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
nativeName: map['nativeName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
"nativeName": nativeName,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
"nativeName": nativeName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Languages List
|
||||
class LanguageList implements Model {
|
||||
/// Total number of languages documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of languages documents that matched your query.
|
||||
final int total;
|
||||
/// List of languages.
|
||||
final List<Language> languages;
|
||||
|
||||
/// List of languages.
|
||||
final List<Language> languages;
|
||||
LanguageList({
|
||||
required this.total,
|
||||
required this.languages,
|
||||
});
|
||||
|
||||
LanguageList({
|
||||
required this.total,
|
||||
required this.languages,
|
||||
});
|
||||
factory LanguageList.fromMap(Map<String, dynamic> map) {
|
||||
return LanguageList(
|
||||
total: map['total'],
|
||||
languages: List<Language>.from(map['languages'].map((p) => Language.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory LanguageList.fromMap(Map<String, dynamic> map) {
|
||||
return LanguageList(
|
||||
total: map['total'],
|
||||
languages:
|
||||
List<Language>.from(map['languages'].map((p) => Language.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"languages": languages.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"languages": languages.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+45
-51
@@ -2,58 +2,52 @@ part of '../../models.dart';
|
||||
|
||||
/// Locale
|
||||
class Locale implements Model {
|
||||
/// User IP address.
|
||||
final String ip;
|
||||
/// User IP address.
|
||||
final String ip;
|
||||
/// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format
|
||||
final String countryCode;
|
||||
/// Country name. This field support localization.
|
||||
final String country;
|
||||
/// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
|
||||
final String continentCode;
|
||||
/// Continent name. This field support localization.
|
||||
final String continent;
|
||||
/// True if country is part of the European Union.
|
||||
final bool eu;
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format
|
||||
final String currency;
|
||||
|
||||
/// Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format
|
||||
final String countryCode;
|
||||
Locale({
|
||||
required this.ip,
|
||||
required this.countryCode,
|
||||
required this.country,
|
||||
required this.continentCode,
|
||||
required this.continent,
|
||||
required this.eu,
|
||||
required this.currency,
|
||||
});
|
||||
|
||||
/// Country name. This field support localization.
|
||||
final String country;
|
||||
factory Locale.fromMap(Map<String, dynamic> map) {
|
||||
return Locale(
|
||||
ip: map['ip'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
country: map['country'].toString(),
|
||||
continentCode: map['continentCode'].toString(),
|
||||
continent: map['continent'].toString(),
|
||||
eu: map['eu'],
|
||||
currency: map['currency'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
|
||||
final String continentCode;
|
||||
|
||||
/// Continent name. This field support localization.
|
||||
final String continent;
|
||||
|
||||
/// True if country is part of the European Union.
|
||||
final bool eu;
|
||||
|
||||
/// Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format
|
||||
final String currency;
|
||||
|
||||
Locale({
|
||||
required this.ip,
|
||||
required this.countryCode,
|
||||
required this.country,
|
||||
required this.continentCode,
|
||||
required this.continent,
|
||||
required this.eu,
|
||||
required this.currency,
|
||||
});
|
||||
|
||||
factory Locale.fromMap(Map<String, dynamic> map) {
|
||||
return Locale(
|
||||
ip: map['ip'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
country: map['country'].toString(),
|
||||
continentCode: map['continentCode'].toString(),
|
||||
continent: map['continent'].toString(),
|
||||
eu: map['eu'],
|
||||
currency: map['currency'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"ip": ip,
|
||||
"countryCode": countryCode,
|
||||
"country": country,
|
||||
"continentCode": continentCode,
|
||||
"continent": continent,
|
||||
"eu": eu,
|
||||
"currency": currency,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"ip": ip,
|
||||
"countryCode": countryCode,
|
||||
"country": country,
|
||||
"continentCode": continentCode,
|
||||
"continent": continent,
|
||||
"eu": eu,
|
||||
"currency": currency,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// LocaleCode
|
||||
class LocaleCode implements Model {
|
||||
/// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
|
||||
final String code;
|
||||
/// Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
|
||||
final String code;
|
||||
/// Locale name
|
||||
final String name;
|
||||
|
||||
/// Locale name
|
||||
final String name;
|
||||
LocaleCode({
|
||||
required this.code,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
LocaleCode({
|
||||
required this.code,
|
||||
required this.name,
|
||||
});
|
||||
factory LocaleCode.fromMap(Map<String, dynamic> map) {
|
||||
return LocaleCode(
|
||||
code: map['code'].toString(),
|
||||
name: map['name'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
factory LocaleCode.fromMap(Map<String, dynamic> map) {
|
||||
return LocaleCode(
|
||||
code: map['code'].toString(),
|
||||
name: map['name'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Locale codes list
|
||||
class LocaleCodeList implements Model {
|
||||
/// Total number of localeCodes documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of localeCodes documents that matched your query.
|
||||
final int total;
|
||||
/// List of localeCodes.
|
||||
final List<LocaleCode> localeCodes;
|
||||
|
||||
/// List of localeCodes.
|
||||
final List<LocaleCode> localeCodes;
|
||||
LocaleCodeList({
|
||||
required this.total,
|
||||
required this.localeCodes,
|
||||
});
|
||||
|
||||
LocaleCodeList({
|
||||
required this.total,
|
||||
required this.localeCodes,
|
||||
});
|
||||
factory LocaleCodeList.fromMap(Map<String, dynamic> map) {
|
||||
return LocaleCodeList(
|
||||
total: map['total'],
|
||||
localeCodes: List<LocaleCode>.from(map['localeCodes'].map((p) => LocaleCode.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory LocaleCodeList.fromMap(Map<String, dynamic> map) {
|
||||
return LocaleCodeList(
|
||||
total: map['total'],
|
||||
localeCodes: List<LocaleCode>.from(
|
||||
map['localeCodes'].map((p) => LocaleCode.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"localeCodes": localeCodes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"localeCodes": localeCodes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+115
-135
@@ -2,142 +2,122 @@ part of '../../models.dart';
|
||||
|
||||
/// Log
|
||||
class Log implements Model {
|
||||
/// Event name.
|
||||
final String event;
|
||||
/// Event name.
|
||||
final String event;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User Email.
|
||||
final String userEmail;
|
||||
/// User Name.
|
||||
final String userName;
|
||||
/// API mode when event triggered.
|
||||
final String mode;
|
||||
/// IP session in use when the session was created.
|
||||
final String ip;
|
||||
/// Log creation date in ISO 8601 format.
|
||||
final String time;
|
||||
/// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
|
||||
final String osCode;
|
||||
/// Operating system name.
|
||||
final String osName;
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
/// Client type.
|
||||
final String clientType;
|
||||
/// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
|
||||
final String clientCode;
|
||||
/// Client name.
|
||||
final String clientName;
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
Log({
|
||||
required this.event,
|
||||
required this.userId,
|
||||
required this.userEmail,
|
||||
required this.userName,
|
||||
required this.mode,
|
||||
required this.ip,
|
||||
required this.time,
|
||||
required this.osCode,
|
||||
required this.osName,
|
||||
required this.osVersion,
|
||||
required this.clientType,
|
||||
required this.clientCode,
|
||||
required this.clientName,
|
||||
required this.clientVersion,
|
||||
required this.clientEngine,
|
||||
required this.clientEngineVersion,
|
||||
required this.deviceName,
|
||||
required this.deviceBrand,
|
||||
required this.deviceModel,
|
||||
required this.countryCode,
|
||||
required this.countryName,
|
||||
});
|
||||
|
||||
/// User Email.
|
||||
final String userEmail;
|
||||
factory Log.fromMap(Map<String, dynamic> map) {
|
||||
return Log(
|
||||
event: map['event'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
userEmail: map['userEmail'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
mode: map['mode'].toString(),
|
||||
ip: map['ip'].toString(),
|
||||
time: map['time'].toString(),
|
||||
osCode: map['osCode'].toString(),
|
||||
osName: map['osName'].toString(),
|
||||
osVersion: map['osVersion'].toString(),
|
||||
clientType: map['clientType'].toString(),
|
||||
clientCode: map['clientCode'].toString(),
|
||||
clientName: map['clientName'].toString(),
|
||||
clientVersion: map['clientVersion'].toString(),
|
||||
clientEngine: map['clientEngine'].toString(),
|
||||
clientEngineVersion: map['clientEngineVersion'].toString(),
|
||||
deviceName: map['deviceName'].toString(),
|
||||
deviceBrand: map['deviceBrand'].toString(),
|
||||
deviceModel: map['deviceModel'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
countryName: map['countryName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
/// User Name.
|
||||
final String userName;
|
||||
|
||||
/// API mode when event triggered.
|
||||
final String mode;
|
||||
|
||||
/// IP session in use when the session was created.
|
||||
final String ip;
|
||||
|
||||
/// Log creation date in ISO 8601 format.
|
||||
final String time;
|
||||
|
||||
/// Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json).
|
||||
final String osCode;
|
||||
|
||||
/// Operating system name.
|
||||
final String osName;
|
||||
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
|
||||
/// Client type.
|
||||
final String clientType;
|
||||
|
||||
/// Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json).
|
||||
final String clientCode;
|
||||
|
||||
/// Client name.
|
||||
final String clientName;
|
||||
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
|
||||
Log({
|
||||
required this.event,
|
||||
required this.userId,
|
||||
required this.userEmail,
|
||||
required this.userName,
|
||||
required this.mode,
|
||||
required this.ip,
|
||||
required this.time,
|
||||
required this.osCode,
|
||||
required this.osName,
|
||||
required this.osVersion,
|
||||
required this.clientType,
|
||||
required this.clientCode,
|
||||
required this.clientName,
|
||||
required this.clientVersion,
|
||||
required this.clientEngine,
|
||||
required this.clientEngineVersion,
|
||||
required this.deviceName,
|
||||
required this.deviceBrand,
|
||||
required this.deviceModel,
|
||||
required this.countryCode,
|
||||
required this.countryName,
|
||||
});
|
||||
|
||||
factory Log.fromMap(Map<String, dynamic> map) {
|
||||
return Log(
|
||||
event: map['event'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
userEmail: map['userEmail'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
mode: map['mode'].toString(),
|
||||
ip: map['ip'].toString(),
|
||||
time: map['time'].toString(),
|
||||
osCode: map['osCode'].toString(),
|
||||
osName: map['osName'].toString(),
|
||||
osVersion: map['osVersion'].toString(),
|
||||
clientType: map['clientType'].toString(),
|
||||
clientCode: map['clientCode'].toString(),
|
||||
clientName: map['clientName'].toString(),
|
||||
clientVersion: map['clientVersion'].toString(),
|
||||
clientEngine: map['clientEngine'].toString(),
|
||||
clientEngineVersion: map['clientEngineVersion'].toString(),
|
||||
deviceName: map['deviceName'].toString(),
|
||||
deviceBrand: map['deviceBrand'].toString(),
|
||||
deviceModel: map['deviceModel'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
countryName: map['countryName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"event": event,
|
||||
"userId": userId,
|
||||
"userEmail": userEmail,
|
||||
"userName": userName,
|
||||
"mode": mode,
|
||||
"ip": ip,
|
||||
"time": time,
|
||||
"osCode": osCode,
|
||||
"osName": osName,
|
||||
"osVersion": osVersion,
|
||||
"clientType": clientType,
|
||||
"clientCode": clientCode,
|
||||
"clientName": clientName,
|
||||
"clientVersion": clientVersion,
|
||||
"clientEngine": clientEngine,
|
||||
"clientEngineVersion": clientEngineVersion,
|
||||
"deviceName": deviceName,
|
||||
"deviceBrand": deviceBrand,
|
||||
"deviceModel": deviceModel,
|
||||
"countryCode": countryCode,
|
||||
"countryName": countryName,
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"event": event,
|
||||
"userId": userId,
|
||||
"userEmail": userEmail,
|
||||
"userName": userName,
|
||||
"mode": mode,
|
||||
"ip": ip,
|
||||
"time": time,
|
||||
"osCode": osCode,
|
||||
"osName": osName,
|
||||
"osVersion": osVersion,
|
||||
"clientType": clientType,
|
||||
"clientCode": clientCode,
|
||||
"clientName": clientName,
|
||||
"clientVersion": clientVersion,
|
||||
"clientEngine": clientEngine,
|
||||
"clientEngineVersion": clientEngineVersion,
|
||||
"deviceName": deviceName,
|
||||
"deviceBrand": deviceBrand,
|
||||
"deviceModel": deviceModel,
|
||||
"countryCode": countryCode,
|
||||
"countryName": countryName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,27 @@ part of '../../models.dart';
|
||||
|
||||
/// Logs List
|
||||
class LogList implements Model {
|
||||
/// Total number of logs documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of logs documents that matched your query.
|
||||
final int total;
|
||||
/// List of logs.
|
||||
final List<Log> logs;
|
||||
|
||||
/// List of logs.
|
||||
final List<Log> logs;
|
||||
LogList({
|
||||
required this.total,
|
||||
required this.logs,
|
||||
});
|
||||
|
||||
LogList({
|
||||
required this.total,
|
||||
required this.logs,
|
||||
});
|
||||
factory LogList.fromMap(Map<String, dynamic> map) {
|
||||
return LogList(
|
||||
total: map['total'],
|
||||
logs: List<Log>.from(map['logs'].map((p) => Log.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
factory LogList.fromMap(Map<String, dynamic> map) {
|
||||
return LogList(
|
||||
total: map['total'],
|
||||
logs: List<Log>.from(map['logs'].map((p) => Log.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"logs": logs.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"logs": logs.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user