mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
Commit from GitHub Actions (Format and push)
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
/// Appwrite Flutter SDK
|
||||
///
|
||||
/// This SDK is compatible with Appwrite server version 1.8.x.
|
||||
/// This SDK is compatible with Appwrite server version 1.8.x.
|
||||
/// For older versions, please check
|
||||
/// [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).
|
||||
library appwrite;
|
||||
|
||||
+16
-3
@@ -2,18 +2,31 @@ part of appwrite;
|
||||
|
||||
// Marker classes for type safety
|
||||
class _Root {}
|
||||
|
||||
class _Database {}
|
||||
|
||||
class _Collection {}
|
||||
|
||||
class _Document {}
|
||||
|
||||
class _TablesDB {}
|
||||
|
||||
class _Table {}
|
||||
|
||||
class _Row {}
|
||||
|
||||
class _Bucket {}
|
||||
|
||||
class _File {}
|
||||
|
||||
class _Func {}
|
||||
|
||||
class _Execution {}
|
||||
|
||||
class _Team {}
|
||||
|
||||
class _Membership {}
|
||||
|
||||
class _Resolved {}
|
||||
|
||||
// Helper function for normalizing ID
|
||||
@@ -94,15 +107,15 @@ extension DatabaseChannel on Channel<_Database> {
|
||||
|
||||
/// Only available on Channel<_Collection>
|
||||
extension CollectionChannel on Channel<_Collection> {
|
||||
Channel<_Document> document([String? id]) => _next<_Document>('documents', id);
|
||||
Channel<_Document> document([String? id]) =>
|
||||
_next<_Document>('documents', id);
|
||||
}
|
||||
|
||||
// --- TABLESDB ROUTE ---
|
||||
|
||||
/// Only available on Channel<_TablesDB>
|
||||
extension TablesDBChannel on Channel<_TablesDB> {
|
||||
Channel<_Table> table(String id) =>
|
||||
_next<_Table>('tables', id);
|
||||
Channel<_Table> table(String id) => _next<_Table>('tables', id);
|
||||
}
|
||||
|
||||
/// Only available on Channel<_Table>
|
||||
|
||||
@@ -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';
|
||||
|
||||
+4
-7
@@ -31,7 +31,7 @@ class Operator {
|
||||
|
||||
result['method'] = method;
|
||||
|
||||
if(values != null) {
|
||||
if (values != null) {
|
||||
result['values'] = values is List ? values : [values];
|
||||
}
|
||||
|
||||
@@ -147,8 +147,7 @@ class Operator {
|
||||
Operator._('arrayRemove', [value]).toString();
|
||||
|
||||
/// Remove duplicate values from an array attribute.
|
||||
static String arrayUnique() =>
|
||||
Operator._('arrayUnique', []).toString();
|
||||
static String arrayUnique() => Operator._('arrayUnique', []).toString();
|
||||
|
||||
/// Keep only values that exist in both the current array and the provided array.
|
||||
static String arrayIntersect(List<dynamic> values) =>
|
||||
@@ -173,8 +172,7 @@ class Operator {
|
||||
Operator._('stringReplace', [search, replace]).toString();
|
||||
|
||||
/// Toggle a boolean attribute.
|
||||
static String toggle() =>
|
||||
Operator._('toggle', []).toString();
|
||||
static String toggle() => Operator._('toggle', []).toString();
|
||||
|
||||
/// Add days to a date attribute.
|
||||
static String dateAddDays(int days) =>
|
||||
@@ -185,6 +183,5 @@ class Operator {
|
||||
Operator._('dateSubDays', [days]).toString();
|
||||
|
||||
/// Set a date attribute to the current date and time.
|
||||
static String dateSetNow() =>
|
||||
Operator._('dateSetNow', []).toString();
|
||||
static String dateSetNow() => Operator._('dateSetNow', []).toString();
|
||||
}
|
||||
|
||||
+51
-40
@@ -10,14 +10,14 @@ class Query {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final result = <String, dynamic>{};
|
||||
|
||||
|
||||
result['method'] = method;
|
||||
|
||||
if(attribute != null) {
|
||||
|
||||
if (attribute != null) {
|
||||
result['attribute'] = attribute;
|
||||
}
|
||||
|
||||
if(values != null) {
|
||||
|
||||
if (values != null) {
|
||||
result['values'] = values is List ? values : [values];
|
||||
}
|
||||
|
||||
@@ -28,7 +28,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.
|
||||
@@ -140,50 +140,46 @@ class Query {
|
||||
Query._('notEndsWith', attribute, value).toString();
|
||||
|
||||
/// Filter resources where document was created before [value].
|
||||
static String createdBefore(String value) =>
|
||||
lessThan('\$createdAt', value);
|
||||
static String createdBefore(String value) => lessThan('\$createdAt', value);
|
||||
|
||||
/// Filter resources where document was created after [value].
|
||||
static String createdAfter(String value) =>
|
||||
greaterThan('\$createdAt', value);
|
||||
static String createdAfter(String value) => greaterThan('\$createdAt', value);
|
||||
|
||||
/// Filter resources where document was created between [start] and [end] (inclusive).
|
||||
static String createdBetween(String start, String end) =>
|
||||
between('\$createdAt', start, end);
|
||||
|
||||
/// Filter resources where document was updated before [value].
|
||||
static String updatedBefore(String value) =>
|
||||
lessThan('\$updatedAt', value);
|
||||
static String updatedBefore(String value) => lessThan('\$updatedAt', value);
|
||||
|
||||
/// Filter resources where document was updated after [value].
|
||||
static String updatedAfter(String value) =>
|
||||
greaterThan('\$updatedAt', value);
|
||||
static String updatedAfter(String value) => greaterThan('\$updatedAt', value);
|
||||
|
||||
/// Filter resources where document was updated between [start] and [end] (inclusive).
|
||||
static String updatedBetween(String start, String end) =>
|
||||
between('\$updatedAt', start, end);
|
||||
|
||||
static String or(List<String> queries) => Query._(
|
||||
'or',
|
||||
null,
|
||||
queries.map((query) => jsonDecode(query)).toList(),
|
||||
).toString();
|
||||
'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();
|
||||
'and',
|
||||
null,
|
||||
queries.map((query) => jsonDecode(query)).toList(),
|
||||
).toString();
|
||||
|
||||
/// Filter array elements where at least one element matches all the specified queries.
|
||||
///
|
||||
/// [attribute] The attribute containing the array to filter on.
|
||||
/// [queries] The list of query strings to match against array elements.
|
||||
static String elemMatch(String attribute, List<String> queries) => Query._(
|
||||
'elemMatch',
|
||||
attribute,
|
||||
queries.map((query) => jsonDecode(query)).toList(),
|
||||
).toString();
|
||||
'elemMatch',
|
||||
attribute,
|
||||
queries.map((query) => jsonDecode(query)).toList(),
|
||||
).toString();
|
||||
|
||||
/// Specify which attributes should be returned by the API call.
|
||||
static String select(List<String> attributes) =>
|
||||
@@ -198,18 +194,17 @@ class Query {
|
||||
Query._('orderDesc', attribute).toString();
|
||||
|
||||
/// Sort results randomly.
|
||||
static String orderRandom() =>
|
||||
Query._('orderRandom').toString();
|
||||
static String orderRandom() => Query._('orderRandom').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();
|
||||
|
||||
/// 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) =>
|
||||
@@ -219,27 +214,43 @@ class Query {
|
||||
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();
|
||||
|
||||
/// Filter resources where [attribute] is at a specific distance from the given coordinates.
|
||||
static String distanceEqual(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
|
||||
Query._('distanceEqual', attribute, [[values, distance, meters]]).toString();
|
||||
static String distanceEqual(
|
||||
String attribute, List<dynamic> values, num distance,
|
||||
[bool meters = true]) =>
|
||||
Query._('distanceEqual', attribute, [
|
||||
[values, distance, meters]
|
||||
]).toString();
|
||||
|
||||
/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
|
||||
static String distanceNotEqual(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
|
||||
Query._('distanceNotEqual', attribute, [[values, distance, meters]]).toString();
|
||||
static String distanceNotEqual(
|
||||
String attribute, List<dynamic> values, num distance,
|
||||
[bool meters = true]) =>
|
||||
Query._('distanceNotEqual', attribute, [
|
||||
[values, distance, meters]
|
||||
]).toString();
|
||||
|
||||
/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
|
||||
static String distanceGreaterThan(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
|
||||
Query._('distanceGreaterThan', attribute, [[values, distance, meters]]).toString();
|
||||
static String distanceGreaterThan(
|
||||
String attribute, List<dynamic> values, num distance,
|
||||
[bool meters = true]) =>
|
||||
Query._('distanceGreaterThan', attribute, [
|
||||
[values, distance, meters]
|
||||
]).toString();
|
||||
|
||||
/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
|
||||
static String distanceLessThan(String attribute, List<dynamic> values, num distance, [bool meters = true]) =>
|
||||
Query._('distanceLessThan', attribute, [[values, distance, meters]]).toString();
|
||||
static String distanceLessThan(
|
||||
String attribute, List<dynamic> values, num distance,
|
||||
[bool meters = true]) =>
|
||||
Query._('distanceLessThan', attribute, [
|
||||
[values, distance, meters]
|
||||
]).toString();
|
||||
|
||||
/// Filter resources where [attribute] intersects with the given geometry.
|
||||
static String intersects(String attribute, List<dynamic> values) =>
|
||||
@@ -272,4 +283,4 @@ class Query {
|
||||
/// Filter resources where [attribute] does not touch the given geometry.
|
||||
static String notTouches(String attribute, List<dynamic> values) =>
|
||||
Query._('notTouches', attribute, [values]).toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
export 'src/realtime_browser.dart';
|
||||
export 'src/realtime_browser.dart';
|
||||
|
||||
@@ -1 +1 @@
|
||||
export 'src/realtime_io.dart';
|
||||
export 'src/realtime_io.dart';
|
||||
|
||||
+1
-1
@@ -63,4 +63,4 @@ class Role {
|
||||
static String label(String name) {
|
||||
return 'label:$name';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+660
-702
File diff suppressed because it is too large
Load Diff
+152
-165
@@ -1,7 +1,7 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Avatars service aims to help you complete everyday tasks related to
|
||||
/// your app image, icons, and avatars.
|
||||
/// The Avatars service aims to help you complete everyday tasks related to
|
||||
/// your app image, icons, and avatars.
|
||||
class Avatars extends Service {
|
||||
/// Initializes a [Avatars] service
|
||||
Avatars(super.client);
|
||||
@@ -11,134 +11,129 @@ class Avatars extends Service {
|
||||
/// /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);
|
||||
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 = {
|
||||
|
||||
if (width != null) 'width': width,
|
||||
final Map<String, dynamic> params = {
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (quality != null) 'quality': quality,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (quality != null) 'quality': quality,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// 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);
|
||||
///
|
||||
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 Map<String, dynamic> params = {
|
||||
|
||||
if (width != null) 'width': width,
|
||||
final Map<String, dynamic> params = {
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (quality != null) 'quality': quality,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (quality != null) 'quality': quality,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
const String apiPath = '/avatars/favicon';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
'url': url,
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// 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);
|
||||
///
|
||||
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 = {
|
||||
|
||||
if (width != null) 'width': width,
|
||||
final Map<String, dynamic> params = {
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (quality != null) 'quality': quality,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (quality != null) 'quality': quality,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
Future<Uint8List> getImage(
|
||||
{required String url, int? width, int? height}) async {
|
||||
const String apiPath = '/avatars/image';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
'url': url,
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (width != null) 'width': width,
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// Use this endpoint to show your user initials avatar icon on your website or
|
||||
@@ -146,122 +141,114 @@ class Avatars extends Service {
|
||||
/// 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 {
|
||||
///
|
||||
Future<Uint8List> getInitials(
|
||||
{String? name, int? width, int? height, String? background}) async {
|
||||
const String apiPath = '/avatars/initials';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
if (name != null) 'name': name,
|
||||
final Map<String, dynamic> params = {
|
||||
if (name != null) 'name': name,
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (background != null) 'background': background,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (width != null) 'width': width,
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (background != null) 'background': background,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
///
|
||||
Future<Uint8List> getQR(
|
||||
{required String text, int? size, int? margin, bool? download}) async {
|
||||
const String apiPath = '/avatars/qr';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
'text': text,
|
||||
final Map<String, dynamic> params = {
|
||||
'text': text,
|
||||
if (size != null) 'size': size,
|
||||
if (margin != null) 'margin': margin,
|
||||
if (download != null) 'download': download,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (size != null) 'size': size,
|
||||
|
||||
if (margin != null) 'margin': margin,
|
||||
|
||||
if (download != null) 'download': download,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// Use this endpoint to capture a screenshot of any website URL. This endpoint
|
||||
/// uses a headless browser to render the webpage and capture it as an image.
|
||||
///
|
||||
///
|
||||
/// You can configure the browser viewport size, theme, user agent,
|
||||
/// geolocation, permissions, and more. Capture either just the viewport or the
|
||||
/// full page scroll.
|
||||
///
|
||||
///
|
||||
/// When width and height are specified, the image is resized accordingly. If
|
||||
/// both dimensions are 0, the API provides an image at original size. If
|
||||
/// dimensions are not specified, the default viewport size is 1280x720px.
|
||||
Future<Uint8List> getScreenshot({required String url, Map? headers, int? viewportWidth, int? viewportHeight, double? scale, enums.Theme? theme, String? userAgent, bool? fullpage, String? locale, enums.Timezone? timezone, double? latitude, double? longitude, double? accuracy, bool? touch, List<enums.BrowserPermission>? permissions, int? sleep, int? width, int? height, int? quality, enums.ImageFormat? output}) async {
|
||||
Future<Uint8List> getScreenshot(
|
||||
{required String url,
|
||||
Map? headers,
|
||||
int? viewportWidth,
|
||||
int? viewportHeight,
|
||||
double? scale,
|
||||
enums.Theme? theme,
|
||||
String? userAgent,
|
||||
bool? fullpage,
|
||||
String? locale,
|
||||
enums.Timezone? timezone,
|
||||
double? latitude,
|
||||
double? longitude,
|
||||
double? accuracy,
|
||||
bool? touch,
|
||||
List<enums.BrowserPermission>? permissions,
|
||||
int? sleep,
|
||||
int? width,
|
||||
int? height,
|
||||
int? quality,
|
||||
enums.ImageFormat? output}) async {
|
||||
const String apiPath = '/avatars/screenshots';
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
'url': url,
|
||||
final Map<String, dynamic> params = {
|
||||
'url': url,
|
||||
if (headers != null) 'headers': headers,
|
||||
if (viewportWidth != null) 'viewportWidth': viewportWidth,
|
||||
if (viewportHeight != null) 'viewportHeight': viewportHeight,
|
||||
if (scale != null) 'scale': scale,
|
||||
if (theme != null) 'theme': theme.value,
|
||||
if (userAgent != null) 'userAgent': userAgent,
|
||||
if (fullpage != null) 'fullpage': fullpage,
|
||||
if (locale != null) 'locale': locale,
|
||||
if (timezone != null) 'timezone': timezone.value,
|
||||
if (latitude != null) 'latitude': latitude,
|
||||
if (longitude != null) 'longitude': longitude,
|
||||
if (accuracy != null) 'accuracy': accuracy,
|
||||
if (touch != null) 'touch': touch,
|
||||
if (permissions != null)
|
||||
'permissions': permissions.map((e) => e.value).toList(),
|
||||
if (sleep != null) 'sleep': sleep,
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (quality != null) 'quality': quality,
|
||||
if (output != null) 'output': output.value,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (headers != null) 'headers': headers,
|
||||
|
||||
if (viewportWidth != null) 'viewportWidth': viewportWidth,
|
||||
|
||||
if (viewportHeight != null) 'viewportHeight': viewportHeight,
|
||||
|
||||
if (scale != null) 'scale': scale,
|
||||
|
||||
if (theme != null) 'theme': theme.value,
|
||||
|
||||
if (userAgent != null) 'userAgent': userAgent,
|
||||
|
||||
if (fullpage != null) 'fullpage': fullpage,
|
||||
|
||||
if (locale != null) 'locale': locale,
|
||||
|
||||
if (timezone != null) 'timezone': timezone.value,
|
||||
|
||||
if (latitude != null) 'latitude': latitude,
|
||||
|
||||
if (longitude != null) 'longitude': longitude,
|
||||
|
||||
if (accuracy != null) 'accuracy': accuracy,
|
||||
|
||||
if (touch != null) 'touch': touch,
|
||||
|
||||
if (permissions != null) 'permissions': permissions.map((e) => e.value).toList(),
|
||||
|
||||
if (sleep != null) 'sleep': sleep,
|
||||
|
||||
if (width != null) 'width': width,
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (quality != null) 'quality': quality,
|
||||
|
||||
if (output != null) 'output': output.value,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+260
-203
@@ -1,319 +1,376 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Databases service allows you to create structured collections of
|
||||
/// documents, query and filter lists of documents
|
||||
/// The Databases service allows you to create structured collections of
|
||||
/// documents, query and filter lists of documents
|
||||
class Databases extends Service {
|
||||
/// Initializes a [Databases] service
|
||||
Databases(super.client);
|
||||
|
||||
/// List transactions across all databases.
|
||||
Future<models.TransactionList> listTransactions({List<String>? queries}) async {
|
||||
Future<models.TransactionList> listTransactions(
|
||||
{List<String>? queries}) async {
|
||||
const String apiPath = '/databases/transactions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TransactionList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TransactionList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create a new transaction.
|
||||
Future<models.Transaction> createTransaction({int? ttl}) async {
|
||||
const String apiPath = '/databases/transactions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a transaction by its unique ID.
|
||||
Future<models.Transaction> getTransaction({required String transactionId}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> getTransaction(
|
||||
{required String transactionId}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update a transaction, to either commit or roll back its operations.
|
||||
Future<models.Transaction> updateTransaction({required String transactionId, bool? commit, bool? rollback}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> updateTransaction(
|
||||
{required String transactionId, bool? commit, bool? rollback}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (commit != null) 'commit': commit,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (commit != null) 'commit': commit,
|
||||
if (rollback != null) 'rollback': rollback,
|
||||
};
|
||||
|
||||
if (rollback != null) 'rollback': rollback,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a transaction by its unique ID.
|
||||
Future deleteTransaction({required String transactionId}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
final String apiPath = '/databases/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Create multiple operations in a single transaction.
|
||||
Future<models.Transaction> createOperations({required String transactionId, List<Map>? operations}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}/operations'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> createOperations(
|
||||
{required String transactionId, List<Map>? operations}) async {
|
||||
final String apiPath = '/databases/transactions/{transactionId}/operations'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (operations != null) 'operations': operations,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (operations != null) 'operations': operations,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a list of all the user's documents in a given collection. You can use
|
||||
/// the query params to filter your results.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.')
|
||||
Future<models.DocumentList> listDocuments({required String databaseId, required String collectionId, List<String>? queries, String? transactionId, bool? total, int? ttl}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.')
|
||||
Future<models.DocumentList> listDocuments(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
List<String>? queries,
|
||||
String? transactionId,
|
||||
bool? total,
|
||||
int? ttl}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
if (total != null) 'total': total,
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
};
|
||||
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.DocumentList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.DocumentList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create a new Document. Before using this route, you should create a new
|
||||
/// collection resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
||||
/// API or directly from your database console.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.')
|
||||
Future<models.Document> createDocument({required String databaseId, required String collectionId, required String documentId, required Map data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.')
|
||||
Future<models.Document> createDocument(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
required Map data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'documentId': documentId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'documentId': documentId,
|
||||
'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'data': data,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a document by its unique ID. This endpoint response returns a JSON
|
||||
/// object with the document data.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.')
|
||||
Future<models.Document> getDocument({required String databaseId, required String collectionId, required String documentId, List<String>? queries, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.')
|
||||
Future<models.Document> getDocument(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
List<String>? queries,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
};
|
||||
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create or update a Document. Before using this route, you should create a
|
||||
/// new collection resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
||||
/// API or directly from your database console.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.')
|
||||
Future<models.Document> upsertDocument({required String databaseId, required String collectionId, required String documentId, Map? data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.')
|
||||
Future<models.Document> upsertDocument(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
Map? data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update a document by its unique ID. Using the patch method you can pass
|
||||
/// only specific fields that will get updated.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.')
|
||||
Future<models.Document> updateDocument({required String databaseId, required String collectionId, required String documentId, Map? data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.')
|
||||
Future<models.Document> updateDocument(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
Map? data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a document by its unique ID.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.')
|
||||
Future deleteDocument({required String databaseId, required String collectionId, required String documentId, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.')
|
||||
Future deleteDocument(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'transactionId': transactionId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
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;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Decrement a specific attribute of a document by a given value.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.')
|
||||
Future<models.Document> decrementDocumentAttribute({required String databaseId, required String collectionId, required String documentId, required String attribute, double? value, double? min, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId).replaceAll('{attribute}', attribute);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.')
|
||||
Future<models.Document> decrementDocumentAttribute(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
required String attribute,
|
||||
double? value,
|
||||
double? min,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId)
|
||||
.replaceAll('{attribute}', attribute);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
'min': min,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'min': min,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Increment a specific attribute of a document by a given value.
|
||||
@Deprecated('This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.')
|
||||
Future<models.Document> incrementDocumentAttribute({required String databaseId, required String collectionId, required String documentId, required String attribute, double? value, double? max, String? transactionId}) async {
|
||||
final String apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replaceAll('{databaseId}', databaseId).replaceAll('{collectionId}', collectionId).replaceAll('{documentId}', documentId).replaceAll('{attribute}', attribute);
|
||||
@Deprecated(
|
||||
'This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.')
|
||||
Future<models.Document> incrementDocumentAttribute(
|
||||
{required String databaseId,
|
||||
required String collectionId,
|
||||
required String documentId,
|
||||
required String attribute,
|
||||
double? value,
|
||||
double? max,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{collectionId}', collectionId)
|
||||
.replaceAll('{documentId}', documentId)
|
||||
.replaceAll('{attribute}', attribute);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
'max': max,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'max': max,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Document.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+49
-49
@@ -1,79 +1,79 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Functions Service allows you view, create and manage your Cloud
|
||||
/// Functions.
|
||||
/// The Functions Service allows you view, create and manage your Cloud
|
||||
/// Functions.
|
||||
class Functions extends Service {
|
||||
/// Initializes a [Functions] service
|
||||
Functions(super.client);
|
||||
|
||||
/// Get a list of all the current user function execution logs. You can use the
|
||||
/// query params to filter your results.
|
||||
Future<models.ExecutionList> listExecutions({required String functionId, List<String>? queries, bool? total}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions'.replaceAll('{functionId}', functionId);
|
||||
Future<models.ExecutionList> listExecutions(
|
||||
{required String functionId, List<String>? queries, bool? total}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions'
|
||||
.replaceAll('{functionId}', functionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (total != null) 'total': total,
|
||||
};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.ExecutionList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.ExecutionList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Trigger a function execution. The returned object will return you the
|
||||
/// current execution status. You can ping the `Get Execution` endpoint to get
|
||||
/// updates on the current execution status. Once this endpoint is called, your
|
||||
/// function execution process will start asynchronously.
|
||||
Future<models.Execution> createExecution({required String functionId, String? body, bool? xasync, String? path, enums.ExecutionMethod? method, Map? headers, String? scheduledAt}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions'.replaceAll('{functionId}', functionId);
|
||||
Future<models.Execution> createExecution(
|
||||
{required String functionId,
|
||||
String? body,
|
||||
bool? xasync,
|
||||
String? path,
|
||||
enums.ExecutionMethod? method,
|
||||
Map? headers,
|
||||
String? scheduledAt}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions'
|
||||
.replaceAll('{functionId}', functionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (body != null) 'body': body,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (body != null) 'body': body,
|
||||
if (xasync != null) 'async': xasync,
|
||||
if (path != null) 'path': path,
|
||||
if (method != null) 'method': method.value,
|
||||
if (headers != null) 'headers': headers,
|
||||
'scheduledAt': scheduledAt,
|
||||
};
|
||||
|
||||
if (xasync != null) 'async': xasync,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
if (path != null) 'path': path,
|
||||
|
||||
if (method != null) 'method': method.value,
|
||||
|
||||
if (headers != null) 'headers': headers,
|
||||
|
||||
'scheduledAt': scheduledAt,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Execution.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Execution.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a function execution log by its unique ID.
|
||||
Future<models.Execution> getExecution({required String functionId, required String executionId}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions/{executionId}'.replaceAll('{functionId}', functionId).replaceAll('{executionId}', executionId);
|
||||
Future<models.Execution> getExecution(
|
||||
{required String functionId, required String executionId}) async {
|
||||
final String apiPath = '/functions/{functionId}/executions/{executionId}'
|
||||
.replaceAll('{functionId}', functionId)
|
||||
.replaceAll('{executionId}', executionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Execution.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Execution.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -1,7 +1,7 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The GraphQL API allows you to query and mutate your Appwrite server using
|
||||
/// GraphQL.
|
||||
/// The GraphQL API allows you to query and mutate your Appwrite server using
|
||||
/// GraphQL.
|
||||
class Graphql extends Service {
|
||||
/// Initializes a [Graphql] service
|
||||
Graphql(super.client);
|
||||
@@ -10,37 +10,37 @@ class Graphql extends Service {
|
||||
Future query({required Map query}) async {
|
||||
const 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 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;
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Execute a GraphQL mutation.
|
||||
Future mutation({required Map query}) async {
|
||||
const String apiPath = '/graphql/mutation';
|
||||
|
||||
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 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;
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+44
-68
@@ -1,7 +1,7 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Locale service allows you to customize your app based on your users'
|
||||
/// location.
|
||||
/// The Locale service allows you to customize your app based on your users'
|
||||
/// location.
|
||||
class Locale extends Service {
|
||||
/// Initializes a [Locale] service
|
||||
Locale(super.client);
|
||||
@@ -10,22 +10,19 @@ class Locale extends Service {
|
||||
/// 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 {
|
||||
const String apiPath = '/locale';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
return models.Locale.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all locale codes in [ISO
|
||||
@@ -33,17 +30,14 @@ class Locale extends Service {
|
||||
Future<models.LocaleCodeList> listCodes() async {
|
||||
const String apiPath = '/locale/codes';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.LocaleCodeList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.LocaleCodeList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all continents. You can use the locale header to get the data in a
|
||||
@@ -51,17 +45,14 @@ class Locale extends Service {
|
||||
Future<models.ContinentList> listContinents() async {
|
||||
const String apiPath = '/locale/continents';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.ContinentList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.ContinentList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all countries. You can use the locale header to get the data in a
|
||||
@@ -69,17 +60,14 @@ class Locale extends Service {
|
||||
Future<models.CountryList> listCountries() async {
|
||||
const String apiPath = '/locale/countries';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all countries that are currently members of the EU. You can use the
|
||||
@@ -87,17 +75,14 @@ class Locale extends Service {
|
||||
Future<models.CountryList> listCountriesEU() async {
|
||||
const String apiPath = '/locale/countries/eu';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CountryList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all countries phone codes. You can use the locale header to get the
|
||||
@@ -105,17 +90,14 @@ class Locale extends Service {
|
||||
Future<models.PhoneList> listCountriesPhones() async {
|
||||
const String apiPath = '/locale/countries/phones';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.PhoneList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.PhoneList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all currencies, including currency symbol, name, plural, and
|
||||
@@ -124,17 +106,14 @@ class Locale extends Service {
|
||||
Future<models.CurrencyList> listCurrencies() async {
|
||||
const String apiPath = '/locale/currencies';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CurrencyList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.CurrencyList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// List of all languages classified by ISO 639-1 including 2-letter code, name
|
||||
@@ -142,16 +121,13 @@ class Locale extends Service {
|
||||
Future<models.LanguageList> listLanguages() async {
|
||||
const String apiPath = '/locale/languages';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
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.LanguageList.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+32
-27
@@ -1,46 +1,51 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Messaging service allows you to send messages to any provider type
|
||||
/// (SMTP, push notification, SMS, etc.).
|
||||
/// The Messaging service allows you to send messages to any provider type
|
||||
/// (SMTP, push notification, SMS, etc.).
|
||||
class Messaging extends Service {
|
||||
/// Initializes a [Messaging] service
|
||||
Messaging(super.client);
|
||||
|
||||
/// Create a new subscriber.
|
||||
Future<models.Subscriber> createSubscriber({required String topicId, required String subscriberId, required String targetId}) async {
|
||||
final String apiPath = '/messaging/topics/{topicId}/subscribers'.replaceAll('{topicId}', topicId);
|
||||
Future<models.Subscriber> createSubscriber(
|
||||
{required String topicId,
|
||||
required String subscriberId,
|
||||
required String targetId}) async {
|
||||
final String apiPath = '/messaging/topics/{topicId}/subscribers'
|
||||
.replaceAll('{topicId}', topicId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'subscriberId': subscriberId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'subscriberId': subscriberId,
|
||||
'targetId': targetId,
|
||||
};
|
||||
|
||||
'targetId': targetId,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Subscriber.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Subscriber.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a subscriber by its unique ID.
|
||||
Future deleteSubscriber({required String topicId, required String subscriberId}) async {
|
||||
final String apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replaceAll('{topicId}', topicId).replaceAll('{subscriberId}', subscriberId);
|
||||
Future deleteSubscriber(
|
||||
{required String topicId, required String subscriberId}) async {
|
||||
final String apiPath =
|
||||
'/messaging/topics/{topicId}/subscribers/{subscriberId}'
|
||||
.replaceAll('{topicId}', topicId)
|
||||
.replaceAll('{subscriberId}', subscriberId);
|
||||
|
||||
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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+148
-138
@@ -1,160 +1,166 @@
|
||||
part of '../appwrite.dart';
|
||||
|
||||
/// The Storage service allows you to manage your project files.
|
||||
/// The Storage service allows you to manage your project files.
|
||||
class Storage extends Service {
|
||||
/// Initializes a [Storage] service
|
||||
Storage(super.client);
|
||||
|
||||
/// 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, bool? total}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
Future<models.FileList> listFiles(
|
||||
{required String bucketId,
|
||||
List<String>? queries,
|
||||
String? search,
|
||||
bool? total}) async {
|
||||
final String apiPath =
|
||||
'/storage/buckets/{bucketId}/files'.replaceAll('{bucketId}', bucketId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (search != null) 'search': search,
|
||||
if (total != null) 'total': total,
|
||||
};
|
||||
|
||||
if (search != null) 'search': search,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.FileList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.FileList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
///
|
||||
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 = {
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'fileId': fileId,
|
||||
'file': file,
|
||||
if (permissions != null) 'permissions': permissions,
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'multipart/form-data',
|
||||
};
|
||||
|
||||
'fileId': fileId,
|
||||
|
||||
'file': file,
|
||||
|
||||
if (permissions != null) 'permissions': permissions,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'multipart/form-data',
|
||||
};
|
||||
|
||||
String idParamName = '';
|
||||
idParamName = 'fileId';
|
||||
final paramName = 'file';
|
||||
final res = await client.chunkedUpload(
|
||||
path: apiPath,
|
||||
params: apiParams,
|
||||
paramName: paramName,
|
||||
idParamName: idParamName,
|
||||
headers: apiHeaders,
|
||||
onProgress: onProgress,
|
||||
);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
String idParamName = '';
|
||||
idParamName = 'fileId';
|
||||
final paramName = 'file';
|
||||
final res = await client.chunkedUpload(
|
||||
path: apiPath,
|
||||
params: apiParams,
|
||||
paramName: paramName,
|
||||
idParamName: idParamName,
|
||||
headers: apiHeaders,
|
||||
onProgress: onProgress,
|
||||
);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
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 Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
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 = {
|
||||
if (name != null) 'name': name,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (name != null) 'name': name,
|
||||
'permissions': permissions,
|
||||
};
|
||||
|
||||
'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);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.File.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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 String apiPath = '/storage/buckets/{bucketId}/files/{fileId}'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
|
||||
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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// 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, String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
Future<Uint8List> getFileDownload(
|
||||
{required String bucketId, required String fileId, String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
if (token != null) 'token': token,
|
||||
final Map<String, dynamic> params = {
|
||||
if (token != null) 'token': token,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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 a file preview image. Currently, this method supports preview for image
|
||||
@@ -162,58 +168,62 @@ class Storage extends Service {
|
||||
/// 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, String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
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,
|
||||
String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
if (width != null) 'width': width,
|
||||
final Map<String, dynamic> params = {
|
||||
if (width != null) 'width': width,
|
||||
if (height != null) 'height': height,
|
||||
if (gravity != null) 'gravity': gravity.value,
|
||||
if (quality != null) 'quality': quality,
|
||||
if (borderWidth != null) 'borderWidth': borderWidth,
|
||||
if (borderColor != null) 'borderColor': borderColor,
|
||||
if (borderRadius != null) 'borderRadius': borderRadius,
|
||||
if (opacity != null) 'opacity': opacity,
|
||||
if (rotation != null) 'rotation': rotation,
|
||||
if (background != null) 'background': background,
|
||||
if (output != null) 'output': output.value,
|
||||
if (token != null) 'token': token,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
if (height != null) 'height': height,
|
||||
|
||||
if (gravity != null) 'gravity': gravity.value,
|
||||
|
||||
if (quality != null) 'quality': quality,
|
||||
|
||||
if (borderWidth != null) 'borderWidth': borderWidth,
|
||||
|
||||
if (borderColor != null) 'borderColor': borderColor,
|
||||
|
||||
if (borderRadius != null) 'borderRadius': borderRadius,
|
||||
|
||||
if (opacity != null) 'opacity': opacity,
|
||||
|
||||
if (rotation != null) 'rotation': rotation,
|
||||
|
||||
if (background != null) 'background': background,
|
||||
|
||||
if (output != null) 'output': output.value,
|
||||
|
||||
if (token != null) 'token': token,
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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 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, String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replaceAll('{bucketId}', bucketId).replaceAll('{fileId}', fileId);
|
||||
Future<Uint8List> getFileView(
|
||||
{required String bucketId, required String fileId, String? token}) async {
|
||||
final String apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'
|
||||
.replaceAll('{bucketId}', bucketId)
|
||||
.replaceAll('{fileId}', fileId);
|
||||
|
||||
final Map<String, dynamic> params = {
|
||||
|
||||
if (token != null) 'token': token,
|
||||
final Map<String, dynamic> params = {
|
||||
if (token != null) 'token': token,
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
|
||||
'project': client.config['project'],
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+240
-193
@@ -5,305 +5,352 @@ class TablesDB extends Service {
|
||||
TablesDB(super.client);
|
||||
|
||||
/// List transactions across all databases.
|
||||
Future<models.TransactionList> listTransactions({List<String>? queries}) async {
|
||||
Future<models.TransactionList> listTransactions(
|
||||
{List<String>? queries}) async {
|
||||
const String apiPath = '/tablesdb/transactions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TransactionList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TransactionList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create a new transaction.
|
||||
Future<models.Transaction> createTransaction({int? ttl}) async {
|
||||
const String apiPath = '/tablesdb/transactions';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a transaction by its unique ID.
|
||||
Future<models.Transaction> getTransaction({required String transactionId}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> getTransaction(
|
||||
{required String transactionId}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update a transaction, to either commit or roll back its operations.
|
||||
Future<models.Transaction> updateTransaction({required String transactionId, bool? commit, bool? rollback}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> updateTransaction(
|
||||
{required String transactionId, bool? commit, bool? rollback}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (commit != null) 'commit': commit,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (commit != null) 'commit': commit,
|
||||
if (rollback != null) 'rollback': rollback,
|
||||
};
|
||||
|
||||
if (rollback != null) 'rollback': rollback,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a transaction by its unique ID.
|
||||
Future deleteTransaction({required String transactionId}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'.replaceAll('{transactionId}', transactionId);
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Create multiple operations in a single transaction.
|
||||
Future<models.Transaction> createOperations({required String transactionId, List<Map>? operations}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}/operations'.replaceAll('{transactionId}', transactionId);
|
||||
Future<models.Transaction> createOperations(
|
||||
{required String transactionId, List<Map>? operations}) async {
|
||||
final String apiPath = '/tablesdb/transactions/{transactionId}/operations'
|
||||
.replaceAll('{transactionId}', transactionId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (operations != null) 'operations': operations,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (operations != null) 'operations': operations,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Transaction.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a list of all the user's rows in a given table. You can use the query
|
||||
/// params to filter your results.
|
||||
Future<models.RowList> listRows({required String databaseId, required String tableId, List<String>? queries, String? transactionId, bool? total, int? ttl}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId);
|
||||
Future<models.RowList> listRows(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
List<String>? queries,
|
||||
String? transactionId,
|
||||
bool? total,
|
||||
int? ttl}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
if (total != null) 'total': total,
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
};
|
||||
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
|
||||
if (ttl != null) 'ttl': ttl,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.RowList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.RowList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create a new Row. Before using this route, you should create a new table
|
||||
/// resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable)
|
||||
/// API or directly from your database console.
|
||||
Future<models.Row> createRow({required String databaseId, required String tableId, required String rowId, required Map data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId);
|
||||
Future<models.Row> createRow(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
required Map data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'rowId': rowId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'rowId': rowId,
|
||||
'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'data': data,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.post, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a row by its unique ID. This endpoint response returns a JSON object
|
||||
/// with the row data.
|
||||
Future<models.Row> getRow({required String databaseId, required String tableId, required String rowId, List<String>? queries, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId);
|
||||
Future<models.Row> getRow(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
List<String>? queries,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
};
|
||||
|
||||
if (transactionId != null) 'transactionId': transactionId,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Create or update a Row. Before using this route, you should create a new
|
||||
/// table resource using either a [server
|
||||
/// integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable)
|
||||
/// API or directly from your database console.
|
||||
Future<models.Row> upsertRow({required String databaseId, required String tableId, required String rowId, Map? data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId);
|
||||
Future<models.Row> upsertRow(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
Map? data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update a row by its unique ID. Using the patch method you can pass only
|
||||
/// specific fields that will get updated.
|
||||
Future<models.Row> updateRow({required String databaseId, required String tableId, required String rowId, Map? data, List<String>? permissions, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId);
|
||||
Future<models.Row> updateRow(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
Map? data,
|
||||
List<String>? permissions,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (data != null) 'data': data,
|
||||
'permissions': permissions,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'permissions': permissions,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a row by its unique ID.
|
||||
Future deleteRow({required String databaseId, required String tableId, required String rowId, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId);
|
||||
Future deleteRow(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'transactionId': transactionId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
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;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Decrement a specific column of a row by a given value.
|
||||
Future<models.Row> decrementRowColumn({required String databaseId, required String tableId, required String rowId, required String column, double? value, double? min, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId).replaceAll('{column}', column);
|
||||
Future<models.Row> decrementRowColumn(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
required String column,
|
||||
double? value,
|
||||
double? min,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId)
|
||||
.replaceAll('{column}', column);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
'min': min,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'min': min,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Increment a specific column of a row by a given value.
|
||||
Future<models.Row> incrementRowColumn({required String databaseId, required String tableId, required String rowId, required String column, double? value, double? max, String? transactionId}) async {
|
||||
final String apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replaceAll('{databaseId}', databaseId).replaceAll('{tableId}', tableId).replaceAll('{rowId}', rowId).replaceAll('{column}', column);
|
||||
Future<models.Row> incrementRowColumn(
|
||||
{required String databaseId,
|
||||
required String tableId,
|
||||
required String rowId,
|
||||
required String column,
|
||||
double? value,
|
||||
double? max,
|
||||
String? transactionId}) async {
|
||||
final String apiPath =
|
||||
'/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'
|
||||
.replaceAll('{databaseId}', databaseId)
|
||||
.replaceAll('{tableId}', tableId)
|
||||
.replaceAll('{rowId}', rowId)
|
||||
.replaceAll('{column}', column);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (value != null) 'value': value,
|
||||
'max': max,
|
||||
'transactionId': transactionId,
|
||||
};
|
||||
|
||||
'max': max,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
'transactionId': transactionId,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.patch, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Row.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+176
-173
@@ -1,94 +1,87 @@
|
||||
part of '../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
|
||||
/// 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 {
|
||||
/// Initializes a [Teams] service
|
||||
Teams(super.client);
|
||||
|
||||
/// 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, bool? total}) async {
|
||||
Future<models.TeamList> list(
|
||||
{List<String>? queries, String? search, bool? total}) async {
|
||||
const String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (search != null) 'search': search,
|
||||
if (total != null) 'total': total,
|
||||
};
|
||||
|
||||
if (search != null) 'search': search,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TeamList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.TeamList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
Future<models.Team> create(
|
||||
{required String teamId,
|
||||
required String name,
|
||||
List<String>? roles}) async {
|
||||
const String apiPath = '/teams';
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'teamId': teamId,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'teamId': teamId,
|
||||
'name': name,
|
||||
if (roles != null) 'roles': roles,
|
||||
};
|
||||
|
||||
'name': name,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
if (roles != null) '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);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Update the team's name by its unique ID.
|
||||
Future<models.Team> updateName({required String teamId, required String name}) async {
|
||||
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, dynamic> apiParams = {
|
||||
'name': name,
|
||||
};
|
||||
|
||||
};
|
||||
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);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Team.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Delete a team using its ID. Only team members with the owner role can
|
||||
@@ -96,42 +89,41 @@ class Teams extends Service {
|
||||
Future delete({required String teamId}) async {
|
||||
final String apiPath = '/teams/{teamId}'.replaceAll('{teamId}', teamId);
|
||||
|
||||
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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// Use this endpoint to list a team's members using the team's ID. All team
|
||||
/// members have read access to this endpoint. Hide sensitive attributes from
|
||||
/// the response by toggling membership privacy in the Console.
|
||||
Future<models.MembershipList> listMemberships({required String teamId, List<String>? queries, String? search, bool? total}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
Future<models.MembershipList> listMemberships(
|
||||
{required String teamId,
|
||||
List<String>? queries,
|
||||
String? search,
|
||||
bool? total}) async {
|
||||
final String apiPath =
|
||||
'/teams/{teamId}/memberships'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (queries != null) 'queries': queries,
|
||||
if (search != null) 'search': search,
|
||||
if (total != null) 'total': total,
|
||||
};
|
||||
|
||||
if (search != null) 'search': search,
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
if (total != null) 'total': total,
|
||||
|
||||
};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.MembershipList.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.MembershipList.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Invite a new member to join your team. Provide an ID for existing users, or
|
||||
@@ -140,173 +132,184 @@ class Teams extends Service {
|
||||
/// 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.
|
||||
///
|
||||
/// 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);
|
||||
///
|
||||
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 = {
|
||||
if (email != null) 'email': email,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
if (email != null) 'email': email,
|
||||
if (userId != null) 'userId': userId,
|
||||
if (phone != null) 'phone': phone,
|
||||
'roles': roles,
|
||||
if (url != null) 'url': url,
|
||||
if (name != null) 'name': name,
|
||||
};
|
||||
|
||||
if (userId != null) 'userId': userId,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
if (phone != null) 'phone': phone,
|
||||
|
||||
'roles': roles,
|
||||
|
||||
if (url != null) 'url': url,
|
||||
|
||||
if (name != null) '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);
|
||||
final res = await client.call(HttpMethod.post,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// Get a team member by the membership unique id. All team members have read
|
||||
/// access for this resource. Hide sensitive attributes from the response by
|
||||
/// toggling membership privacy in the Console.
|
||||
Future<models.Membership> getMembership({required String teamId, required String membershipId}) async {
|
||||
final String apiPath = '/teams/{teamId}/memberships/{membershipId}'.replaceAll('{teamId}', teamId).replaceAll('{membershipId}', membershipId);
|
||||
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, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
///
|
||||
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, dynamic> apiParams = {
|
||||
'roles': roles,
|
||||
};
|
||||
|
||||
};
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
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);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
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, 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.delete, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
final res = await client.call(HttpMethod.delete,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/// 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);
|
||||
///
|
||||
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,
|
||||
final Map<String, dynamic> apiParams = {
|
||||
'userId': userId,
|
||||
'secret': secret,
|
||||
};
|
||||
|
||||
'secret': secret,
|
||||
final Map<String, String> apiHeaders = {
|
||||
'content-type': 'application/json',
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
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);
|
||||
final res = await client.call(HttpMethod.patch,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Membership.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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 String apiPath =
|
||||
'/teams/{teamId}/prefs'.replaceAll('{teamId}', teamId);
|
||||
|
||||
final Map<String, dynamic> apiParams = {
|
||||
};
|
||||
final Map<String, dynamic> apiParams = {};
|
||||
|
||||
final Map<String, String> apiHeaders = {
|
||||
final Map<String, String> apiHeaders = {};
|
||||
|
||||
};
|
||||
|
||||
final res = await client.call(HttpMethod.get, path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.get,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
}
|
||||
|
||||
/// 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);
|
||||
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, dynamic> apiParams = {
|
||||
'prefs': prefs,
|
||||
};
|
||||
|
||||
};
|
||||
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);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
final res = await client.call(HttpMethod.put,
|
||||
path: apiPath, params: apiParams, headers: apiHeaders);
|
||||
|
||||
return models.Preferences.fromMap(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@ abstract class Client {
|
||||
factory Client({
|
||||
String endPoint = 'https://cloud.appwrite.io/v1',
|
||||
bool selfSigned = false,
|
||||
}) => createClient(endPoint: endPoint, selfSigned: selfSigned);
|
||||
}) =>
|
||||
createClient(endPoint: endPoint, selfSigned: selfSigned);
|
||||
|
||||
/// Handle OAuth2 session creation.
|
||||
Future webAuth(Uri url, {String? callbackUrlScheme});
|
||||
|
||||
@@ -6,14 +6,17 @@ abstract class ClientBase implements Client {
|
||||
/// Your project ID
|
||||
@override
|
||||
ClientBase setProject(value);
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientBase setJWT(value);
|
||||
@override
|
||||
ClientBase setLocale(value);
|
||||
|
||||
/// The user session to authenticate with
|
||||
@override
|
||||
ClientBase setSession(value);
|
||||
|
||||
/// Your secret dev API key
|
||||
@override
|
||||
ClientBase setDevKey(value);
|
||||
|
||||
@@ -63,6 +63,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientBrowser setJWT(value) {
|
||||
@@ -70,12 +71,14 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
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) {
|
||||
@@ -83,6 +86,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret dev API key
|
||||
@override
|
||||
ClientBrowser setDevKey(value) {
|
||||
|
||||
@@ -89,6 +89,7 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
addHeader('X-Appwrite-Project', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret JSON Web Token
|
||||
@override
|
||||
ClientIO setJWT(value) {
|
||||
@@ -96,12 +97,14 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
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) {
|
||||
@@ -109,6 +112,7 @@ class ClientIO extends ClientBase with ClientMixin {
|
||||
addHeader('X-Appwrite-Session', value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// Your secret dev API key
|
||||
@override
|
||||
ClientIO setDevKey(value) {
|
||||
|
||||
@@ -12,7 +12,6 @@ mixin ClientMixin {
|
||||
required Map<String, String> headers,
|
||||
required Map<String, dynamic> params,
|
||||
}) {
|
||||
|
||||
http.BaseRequest request = http.Request(method.name(), uri);
|
||||
if (headers['content-type'] == 'multipart/form-data') {
|
||||
request = http.MultipartRequest(method.name(), uri);
|
||||
@@ -128,9 +127,13 @@ mixin ClientMixin {
|
||||
http.StreamedResponse streamedResponse,
|
||||
) async {
|
||||
if (streamedResponse.statusCode == 204) {
|
||||
return http.Response('',
|
||||
return http.Response(
|
||||
'',
|
||||
streamedResponse.statusCode,
|
||||
headers: streamedResponse.headers.map((k,v) => k.toLowerCase()=='content-type' ? MapEntry(k, 'text/plain') : MapEntry(k,v)),
|
||||
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,
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
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,13 +1,11 @@
|
||||
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;
|
||||
}
|
||||
|
||||
+18
-20
@@ -1,26 +1,24 @@
|
||||
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,32 +1,30 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum BrowserPermission {
|
||||
geolocation(value: 'geolocation'),
|
||||
camera(value: 'camera'),
|
||||
microphone(value: 'microphone'),
|
||||
notifications(value: 'notifications'),
|
||||
midi(value: 'midi'),
|
||||
push(value: 'push'),
|
||||
clipboardRead(value: 'clipboard-read'),
|
||||
clipboardWrite(value: 'clipboard-write'),
|
||||
paymentHandler(value: 'payment-handler'),
|
||||
usb(value: 'usb'),
|
||||
bluetooth(value: 'bluetooth'),
|
||||
accelerometer(value: 'accelerometer'),
|
||||
gyroscope(value: 'gyroscope'),
|
||||
magnetometer(value: 'magnetometer'),
|
||||
ambientLightSensor(value: 'ambient-light-sensor'),
|
||||
backgroundSync(value: 'background-sync'),
|
||||
persistentStorage(value: 'persistent-storage'),
|
||||
screenWakeLock(value: 'screen-wake-lock'),
|
||||
webShare(value: 'web-share'),
|
||||
xrSpatialTracking(value: 'xr-spatial-tracking');
|
||||
geolocation(value: 'geolocation'),
|
||||
camera(value: 'camera'),
|
||||
microphone(value: 'microphone'),
|
||||
notifications(value: 'notifications'),
|
||||
midi(value: 'midi'),
|
||||
push(value: 'push'),
|
||||
clipboardRead(value: 'clipboard-read'),
|
||||
clipboardWrite(value: 'clipboard-write'),
|
||||
paymentHandler(value: 'payment-handler'),
|
||||
usb(value: 'usb'),
|
||||
bluetooth(value: 'bluetooth'),
|
||||
accelerometer(value: 'accelerometer'),
|
||||
gyroscope(value: 'gyroscope'),
|
||||
magnetometer(value: 'magnetometer'),
|
||||
ambientLightSensor(value: 'ambient-light-sensor'),
|
||||
backgroundSync(value: 'background-sync'),
|
||||
persistentStorage(value: 'persistent-storage'),
|
||||
screenWakeLock(value: 'screen-wake-lock'),
|
||||
webShare(value: 'web-share'),
|
||||
xrSpatialTracking(value: 'xr-spatial-tracking');
|
||||
|
||||
const BrowserPermission({
|
||||
required this.value
|
||||
});
|
||||
const BrowserPermission({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
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'),
|
||||
unionPay(value: 'unionpay'),
|
||||
visa(value: 'visa'),
|
||||
mIR(value: 'mir'),
|
||||
maestro(value: 'maestro'),
|
||||
rupay(value: 'rupay');
|
||||
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'),
|
||||
unionPay(value: 'unionpay'),
|
||||
visa(value: 'visa'),
|
||||
mIR(value: 'mir'),
|
||||
maestro(value: 'maestro'),
|
||||
rupay(value: 'rupay');
|
||||
|
||||
const CreditCard({
|
||||
required this.value
|
||||
});
|
||||
const CreditCard({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ExecutionMethod {
|
||||
gET(value: 'GET'),
|
||||
pOST(value: 'POST'),
|
||||
pUT(value: 'PUT'),
|
||||
pATCH(value: 'PATCH'),
|
||||
dELETE(value: 'DELETE'),
|
||||
oPTIONS(value: 'OPTIONS'),
|
||||
hEAD(value: 'HEAD');
|
||||
gET(value: 'GET'),
|
||||
pOST(value: 'POST'),
|
||||
pUT(value: 'PUT'),
|
||||
pATCH(value: 'PATCH'),
|
||||
dELETE(value: 'DELETE'),
|
||||
oPTIONS(value: 'OPTIONS'),
|
||||
hEAD(value: 'HEAD');
|
||||
|
||||
const ExecutionMethod({
|
||||
required this.value
|
||||
});
|
||||
const ExecutionMethod({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ExecutionStatus {
|
||||
waiting(value: 'waiting'),
|
||||
processing(value: 'processing'),
|
||||
completed(value: 'completed'),
|
||||
failed(value: 'failed'),
|
||||
scheduled(value: 'scheduled');
|
||||
waiting(value: 'waiting'),
|
||||
processing(value: 'processing'),
|
||||
completed(value: 'completed'),
|
||||
failed(value: 'failed'),
|
||||
scheduled(value: 'scheduled');
|
||||
|
||||
const ExecutionStatus({
|
||||
required this.value
|
||||
});
|
||||
const ExecutionStatus({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ExecutionTrigger {
|
||||
http(value: 'http'),
|
||||
schedule(value: 'schedule'),
|
||||
event(value: 'event');
|
||||
http(value: 'http'),
|
||||
schedule(value: 'schedule'),
|
||||
event(value: 'event');
|
||||
|
||||
const ExecutionTrigger({
|
||||
required this.value
|
||||
});
|
||||
const ExecutionTrigger({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
+199
-201
@@ -1,207 +1,205 @@
|
||||
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,19 +1,17 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum ImageFormat {
|
||||
jpg(value: 'jpg'),
|
||||
jpeg(value: 'jpeg'),
|
||||
png(value: 'png'),
|
||||
webp(value: 'webp'),
|
||||
heic(value: 'heic'),
|
||||
avif(value: 'avif'),
|
||||
gif(value: 'gif');
|
||||
jpg(value: 'jpg'),
|
||||
jpeg(value: 'jpeg'),
|
||||
png(value: 'png'),
|
||||
webp(value: 'webp'),
|
||||
heic(value: 'heic'),
|
||||
avif(value: 'avif'),
|
||||
gif(value: 'gif');
|
||||
|
||||
const ImageFormat({
|
||||
required this.value
|
||||
});
|
||||
const ImageFormat({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
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,51 +1,49 @@
|
||||
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'),
|
||||
figma(value: 'figma'),
|
||||
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');
|
||||
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'),
|
||||
figma(value: 'figma'),
|
||||
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');
|
||||
|
||||
const OAuthProvider({
|
||||
required this.value
|
||||
});
|
||||
const OAuthProvider({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Theme {
|
||||
light(value: 'light'),
|
||||
dark(value: 'dark');
|
||||
light(value: 'light'),
|
||||
dark(value: 'dark');
|
||||
|
||||
const Theme({
|
||||
required this.value
|
||||
});
|
||||
const Theme({required this.value});
|
||||
|
||||
final String value;
|
||||
final String value;
|
||||
|
||||
String toJson() => value;
|
||||
}
|
||||
String toJson() => value;
|
||||
}
|
||||
|
||||
+423
-425
@@ -1,431 +1,429 @@
|
||||
part of '../../enums.dart';
|
||||
|
||||
enum Timezone {
|
||||
africaAbidjan(value: 'africa/abidjan'),
|
||||
africaAccra(value: 'africa/accra'),
|
||||
africaAddisAbaba(value: 'africa/addis_ababa'),
|
||||
africaAlgiers(value: 'africa/algiers'),
|
||||
africaAsmara(value: 'africa/asmara'),
|
||||
africaBamako(value: 'africa/bamako'),
|
||||
africaBangui(value: 'africa/bangui'),
|
||||
africaBanjul(value: 'africa/banjul'),
|
||||
africaBissau(value: 'africa/bissau'),
|
||||
africaBlantyre(value: 'africa/blantyre'),
|
||||
africaBrazzaville(value: 'africa/brazzaville'),
|
||||
africaBujumbura(value: 'africa/bujumbura'),
|
||||
africaCairo(value: 'africa/cairo'),
|
||||
africaCasablanca(value: 'africa/casablanca'),
|
||||
africaCeuta(value: 'africa/ceuta'),
|
||||
africaConakry(value: 'africa/conakry'),
|
||||
africaDakar(value: 'africa/dakar'),
|
||||
africaDarEsSalaam(value: 'africa/dar_es_salaam'),
|
||||
africaDjibouti(value: 'africa/djibouti'),
|
||||
africaDouala(value: 'africa/douala'),
|
||||
africaElAaiun(value: 'africa/el_aaiun'),
|
||||
africaFreetown(value: 'africa/freetown'),
|
||||
africaGaborone(value: 'africa/gaborone'),
|
||||
africaHarare(value: 'africa/harare'),
|
||||
africaJohannesburg(value: 'africa/johannesburg'),
|
||||
africaJuba(value: 'africa/juba'),
|
||||
africaKampala(value: 'africa/kampala'),
|
||||
africaKhartoum(value: 'africa/khartoum'),
|
||||
africaKigali(value: 'africa/kigali'),
|
||||
africaKinshasa(value: 'africa/kinshasa'),
|
||||
africaLagos(value: 'africa/lagos'),
|
||||
africaLibreville(value: 'africa/libreville'),
|
||||
africaLome(value: 'africa/lome'),
|
||||
africaLuanda(value: 'africa/luanda'),
|
||||
africaLubumbashi(value: 'africa/lubumbashi'),
|
||||
africaLusaka(value: 'africa/lusaka'),
|
||||
africaMalabo(value: 'africa/malabo'),
|
||||
africaMaputo(value: 'africa/maputo'),
|
||||
africaMaseru(value: 'africa/maseru'),
|
||||
africaMbabane(value: 'africa/mbabane'),
|
||||
africaMogadishu(value: 'africa/mogadishu'),
|
||||
africaMonrovia(value: 'africa/monrovia'),
|
||||
africaNairobi(value: 'africa/nairobi'),
|
||||
africaNdjamena(value: 'africa/ndjamena'),
|
||||
africaNiamey(value: 'africa/niamey'),
|
||||
africaNouakchott(value: 'africa/nouakchott'),
|
||||
africaOuagadougou(value: 'africa/ouagadougou'),
|
||||
africaPortoNovo(value: 'africa/porto-novo'),
|
||||
africaSaoTome(value: 'africa/sao_tome'),
|
||||
africaTripoli(value: 'africa/tripoli'),
|
||||
africaTunis(value: 'africa/tunis'),
|
||||
africaWindhoek(value: 'africa/windhoek'),
|
||||
americaAdak(value: 'america/adak'),
|
||||
americaAnchorage(value: 'america/anchorage'),
|
||||
americaAnguilla(value: 'america/anguilla'),
|
||||
americaAntigua(value: 'america/antigua'),
|
||||
americaAraguaina(value: 'america/araguaina'),
|
||||
americaArgentinaBuenosAires(value: 'america/argentina/buenos_aires'),
|
||||
americaArgentinaCatamarca(value: 'america/argentina/catamarca'),
|
||||
americaArgentinaCordoba(value: 'america/argentina/cordoba'),
|
||||
americaArgentinaJujuy(value: 'america/argentina/jujuy'),
|
||||
americaArgentinaLaRioja(value: 'america/argentina/la_rioja'),
|
||||
americaArgentinaMendoza(value: 'america/argentina/mendoza'),
|
||||
americaArgentinaRioGallegos(value: 'america/argentina/rio_gallegos'),
|
||||
americaArgentinaSalta(value: 'america/argentina/salta'),
|
||||
americaArgentinaSanJuan(value: 'america/argentina/san_juan'),
|
||||
americaArgentinaSanLuis(value: 'america/argentina/san_luis'),
|
||||
americaArgentinaTucuman(value: 'america/argentina/tucuman'),
|
||||
americaArgentinaUshuaia(value: 'america/argentina/ushuaia'),
|
||||
americaAruba(value: 'america/aruba'),
|
||||
americaAsuncion(value: 'america/asuncion'),
|
||||
americaAtikokan(value: 'america/atikokan'),
|
||||
americaBahia(value: 'america/bahia'),
|
||||
americaBahiaBanderas(value: 'america/bahia_banderas'),
|
||||
americaBarbados(value: 'america/barbados'),
|
||||
americaBelem(value: 'america/belem'),
|
||||
americaBelize(value: 'america/belize'),
|
||||
americaBlancSablon(value: 'america/blanc-sablon'),
|
||||
americaBoaVista(value: 'america/boa_vista'),
|
||||
americaBogota(value: 'america/bogota'),
|
||||
americaBoise(value: 'america/boise'),
|
||||
americaCambridgeBay(value: 'america/cambridge_bay'),
|
||||
americaCampoGrande(value: 'america/campo_grande'),
|
||||
americaCancun(value: 'america/cancun'),
|
||||
americaCaracas(value: 'america/caracas'),
|
||||
americaCayenne(value: 'america/cayenne'),
|
||||
americaCayman(value: 'america/cayman'),
|
||||
americaChicago(value: 'america/chicago'),
|
||||
americaChihuahua(value: 'america/chihuahua'),
|
||||
americaCiudadJuarez(value: 'america/ciudad_juarez'),
|
||||
americaCostaRica(value: 'america/costa_rica'),
|
||||
americaCoyhaique(value: 'america/coyhaique'),
|
||||
americaCreston(value: 'america/creston'),
|
||||
americaCuiaba(value: 'america/cuiaba'),
|
||||
americaCuracao(value: 'america/curacao'),
|
||||
americaDanmarkshavn(value: 'america/danmarkshavn'),
|
||||
americaDawson(value: 'america/dawson'),
|
||||
americaDawsonCreek(value: 'america/dawson_creek'),
|
||||
americaDenver(value: 'america/denver'),
|
||||
americaDetroit(value: 'america/detroit'),
|
||||
americaDominica(value: 'america/dominica'),
|
||||
americaEdmonton(value: 'america/edmonton'),
|
||||
americaEirunepe(value: 'america/eirunepe'),
|
||||
americaElSalvador(value: 'america/el_salvador'),
|
||||
americaFortNelson(value: 'america/fort_nelson'),
|
||||
americaFortaleza(value: 'america/fortaleza'),
|
||||
americaGlaceBay(value: 'america/glace_bay'),
|
||||
americaGooseBay(value: 'america/goose_bay'),
|
||||
americaGrandTurk(value: 'america/grand_turk'),
|
||||
americaGrenada(value: 'america/grenada'),
|
||||
americaGuadeloupe(value: 'america/guadeloupe'),
|
||||
americaGuatemala(value: 'america/guatemala'),
|
||||
americaGuayaquil(value: 'america/guayaquil'),
|
||||
americaGuyana(value: 'america/guyana'),
|
||||
americaHalifax(value: 'america/halifax'),
|
||||
americaHavana(value: 'america/havana'),
|
||||
americaHermosillo(value: 'america/hermosillo'),
|
||||
americaIndianaIndianapolis(value: 'america/indiana/indianapolis'),
|
||||
americaIndianaKnox(value: 'america/indiana/knox'),
|
||||
americaIndianaMarengo(value: 'america/indiana/marengo'),
|
||||
americaIndianaPetersburg(value: 'america/indiana/petersburg'),
|
||||
americaIndianaTellCity(value: 'america/indiana/tell_city'),
|
||||
americaIndianaVevay(value: 'america/indiana/vevay'),
|
||||
americaIndianaVincennes(value: 'america/indiana/vincennes'),
|
||||
americaIndianaWinamac(value: 'america/indiana/winamac'),
|
||||
americaInuvik(value: 'america/inuvik'),
|
||||
americaIqaluit(value: 'america/iqaluit'),
|
||||
americaJamaica(value: 'america/jamaica'),
|
||||
americaJuneau(value: 'america/juneau'),
|
||||
americaKentuckyLouisville(value: 'america/kentucky/louisville'),
|
||||
americaKentuckyMonticello(value: 'america/kentucky/monticello'),
|
||||
americaKralendijk(value: 'america/kralendijk'),
|
||||
americaLaPaz(value: 'america/la_paz'),
|
||||
americaLima(value: 'america/lima'),
|
||||
americaLosAngeles(value: 'america/los_angeles'),
|
||||
americaLowerPrinces(value: 'america/lower_princes'),
|
||||
americaMaceio(value: 'america/maceio'),
|
||||
americaManagua(value: 'america/managua'),
|
||||
americaManaus(value: 'america/manaus'),
|
||||
americaMarigot(value: 'america/marigot'),
|
||||
americaMartinique(value: 'america/martinique'),
|
||||
americaMatamoros(value: 'america/matamoros'),
|
||||
americaMazatlan(value: 'america/mazatlan'),
|
||||
americaMenominee(value: 'america/menominee'),
|
||||
americaMerida(value: 'america/merida'),
|
||||
americaMetlakatla(value: 'america/metlakatla'),
|
||||
americaMexicoCity(value: 'america/mexico_city'),
|
||||
americaMiquelon(value: 'america/miquelon'),
|
||||
americaMoncton(value: 'america/moncton'),
|
||||
americaMonterrey(value: 'america/monterrey'),
|
||||
americaMontevideo(value: 'america/montevideo'),
|
||||
americaMontserrat(value: 'america/montserrat'),
|
||||
americaNassau(value: 'america/nassau'),
|
||||
americaNewYork(value: 'america/new_york'),
|
||||
americaNome(value: 'america/nome'),
|
||||
americaNoronha(value: 'america/noronha'),
|
||||
americaNorthDakotaBeulah(value: 'america/north_dakota/beulah'),
|
||||
americaNorthDakotaCenter(value: 'america/north_dakota/center'),
|
||||
americaNorthDakotaNewSalem(value: 'america/north_dakota/new_salem'),
|
||||
americaNuuk(value: 'america/nuuk'),
|
||||
americaOjinaga(value: 'america/ojinaga'),
|
||||
americaPanama(value: 'america/panama'),
|
||||
americaParamaribo(value: 'america/paramaribo'),
|
||||
americaPhoenix(value: 'america/phoenix'),
|
||||
americaPortAuPrince(value: 'america/port-au-prince'),
|
||||
americaPortOfSpain(value: 'america/port_of_spain'),
|
||||
americaPortoVelho(value: 'america/porto_velho'),
|
||||
americaPuertoRico(value: 'america/puerto_rico'),
|
||||
americaPuntaArenas(value: 'america/punta_arenas'),
|
||||
americaRankinInlet(value: 'america/rankin_inlet'),
|
||||
americaRecife(value: 'america/recife'),
|
||||
americaRegina(value: 'america/regina'),
|
||||
americaResolute(value: 'america/resolute'),
|
||||
americaRioBranco(value: 'america/rio_branco'),
|
||||
americaSantarem(value: 'america/santarem'),
|
||||
americaSantiago(value: 'america/santiago'),
|
||||
americaSantoDomingo(value: 'america/santo_domingo'),
|
||||
americaSaoPaulo(value: 'america/sao_paulo'),
|
||||
americaScoresbysund(value: 'america/scoresbysund'),
|
||||
americaSitka(value: 'america/sitka'),
|
||||
americaStBarthelemy(value: 'america/st_barthelemy'),
|
||||
americaStJohns(value: 'america/st_johns'),
|
||||
americaStKitts(value: 'america/st_kitts'),
|
||||
americaStLucia(value: 'america/st_lucia'),
|
||||
americaStThomas(value: 'america/st_thomas'),
|
||||
americaStVincent(value: 'america/st_vincent'),
|
||||
americaSwiftCurrent(value: 'america/swift_current'),
|
||||
americaTegucigalpa(value: 'america/tegucigalpa'),
|
||||
americaThule(value: 'america/thule'),
|
||||
americaTijuana(value: 'america/tijuana'),
|
||||
americaToronto(value: 'america/toronto'),
|
||||
americaTortola(value: 'america/tortola'),
|
||||
americaVancouver(value: 'america/vancouver'),
|
||||
americaWhitehorse(value: 'america/whitehorse'),
|
||||
americaWinnipeg(value: 'america/winnipeg'),
|
||||
americaYakutat(value: 'america/yakutat'),
|
||||
antarcticaCasey(value: 'antarctica/casey'),
|
||||
antarcticaDavis(value: 'antarctica/davis'),
|
||||
antarcticaDumontdurville(value: 'antarctica/dumontdurville'),
|
||||
antarcticaMacquarie(value: 'antarctica/macquarie'),
|
||||
antarcticaMawson(value: 'antarctica/mawson'),
|
||||
antarcticaMcmurdo(value: 'antarctica/mcmurdo'),
|
||||
antarcticaPalmer(value: 'antarctica/palmer'),
|
||||
antarcticaRothera(value: 'antarctica/rothera'),
|
||||
antarcticaSyowa(value: 'antarctica/syowa'),
|
||||
antarcticaTroll(value: 'antarctica/troll'),
|
||||
antarcticaVostok(value: 'antarctica/vostok'),
|
||||
arcticLongyearbyen(value: 'arctic/longyearbyen'),
|
||||
asiaAden(value: 'asia/aden'),
|
||||
asiaAlmaty(value: 'asia/almaty'),
|
||||
asiaAmman(value: 'asia/amman'),
|
||||
asiaAnadyr(value: 'asia/anadyr'),
|
||||
asiaAqtau(value: 'asia/aqtau'),
|
||||
asiaAqtobe(value: 'asia/aqtobe'),
|
||||
asiaAshgabat(value: 'asia/ashgabat'),
|
||||
asiaAtyrau(value: 'asia/atyrau'),
|
||||
asiaBaghdad(value: 'asia/baghdad'),
|
||||
asiaBahrain(value: 'asia/bahrain'),
|
||||
asiaBaku(value: 'asia/baku'),
|
||||
asiaBangkok(value: 'asia/bangkok'),
|
||||
asiaBarnaul(value: 'asia/barnaul'),
|
||||
asiaBeirut(value: 'asia/beirut'),
|
||||
asiaBishkek(value: 'asia/bishkek'),
|
||||
asiaBrunei(value: 'asia/brunei'),
|
||||
asiaChita(value: 'asia/chita'),
|
||||
asiaColombo(value: 'asia/colombo'),
|
||||
asiaDamascus(value: 'asia/damascus'),
|
||||
asiaDhaka(value: 'asia/dhaka'),
|
||||
asiaDili(value: 'asia/dili'),
|
||||
asiaDubai(value: 'asia/dubai'),
|
||||
asiaDushanbe(value: 'asia/dushanbe'),
|
||||
asiaFamagusta(value: 'asia/famagusta'),
|
||||
asiaGaza(value: 'asia/gaza'),
|
||||
asiaHebron(value: 'asia/hebron'),
|
||||
asiaHoChiMinh(value: 'asia/ho_chi_minh'),
|
||||
asiaHongKong(value: 'asia/hong_kong'),
|
||||
asiaHovd(value: 'asia/hovd'),
|
||||
asiaIrkutsk(value: 'asia/irkutsk'),
|
||||
asiaJakarta(value: 'asia/jakarta'),
|
||||
asiaJayapura(value: 'asia/jayapura'),
|
||||
asiaJerusalem(value: 'asia/jerusalem'),
|
||||
asiaKabul(value: 'asia/kabul'),
|
||||
asiaKamchatka(value: 'asia/kamchatka'),
|
||||
asiaKarachi(value: 'asia/karachi'),
|
||||
asiaKathmandu(value: 'asia/kathmandu'),
|
||||
asiaKhandyga(value: 'asia/khandyga'),
|
||||
asiaKolkata(value: 'asia/kolkata'),
|
||||
asiaKrasnoyarsk(value: 'asia/krasnoyarsk'),
|
||||
asiaKualaLumpur(value: 'asia/kuala_lumpur'),
|
||||
asiaKuching(value: 'asia/kuching'),
|
||||
asiaKuwait(value: 'asia/kuwait'),
|
||||
asiaMacau(value: 'asia/macau'),
|
||||
asiaMagadan(value: 'asia/magadan'),
|
||||
asiaMakassar(value: 'asia/makassar'),
|
||||
asiaManila(value: 'asia/manila'),
|
||||
asiaMuscat(value: 'asia/muscat'),
|
||||
asiaNicosia(value: 'asia/nicosia'),
|
||||
asiaNovokuznetsk(value: 'asia/novokuznetsk'),
|
||||
asiaNovosibirsk(value: 'asia/novosibirsk'),
|
||||
asiaOmsk(value: 'asia/omsk'),
|
||||
asiaOral(value: 'asia/oral'),
|
||||
asiaPhnomPenh(value: 'asia/phnom_penh'),
|
||||
asiaPontianak(value: 'asia/pontianak'),
|
||||
asiaPyongyang(value: 'asia/pyongyang'),
|
||||
asiaQatar(value: 'asia/qatar'),
|
||||
asiaQostanay(value: 'asia/qostanay'),
|
||||
asiaQyzylorda(value: 'asia/qyzylorda'),
|
||||
asiaRiyadh(value: 'asia/riyadh'),
|
||||
asiaSakhalin(value: 'asia/sakhalin'),
|
||||
asiaSamarkand(value: 'asia/samarkand'),
|
||||
asiaSeoul(value: 'asia/seoul'),
|
||||
asiaShanghai(value: 'asia/shanghai'),
|
||||
asiaSingapore(value: 'asia/singapore'),
|
||||
asiaSrednekolymsk(value: 'asia/srednekolymsk'),
|
||||
asiaTaipei(value: 'asia/taipei'),
|
||||
asiaTashkent(value: 'asia/tashkent'),
|
||||
asiaTbilisi(value: 'asia/tbilisi'),
|
||||
asiaTehran(value: 'asia/tehran'),
|
||||
asiaThimphu(value: 'asia/thimphu'),
|
||||
asiaTokyo(value: 'asia/tokyo'),
|
||||
asiaTomsk(value: 'asia/tomsk'),
|
||||
asiaUlaanbaatar(value: 'asia/ulaanbaatar'),
|
||||
asiaUrumqi(value: 'asia/urumqi'),
|
||||
asiaUstNera(value: 'asia/ust-nera'),
|
||||
asiaVientiane(value: 'asia/vientiane'),
|
||||
asiaVladivostok(value: 'asia/vladivostok'),
|
||||
asiaYakutsk(value: 'asia/yakutsk'),
|
||||
asiaYangon(value: 'asia/yangon'),
|
||||
asiaYekaterinburg(value: 'asia/yekaterinburg'),
|
||||
asiaYerevan(value: 'asia/yerevan'),
|
||||
atlanticAzores(value: 'atlantic/azores'),
|
||||
atlanticBermuda(value: 'atlantic/bermuda'),
|
||||
atlanticCanary(value: 'atlantic/canary'),
|
||||
atlanticCapeVerde(value: 'atlantic/cape_verde'),
|
||||
atlanticFaroe(value: 'atlantic/faroe'),
|
||||
atlanticMadeira(value: 'atlantic/madeira'),
|
||||
atlanticReykjavik(value: 'atlantic/reykjavik'),
|
||||
atlanticSouthGeorgia(value: 'atlantic/south_georgia'),
|
||||
atlanticStHelena(value: 'atlantic/st_helena'),
|
||||
atlanticStanley(value: 'atlantic/stanley'),
|
||||
australiaAdelaide(value: 'australia/adelaide'),
|
||||
australiaBrisbane(value: 'australia/brisbane'),
|
||||
australiaBrokenHill(value: 'australia/broken_hill'),
|
||||
australiaDarwin(value: 'australia/darwin'),
|
||||
australiaEucla(value: 'australia/eucla'),
|
||||
australiaHobart(value: 'australia/hobart'),
|
||||
australiaLindeman(value: 'australia/lindeman'),
|
||||
australiaLordHowe(value: 'australia/lord_howe'),
|
||||
australiaMelbourne(value: 'australia/melbourne'),
|
||||
australiaPerth(value: 'australia/perth'),
|
||||
australiaSydney(value: 'australia/sydney'),
|
||||
europeAmsterdam(value: 'europe/amsterdam'),
|
||||
europeAndorra(value: 'europe/andorra'),
|
||||
europeAstrakhan(value: 'europe/astrakhan'),
|
||||
europeAthens(value: 'europe/athens'),
|
||||
europeBelgrade(value: 'europe/belgrade'),
|
||||
europeBerlin(value: 'europe/berlin'),
|
||||
europeBratislava(value: 'europe/bratislava'),
|
||||
europeBrussels(value: 'europe/brussels'),
|
||||
europeBucharest(value: 'europe/bucharest'),
|
||||
europeBudapest(value: 'europe/budapest'),
|
||||
europeBusingen(value: 'europe/busingen'),
|
||||
europeChisinau(value: 'europe/chisinau'),
|
||||
europeCopenhagen(value: 'europe/copenhagen'),
|
||||
europeDublin(value: 'europe/dublin'),
|
||||
europeGibraltar(value: 'europe/gibraltar'),
|
||||
europeGuernsey(value: 'europe/guernsey'),
|
||||
europeHelsinki(value: 'europe/helsinki'),
|
||||
europeIsleOfMan(value: 'europe/isle_of_man'),
|
||||
europeIstanbul(value: 'europe/istanbul'),
|
||||
europeJersey(value: 'europe/jersey'),
|
||||
europeKaliningrad(value: 'europe/kaliningrad'),
|
||||
europeKirov(value: 'europe/kirov'),
|
||||
europeKyiv(value: 'europe/kyiv'),
|
||||
europeLisbon(value: 'europe/lisbon'),
|
||||
europeLjubljana(value: 'europe/ljubljana'),
|
||||
europeLondon(value: 'europe/london'),
|
||||
europeLuxembourg(value: 'europe/luxembourg'),
|
||||
europeMadrid(value: 'europe/madrid'),
|
||||
europeMalta(value: 'europe/malta'),
|
||||
europeMariehamn(value: 'europe/mariehamn'),
|
||||
europeMinsk(value: 'europe/minsk'),
|
||||
europeMonaco(value: 'europe/monaco'),
|
||||
europeMoscow(value: 'europe/moscow'),
|
||||
europeOslo(value: 'europe/oslo'),
|
||||
europeParis(value: 'europe/paris'),
|
||||
europePodgorica(value: 'europe/podgorica'),
|
||||
europePrague(value: 'europe/prague'),
|
||||
europeRiga(value: 'europe/riga'),
|
||||
europeRome(value: 'europe/rome'),
|
||||
europeSamara(value: 'europe/samara'),
|
||||
europeSanMarino(value: 'europe/san_marino'),
|
||||
europeSarajevo(value: 'europe/sarajevo'),
|
||||
europeSaratov(value: 'europe/saratov'),
|
||||
europeSimferopol(value: 'europe/simferopol'),
|
||||
europeSkopje(value: 'europe/skopje'),
|
||||
europeSofia(value: 'europe/sofia'),
|
||||
europeStockholm(value: 'europe/stockholm'),
|
||||
europeTallinn(value: 'europe/tallinn'),
|
||||
europeTirane(value: 'europe/tirane'),
|
||||
europeUlyanovsk(value: 'europe/ulyanovsk'),
|
||||
europeVaduz(value: 'europe/vaduz'),
|
||||
europeVatican(value: 'europe/vatican'),
|
||||
europeVienna(value: 'europe/vienna'),
|
||||
europeVilnius(value: 'europe/vilnius'),
|
||||
europeVolgograd(value: 'europe/volgograd'),
|
||||
europeWarsaw(value: 'europe/warsaw'),
|
||||
europeZagreb(value: 'europe/zagreb'),
|
||||
europeZurich(value: 'europe/zurich'),
|
||||
indianAntananarivo(value: 'indian/antananarivo'),
|
||||
indianChagos(value: 'indian/chagos'),
|
||||
indianChristmas(value: 'indian/christmas'),
|
||||
indianCocos(value: 'indian/cocos'),
|
||||
indianComoro(value: 'indian/comoro'),
|
||||
indianKerguelen(value: 'indian/kerguelen'),
|
||||
indianMahe(value: 'indian/mahe'),
|
||||
indianMaldives(value: 'indian/maldives'),
|
||||
indianMauritius(value: 'indian/mauritius'),
|
||||
indianMayotte(value: 'indian/mayotte'),
|
||||
indianReunion(value: 'indian/reunion'),
|
||||
pacificApia(value: 'pacific/apia'),
|
||||
pacificAuckland(value: 'pacific/auckland'),
|
||||
pacificBougainville(value: 'pacific/bougainville'),
|
||||
pacificChatham(value: 'pacific/chatham'),
|
||||
pacificChuuk(value: 'pacific/chuuk'),
|
||||
pacificEaster(value: 'pacific/easter'),
|
||||
pacificEfate(value: 'pacific/efate'),
|
||||
pacificFakaofo(value: 'pacific/fakaofo'),
|
||||
pacificFiji(value: 'pacific/fiji'),
|
||||
pacificFunafuti(value: 'pacific/funafuti'),
|
||||
pacificGalapagos(value: 'pacific/galapagos'),
|
||||
pacificGambier(value: 'pacific/gambier'),
|
||||
pacificGuadalcanal(value: 'pacific/guadalcanal'),
|
||||
pacificGuam(value: 'pacific/guam'),
|
||||
pacificHonolulu(value: 'pacific/honolulu'),
|
||||
pacificKanton(value: 'pacific/kanton'),
|
||||
pacificKiritimati(value: 'pacific/kiritimati'),
|
||||
pacificKosrae(value: 'pacific/kosrae'),
|
||||
pacificKwajalein(value: 'pacific/kwajalein'),
|
||||
pacificMajuro(value: 'pacific/majuro'),
|
||||
pacificMarquesas(value: 'pacific/marquesas'),
|
||||
pacificMidway(value: 'pacific/midway'),
|
||||
pacificNauru(value: 'pacific/nauru'),
|
||||
pacificNiue(value: 'pacific/niue'),
|
||||
pacificNorfolk(value: 'pacific/norfolk'),
|
||||
pacificNoumea(value: 'pacific/noumea'),
|
||||
pacificPagoPago(value: 'pacific/pago_pago'),
|
||||
pacificPalau(value: 'pacific/palau'),
|
||||
pacificPitcairn(value: 'pacific/pitcairn'),
|
||||
pacificPohnpei(value: 'pacific/pohnpei'),
|
||||
pacificPortMoresby(value: 'pacific/port_moresby'),
|
||||
pacificRarotonga(value: 'pacific/rarotonga'),
|
||||
pacificSaipan(value: 'pacific/saipan'),
|
||||
pacificTahiti(value: 'pacific/tahiti'),
|
||||
pacificTarawa(value: 'pacific/tarawa'),
|
||||
pacificTongatapu(value: 'pacific/tongatapu'),
|
||||
pacificWake(value: 'pacific/wake'),
|
||||
pacificWallis(value: 'pacific/wallis'),
|
||||
utc(value: 'utc');
|
||||
africaAbidjan(value: 'africa/abidjan'),
|
||||
africaAccra(value: 'africa/accra'),
|
||||
africaAddisAbaba(value: 'africa/addis_ababa'),
|
||||
africaAlgiers(value: 'africa/algiers'),
|
||||
africaAsmara(value: 'africa/asmara'),
|
||||
africaBamako(value: 'africa/bamako'),
|
||||
africaBangui(value: 'africa/bangui'),
|
||||
africaBanjul(value: 'africa/banjul'),
|
||||
africaBissau(value: 'africa/bissau'),
|
||||
africaBlantyre(value: 'africa/blantyre'),
|
||||
africaBrazzaville(value: 'africa/brazzaville'),
|
||||
africaBujumbura(value: 'africa/bujumbura'),
|
||||
africaCairo(value: 'africa/cairo'),
|
||||
africaCasablanca(value: 'africa/casablanca'),
|
||||
africaCeuta(value: 'africa/ceuta'),
|
||||
africaConakry(value: 'africa/conakry'),
|
||||
africaDakar(value: 'africa/dakar'),
|
||||
africaDarEsSalaam(value: 'africa/dar_es_salaam'),
|
||||
africaDjibouti(value: 'africa/djibouti'),
|
||||
africaDouala(value: 'africa/douala'),
|
||||
africaElAaiun(value: 'africa/el_aaiun'),
|
||||
africaFreetown(value: 'africa/freetown'),
|
||||
africaGaborone(value: 'africa/gaborone'),
|
||||
africaHarare(value: 'africa/harare'),
|
||||
africaJohannesburg(value: 'africa/johannesburg'),
|
||||
africaJuba(value: 'africa/juba'),
|
||||
africaKampala(value: 'africa/kampala'),
|
||||
africaKhartoum(value: 'africa/khartoum'),
|
||||
africaKigali(value: 'africa/kigali'),
|
||||
africaKinshasa(value: 'africa/kinshasa'),
|
||||
africaLagos(value: 'africa/lagos'),
|
||||
africaLibreville(value: 'africa/libreville'),
|
||||
africaLome(value: 'africa/lome'),
|
||||
africaLuanda(value: 'africa/luanda'),
|
||||
africaLubumbashi(value: 'africa/lubumbashi'),
|
||||
africaLusaka(value: 'africa/lusaka'),
|
||||
africaMalabo(value: 'africa/malabo'),
|
||||
africaMaputo(value: 'africa/maputo'),
|
||||
africaMaseru(value: 'africa/maseru'),
|
||||
africaMbabane(value: 'africa/mbabane'),
|
||||
africaMogadishu(value: 'africa/mogadishu'),
|
||||
africaMonrovia(value: 'africa/monrovia'),
|
||||
africaNairobi(value: 'africa/nairobi'),
|
||||
africaNdjamena(value: 'africa/ndjamena'),
|
||||
africaNiamey(value: 'africa/niamey'),
|
||||
africaNouakchott(value: 'africa/nouakchott'),
|
||||
africaOuagadougou(value: 'africa/ouagadougou'),
|
||||
africaPortoNovo(value: 'africa/porto-novo'),
|
||||
africaSaoTome(value: 'africa/sao_tome'),
|
||||
africaTripoli(value: 'africa/tripoli'),
|
||||
africaTunis(value: 'africa/tunis'),
|
||||
africaWindhoek(value: 'africa/windhoek'),
|
||||
americaAdak(value: 'america/adak'),
|
||||
americaAnchorage(value: 'america/anchorage'),
|
||||
americaAnguilla(value: 'america/anguilla'),
|
||||
americaAntigua(value: 'america/antigua'),
|
||||
americaAraguaina(value: 'america/araguaina'),
|
||||
americaArgentinaBuenosAires(value: 'america/argentina/buenos_aires'),
|
||||
americaArgentinaCatamarca(value: 'america/argentina/catamarca'),
|
||||
americaArgentinaCordoba(value: 'america/argentina/cordoba'),
|
||||
americaArgentinaJujuy(value: 'america/argentina/jujuy'),
|
||||
americaArgentinaLaRioja(value: 'america/argentina/la_rioja'),
|
||||
americaArgentinaMendoza(value: 'america/argentina/mendoza'),
|
||||
americaArgentinaRioGallegos(value: 'america/argentina/rio_gallegos'),
|
||||
americaArgentinaSalta(value: 'america/argentina/salta'),
|
||||
americaArgentinaSanJuan(value: 'america/argentina/san_juan'),
|
||||
americaArgentinaSanLuis(value: 'america/argentina/san_luis'),
|
||||
americaArgentinaTucuman(value: 'america/argentina/tucuman'),
|
||||
americaArgentinaUshuaia(value: 'america/argentina/ushuaia'),
|
||||
americaAruba(value: 'america/aruba'),
|
||||
americaAsuncion(value: 'america/asuncion'),
|
||||
americaAtikokan(value: 'america/atikokan'),
|
||||
americaBahia(value: 'america/bahia'),
|
||||
americaBahiaBanderas(value: 'america/bahia_banderas'),
|
||||
americaBarbados(value: 'america/barbados'),
|
||||
americaBelem(value: 'america/belem'),
|
||||
americaBelize(value: 'america/belize'),
|
||||
americaBlancSablon(value: 'america/blanc-sablon'),
|
||||
americaBoaVista(value: 'america/boa_vista'),
|
||||
americaBogota(value: 'america/bogota'),
|
||||
americaBoise(value: 'america/boise'),
|
||||
americaCambridgeBay(value: 'america/cambridge_bay'),
|
||||
americaCampoGrande(value: 'america/campo_grande'),
|
||||
americaCancun(value: 'america/cancun'),
|
||||
americaCaracas(value: 'america/caracas'),
|
||||
americaCayenne(value: 'america/cayenne'),
|
||||
americaCayman(value: 'america/cayman'),
|
||||
americaChicago(value: 'america/chicago'),
|
||||
americaChihuahua(value: 'america/chihuahua'),
|
||||
americaCiudadJuarez(value: 'america/ciudad_juarez'),
|
||||
americaCostaRica(value: 'america/costa_rica'),
|
||||
americaCoyhaique(value: 'america/coyhaique'),
|
||||
americaCreston(value: 'america/creston'),
|
||||
americaCuiaba(value: 'america/cuiaba'),
|
||||
americaCuracao(value: 'america/curacao'),
|
||||
americaDanmarkshavn(value: 'america/danmarkshavn'),
|
||||
americaDawson(value: 'america/dawson'),
|
||||
americaDawsonCreek(value: 'america/dawson_creek'),
|
||||
americaDenver(value: 'america/denver'),
|
||||
americaDetroit(value: 'america/detroit'),
|
||||
americaDominica(value: 'america/dominica'),
|
||||
americaEdmonton(value: 'america/edmonton'),
|
||||
americaEirunepe(value: 'america/eirunepe'),
|
||||
americaElSalvador(value: 'america/el_salvador'),
|
||||
americaFortNelson(value: 'america/fort_nelson'),
|
||||
americaFortaleza(value: 'america/fortaleza'),
|
||||
americaGlaceBay(value: 'america/glace_bay'),
|
||||
americaGooseBay(value: 'america/goose_bay'),
|
||||
americaGrandTurk(value: 'america/grand_turk'),
|
||||
americaGrenada(value: 'america/grenada'),
|
||||
americaGuadeloupe(value: 'america/guadeloupe'),
|
||||
americaGuatemala(value: 'america/guatemala'),
|
||||
americaGuayaquil(value: 'america/guayaquil'),
|
||||
americaGuyana(value: 'america/guyana'),
|
||||
americaHalifax(value: 'america/halifax'),
|
||||
americaHavana(value: 'america/havana'),
|
||||
americaHermosillo(value: 'america/hermosillo'),
|
||||
americaIndianaIndianapolis(value: 'america/indiana/indianapolis'),
|
||||
americaIndianaKnox(value: 'america/indiana/knox'),
|
||||
americaIndianaMarengo(value: 'america/indiana/marengo'),
|
||||
americaIndianaPetersburg(value: 'america/indiana/petersburg'),
|
||||
americaIndianaTellCity(value: 'america/indiana/tell_city'),
|
||||
americaIndianaVevay(value: 'america/indiana/vevay'),
|
||||
americaIndianaVincennes(value: 'america/indiana/vincennes'),
|
||||
americaIndianaWinamac(value: 'america/indiana/winamac'),
|
||||
americaInuvik(value: 'america/inuvik'),
|
||||
americaIqaluit(value: 'america/iqaluit'),
|
||||
americaJamaica(value: 'america/jamaica'),
|
||||
americaJuneau(value: 'america/juneau'),
|
||||
americaKentuckyLouisville(value: 'america/kentucky/louisville'),
|
||||
americaKentuckyMonticello(value: 'america/kentucky/monticello'),
|
||||
americaKralendijk(value: 'america/kralendijk'),
|
||||
americaLaPaz(value: 'america/la_paz'),
|
||||
americaLima(value: 'america/lima'),
|
||||
americaLosAngeles(value: 'america/los_angeles'),
|
||||
americaLowerPrinces(value: 'america/lower_princes'),
|
||||
americaMaceio(value: 'america/maceio'),
|
||||
americaManagua(value: 'america/managua'),
|
||||
americaManaus(value: 'america/manaus'),
|
||||
americaMarigot(value: 'america/marigot'),
|
||||
americaMartinique(value: 'america/martinique'),
|
||||
americaMatamoros(value: 'america/matamoros'),
|
||||
americaMazatlan(value: 'america/mazatlan'),
|
||||
americaMenominee(value: 'america/menominee'),
|
||||
americaMerida(value: 'america/merida'),
|
||||
americaMetlakatla(value: 'america/metlakatla'),
|
||||
americaMexicoCity(value: 'america/mexico_city'),
|
||||
americaMiquelon(value: 'america/miquelon'),
|
||||
americaMoncton(value: 'america/moncton'),
|
||||
americaMonterrey(value: 'america/monterrey'),
|
||||
americaMontevideo(value: 'america/montevideo'),
|
||||
americaMontserrat(value: 'america/montserrat'),
|
||||
americaNassau(value: 'america/nassau'),
|
||||
americaNewYork(value: 'america/new_york'),
|
||||
americaNome(value: 'america/nome'),
|
||||
americaNoronha(value: 'america/noronha'),
|
||||
americaNorthDakotaBeulah(value: 'america/north_dakota/beulah'),
|
||||
americaNorthDakotaCenter(value: 'america/north_dakota/center'),
|
||||
americaNorthDakotaNewSalem(value: 'america/north_dakota/new_salem'),
|
||||
americaNuuk(value: 'america/nuuk'),
|
||||
americaOjinaga(value: 'america/ojinaga'),
|
||||
americaPanama(value: 'america/panama'),
|
||||
americaParamaribo(value: 'america/paramaribo'),
|
||||
americaPhoenix(value: 'america/phoenix'),
|
||||
americaPortAuPrince(value: 'america/port-au-prince'),
|
||||
americaPortOfSpain(value: 'america/port_of_spain'),
|
||||
americaPortoVelho(value: 'america/porto_velho'),
|
||||
americaPuertoRico(value: 'america/puerto_rico'),
|
||||
americaPuntaArenas(value: 'america/punta_arenas'),
|
||||
americaRankinInlet(value: 'america/rankin_inlet'),
|
||||
americaRecife(value: 'america/recife'),
|
||||
americaRegina(value: 'america/regina'),
|
||||
americaResolute(value: 'america/resolute'),
|
||||
americaRioBranco(value: 'america/rio_branco'),
|
||||
americaSantarem(value: 'america/santarem'),
|
||||
americaSantiago(value: 'america/santiago'),
|
||||
americaSantoDomingo(value: 'america/santo_domingo'),
|
||||
americaSaoPaulo(value: 'america/sao_paulo'),
|
||||
americaScoresbysund(value: 'america/scoresbysund'),
|
||||
americaSitka(value: 'america/sitka'),
|
||||
americaStBarthelemy(value: 'america/st_barthelemy'),
|
||||
americaStJohns(value: 'america/st_johns'),
|
||||
americaStKitts(value: 'america/st_kitts'),
|
||||
americaStLucia(value: 'america/st_lucia'),
|
||||
americaStThomas(value: 'america/st_thomas'),
|
||||
americaStVincent(value: 'america/st_vincent'),
|
||||
americaSwiftCurrent(value: 'america/swift_current'),
|
||||
americaTegucigalpa(value: 'america/tegucigalpa'),
|
||||
americaThule(value: 'america/thule'),
|
||||
americaTijuana(value: 'america/tijuana'),
|
||||
americaToronto(value: 'america/toronto'),
|
||||
americaTortola(value: 'america/tortola'),
|
||||
americaVancouver(value: 'america/vancouver'),
|
||||
americaWhitehorse(value: 'america/whitehorse'),
|
||||
americaWinnipeg(value: 'america/winnipeg'),
|
||||
americaYakutat(value: 'america/yakutat'),
|
||||
antarcticaCasey(value: 'antarctica/casey'),
|
||||
antarcticaDavis(value: 'antarctica/davis'),
|
||||
antarcticaDumontdurville(value: 'antarctica/dumontdurville'),
|
||||
antarcticaMacquarie(value: 'antarctica/macquarie'),
|
||||
antarcticaMawson(value: 'antarctica/mawson'),
|
||||
antarcticaMcmurdo(value: 'antarctica/mcmurdo'),
|
||||
antarcticaPalmer(value: 'antarctica/palmer'),
|
||||
antarcticaRothera(value: 'antarctica/rothera'),
|
||||
antarcticaSyowa(value: 'antarctica/syowa'),
|
||||
antarcticaTroll(value: 'antarctica/troll'),
|
||||
antarcticaVostok(value: 'antarctica/vostok'),
|
||||
arcticLongyearbyen(value: 'arctic/longyearbyen'),
|
||||
asiaAden(value: 'asia/aden'),
|
||||
asiaAlmaty(value: 'asia/almaty'),
|
||||
asiaAmman(value: 'asia/amman'),
|
||||
asiaAnadyr(value: 'asia/anadyr'),
|
||||
asiaAqtau(value: 'asia/aqtau'),
|
||||
asiaAqtobe(value: 'asia/aqtobe'),
|
||||
asiaAshgabat(value: 'asia/ashgabat'),
|
||||
asiaAtyrau(value: 'asia/atyrau'),
|
||||
asiaBaghdad(value: 'asia/baghdad'),
|
||||
asiaBahrain(value: 'asia/bahrain'),
|
||||
asiaBaku(value: 'asia/baku'),
|
||||
asiaBangkok(value: 'asia/bangkok'),
|
||||
asiaBarnaul(value: 'asia/barnaul'),
|
||||
asiaBeirut(value: 'asia/beirut'),
|
||||
asiaBishkek(value: 'asia/bishkek'),
|
||||
asiaBrunei(value: 'asia/brunei'),
|
||||
asiaChita(value: 'asia/chita'),
|
||||
asiaColombo(value: 'asia/colombo'),
|
||||
asiaDamascus(value: 'asia/damascus'),
|
||||
asiaDhaka(value: 'asia/dhaka'),
|
||||
asiaDili(value: 'asia/dili'),
|
||||
asiaDubai(value: 'asia/dubai'),
|
||||
asiaDushanbe(value: 'asia/dushanbe'),
|
||||
asiaFamagusta(value: 'asia/famagusta'),
|
||||
asiaGaza(value: 'asia/gaza'),
|
||||
asiaHebron(value: 'asia/hebron'),
|
||||
asiaHoChiMinh(value: 'asia/ho_chi_minh'),
|
||||
asiaHongKong(value: 'asia/hong_kong'),
|
||||
asiaHovd(value: 'asia/hovd'),
|
||||
asiaIrkutsk(value: 'asia/irkutsk'),
|
||||
asiaJakarta(value: 'asia/jakarta'),
|
||||
asiaJayapura(value: 'asia/jayapura'),
|
||||
asiaJerusalem(value: 'asia/jerusalem'),
|
||||
asiaKabul(value: 'asia/kabul'),
|
||||
asiaKamchatka(value: 'asia/kamchatka'),
|
||||
asiaKarachi(value: 'asia/karachi'),
|
||||
asiaKathmandu(value: 'asia/kathmandu'),
|
||||
asiaKhandyga(value: 'asia/khandyga'),
|
||||
asiaKolkata(value: 'asia/kolkata'),
|
||||
asiaKrasnoyarsk(value: 'asia/krasnoyarsk'),
|
||||
asiaKualaLumpur(value: 'asia/kuala_lumpur'),
|
||||
asiaKuching(value: 'asia/kuching'),
|
||||
asiaKuwait(value: 'asia/kuwait'),
|
||||
asiaMacau(value: 'asia/macau'),
|
||||
asiaMagadan(value: 'asia/magadan'),
|
||||
asiaMakassar(value: 'asia/makassar'),
|
||||
asiaManila(value: 'asia/manila'),
|
||||
asiaMuscat(value: 'asia/muscat'),
|
||||
asiaNicosia(value: 'asia/nicosia'),
|
||||
asiaNovokuznetsk(value: 'asia/novokuznetsk'),
|
||||
asiaNovosibirsk(value: 'asia/novosibirsk'),
|
||||
asiaOmsk(value: 'asia/omsk'),
|
||||
asiaOral(value: 'asia/oral'),
|
||||
asiaPhnomPenh(value: 'asia/phnom_penh'),
|
||||
asiaPontianak(value: 'asia/pontianak'),
|
||||
asiaPyongyang(value: 'asia/pyongyang'),
|
||||
asiaQatar(value: 'asia/qatar'),
|
||||
asiaQostanay(value: 'asia/qostanay'),
|
||||
asiaQyzylorda(value: 'asia/qyzylorda'),
|
||||
asiaRiyadh(value: 'asia/riyadh'),
|
||||
asiaSakhalin(value: 'asia/sakhalin'),
|
||||
asiaSamarkand(value: 'asia/samarkand'),
|
||||
asiaSeoul(value: 'asia/seoul'),
|
||||
asiaShanghai(value: 'asia/shanghai'),
|
||||
asiaSingapore(value: 'asia/singapore'),
|
||||
asiaSrednekolymsk(value: 'asia/srednekolymsk'),
|
||||
asiaTaipei(value: 'asia/taipei'),
|
||||
asiaTashkent(value: 'asia/tashkent'),
|
||||
asiaTbilisi(value: 'asia/tbilisi'),
|
||||
asiaTehran(value: 'asia/tehran'),
|
||||
asiaThimphu(value: 'asia/thimphu'),
|
||||
asiaTokyo(value: 'asia/tokyo'),
|
||||
asiaTomsk(value: 'asia/tomsk'),
|
||||
asiaUlaanbaatar(value: 'asia/ulaanbaatar'),
|
||||
asiaUrumqi(value: 'asia/urumqi'),
|
||||
asiaUstNera(value: 'asia/ust-nera'),
|
||||
asiaVientiane(value: 'asia/vientiane'),
|
||||
asiaVladivostok(value: 'asia/vladivostok'),
|
||||
asiaYakutsk(value: 'asia/yakutsk'),
|
||||
asiaYangon(value: 'asia/yangon'),
|
||||
asiaYekaterinburg(value: 'asia/yekaterinburg'),
|
||||
asiaYerevan(value: 'asia/yerevan'),
|
||||
atlanticAzores(value: 'atlantic/azores'),
|
||||
atlanticBermuda(value: 'atlantic/bermuda'),
|
||||
atlanticCanary(value: 'atlantic/canary'),
|
||||
atlanticCapeVerde(value: 'atlantic/cape_verde'),
|
||||
atlanticFaroe(value: 'atlantic/faroe'),
|
||||
atlanticMadeira(value: 'atlantic/madeira'),
|
||||
atlanticReykjavik(value: 'atlantic/reykjavik'),
|
||||
atlanticSouthGeorgia(value: 'atlantic/south_georgia'),
|
||||
atlanticStHelena(value: 'atlantic/st_helena'),
|
||||
atlanticStanley(value: 'atlantic/stanley'),
|
||||
australiaAdelaide(value: 'australia/adelaide'),
|
||||
australiaBrisbane(value: 'australia/brisbane'),
|
||||
australiaBrokenHill(value: 'australia/broken_hill'),
|
||||
australiaDarwin(value: 'australia/darwin'),
|
||||
australiaEucla(value: 'australia/eucla'),
|
||||
australiaHobart(value: 'australia/hobart'),
|
||||
australiaLindeman(value: 'australia/lindeman'),
|
||||
australiaLordHowe(value: 'australia/lord_howe'),
|
||||
australiaMelbourne(value: 'australia/melbourne'),
|
||||
australiaPerth(value: 'australia/perth'),
|
||||
australiaSydney(value: 'australia/sydney'),
|
||||
europeAmsterdam(value: 'europe/amsterdam'),
|
||||
europeAndorra(value: 'europe/andorra'),
|
||||
europeAstrakhan(value: 'europe/astrakhan'),
|
||||
europeAthens(value: 'europe/athens'),
|
||||
europeBelgrade(value: 'europe/belgrade'),
|
||||
europeBerlin(value: 'europe/berlin'),
|
||||
europeBratislava(value: 'europe/bratislava'),
|
||||
europeBrussels(value: 'europe/brussels'),
|
||||
europeBucharest(value: 'europe/bucharest'),
|
||||
europeBudapest(value: 'europe/budapest'),
|
||||
europeBusingen(value: 'europe/busingen'),
|
||||
europeChisinau(value: 'europe/chisinau'),
|
||||
europeCopenhagen(value: 'europe/copenhagen'),
|
||||
europeDublin(value: 'europe/dublin'),
|
||||
europeGibraltar(value: 'europe/gibraltar'),
|
||||
europeGuernsey(value: 'europe/guernsey'),
|
||||
europeHelsinki(value: 'europe/helsinki'),
|
||||
europeIsleOfMan(value: 'europe/isle_of_man'),
|
||||
europeIstanbul(value: 'europe/istanbul'),
|
||||
europeJersey(value: 'europe/jersey'),
|
||||
europeKaliningrad(value: 'europe/kaliningrad'),
|
||||
europeKirov(value: 'europe/kirov'),
|
||||
europeKyiv(value: 'europe/kyiv'),
|
||||
europeLisbon(value: 'europe/lisbon'),
|
||||
europeLjubljana(value: 'europe/ljubljana'),
|
||||
europeLondon(value: 'europe/london'),
|
||||
europeLuxembourg(value: 'europe/luxembourg'),
|
||||
europeMadrid(value: 'europe/madrid'),
|
||||
europeMalta(value: 'europe/malta'),
|
||||
europeMariehamn(value: 'europe/mariehamn'),
|
||||
europeMinsk(value: 'europe/minsk'),
|
||||
europeMonaco(value: 'europe/monaco'),
|
||||
europeMoscow(value: 'europe/moscow'),
|
||||
europeOslo(value: 'europe/oslo'),
|
||||
europeParis(value: 'europe/paris'),
|
||||
europePodgorica(value: 'europe/podgorica'),
|
||||
europePrague(value: 'europe/prague'),
|
||||
europeRiga(value: 'europe/riga'),
|
||||
europeRome(value: 'europe/rome'),
|
||||
europeSamara(value: 'europe/samara'),
|
||||
europeSanMarino(value: 'europe/san_marino'),
|
||||
europeSarajevo(value: 'europe/sarajevo'),
|
||||
europeSaratov(value: 'europe/saratov'),
|
||||
europeSimferopol(value: 'europe/simferopol'),
|
||||
europeSkopje(value: 'europe/skopje'),
|
||||
europeSofia(value: 'europe/sofia'),
|
||||
europeStockholm(value: 'europe/stockholm'),
|
||||
europeTallinn(value: 'europe/tallinn'),
|
||||
europeTirane(value: 'europe/tirane'),
|
||||
europeUlyanovsk(value: 'europe/ulyanovsk'),
|
||||
europeVaduz(value: 'europe/vaduz'),
|
||||
europeVatican(value: 'europe/vatican'),
|
||||
europeVienna(value: 'europe/vienna'),
|
||||
europeVilnius(value: 'europe/vilnius'),
|
||||
europeVolgograd(value: 'europe/volgograd'),
|
||||
europeWarsaw(value: 'europe/warsaw'),
|
||||
europeZagreb(value: 'europe/zagreb'),
|
||||
europeZurich(value: 'europe/zurich'),
|
||||
indianAntananarivo(value: 'indian/antananarivo'),
|
||||
indianChagos(value: 'indian/chagos'),
|
||||
indianChristmas(value: 'indian/christmas'),
|
||||
indianCocos(value: 'indian/cocos'),
|
||||
indianComoro(value: 'indian/comoro'),
|
||||
indianKerguelen(value: 'indian/kerguelen'),
|
||||
indianMahe(value: 'indian/mahe'),
|
||||
indianMaldives(value: 'indian/maldives'),
|
||||
indianMauritius(value: 'indian/mauritius'),
|
||||
indianMayotte(value: 'indian/mayotte'),
|
||||
indianReunion(value: 'indian/reunion'),
|
||||
pacificApia(value: 'pacific/apia'),
|
||||
pacificAuckland(value: 'pacific/auckland'),
|
||||
pacificBougainville(value: 'pacific/bougainville'),
|
||||
pacificChatham(value: 'pacific/chatham'),
|
||||
pacificChuuk(value: 'pacific/chuuk'),
|
||||
pacificEaster(value: 'pacific/easter'),
|
||||
pacificEfate(value: 'pacific/efate'),
|
||||
pacificFakaofo(value: 'pacific/fakaofo'),
|
||||
pacificFiji(value: 'pacific/fiji'),
|
||||
pacificFunafuti(value: 'pacific/funafuti'),
|
||||
pacificGalapagos(value: 'pacific/galapagos'),
|
||||
pacificGambier(value: 'pacific/gambier'),
|
||||
pacificGuadalcanal(value: 'pacific/guadalcanal'),
|
||||
pacificGuam(value: 'pacific/guam'),
|
||||
pacificHonolulu(value: 'pacific/honolulu'),
|
||||
pacificKanton(value: 'pacific/kanton'),
|
||||
pacificKiritimati(value: 'pacific/kiritimati'),
|
||||
pacificKosrae(value: 'pacific/kosrae'),
|
||||
pacificKwajalein(value: 'pacific/kwajalein'),
|
||||
pacificMajuro(value: 'pacific/majuro'),
|
||||
pacificMarquesas(value: 'pacific/marquesas'),
|
||||
pacificMidway(value: 'pacific/midway'),
|
||||
pacificNauru(value: 'pacific/nauru'),
|
||||
pacificNiue(value: 'pacific/niue'),
|
||||
pacificNorfolk(value: 'pacific/norfolk'),
|
||||
pacificNoumea(value: 'pacific/noumea'),
|
||||
pacificPagoPago(value: 'pacific/pago_pago'),
|
||||
pacificPalau(value: 'pacific/palau'),
|
||||
pacificPitcairn(value: 'pacific/pitcairn'),
|
||||
pacificPohnpei(value: 'pacific/pohnpei'),
|
||||
pacificPortMoresby(value: 'pacific/port_moresby'),
|
||||
pacificRarotonga(value: 'pacific/rarotonga'),
|
||||
pacificSaipan(value: 'pacific/saipan'),
|
||||
pacificTahiti(value: 'pacific/tahiti'),
|
||||
pacificTarawa(value: 'pacific/tarawa'),
|
||||
pacificTongatapu(value: 'pacific/tongatapu'),
|
||||
pacificWake(value: 'pacific/wake'),
|
||||
pacificWallis(value: 'pacific/wallis'),
|
||||
utc(value: 'utc');
|
||||
|
||||
const Timezone({
|
||||
required this.value
|
||||
});
|
||||
const Timezone({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,41 +2,41 @@ 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;
|
||||
/// Memory used to compute hash.
|
||||
final int memoryCost;
|
||||
|
||||
/// Amount of time consumed to compute hash
|
||||
final int timeCost;
|
||||
/// Amount of time consumed to compute hash
|
||||
final int timeCost;
|
||||
|
||||
/// Number of threads used to compute hash.
|
||||
final int threads;
|
||||
/// Number of threads used to compute hash.
|
||||
final int threads;
|
||||
|
||||
AlgoArgon2({
|
||||
required this.type,
|
||||
required this.memoryCost,
|
||||
required this.timeCost,
|
||||
required this.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'],
|
||||
);
|
||||
}
|
||||
factory AlgoArgon2.fromMap(Map<String, dynamic> map) {
|
||||
return AlgoArgon2(
|
||||
type: map['type'].toString(),
|
||||
memoryCost: map['memoryCost'],
|
||||
timeCost: map['timeCost'],
|
||||
threads: map['threads'],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"memoryCost": memoryCost,
|
||||
"timeCost": timeCost,
|
||||
"threads": threads,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"memoryCost": memoryCost,
|
||||
"timeCost": timeCost,
|
||||
"threads": threads,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,47 +2,47 @@ 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;
|
||||
/// CPU complexity of computed hash.
|
||||
final int costCpu;
|
||||
|
||||
/// Memory complexity of computed hash.
|
||||
final int costMemory;
|
||||
/// Memory complexity of computed hash.
|
||||
final int costMemory;
|
||||
|
||||
/// Parallelization of computed hash.
|
||||
final int costParallel;
|
||||
/// Parallelization of computed hash.
|
||||
final int costParallel;
|
||||
|
||||
/// Length used to compute hash.
|
||||
final int length;
|
||||
/// Length used to compute hash.
|
||||
final int length;
|
||||
|
||||
AlgoScrypt({
|
||||
required this.type,
|
||||
required this.costCpu,
|
||||
required this.costMemory,
|
||||
required this.costParallel,
|
||||
required this.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'],
|
||||
);
|
||||
}
|
||||
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'],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"costCpu": costCpu,
|
||||
"costMemory": costMemory,
|
||||
"costParallel": costParallel,
|
||||
"length": length,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"costCpu": costCpu,
|
||||
"costMemory": costMemory,
|
||||
"costParallel": costParallel,
|
||||
"length": length,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,41 +2,41 @@ 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;
|
||||
/// Salt used to compute hash.
|
||||
final String salt;
|
||||
|
||||
/// Separator used to compute hash.
|
||||
final String saltSeparator;
|
||||
/// Separator used to compute hash.
|
||||
final String saltSeparator;
|
||||
|
||||
/// Key used to compute hash.
|
||||
final String signerKey;
|
||||
/// Key used to compute hash.
|
||||
final String signerKey;
|
||||
|
||||
AlgoScryptModified({
|
||||
required this.type,
|
||||
required this.salt,
|
||||
required this.saltSeparator,
|
||||
required this.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(),
|
||||
);
|
||||
}
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"salt": salt,
|
||||
"saltSeparator": saltSeparator,
|
||||
"signerKey": signerKey,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
"salt": salt,
|
||||
"saltSeparator": saltSeparator,
|
||||
"signerKey": signerKey,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"type": type,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Continents List
|
||||
class ContinentList implements Model {
|
||||
/// Total number of continents that matched your query.
|
||||
final int total;
|
||||
/// Total number of continents 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"continents": continents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"continents": continents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -2,29 +2,29 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Countries List
|
||||
class CountryList implements Model {
|
||||
/// Total number of countries that matched your query.
|
||||
final int total;
|
||||
/// Total number of countries 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"countries": countries.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"countries": countries.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,59 +2,59 @@ 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 name.
|
||||
final String name;
|
||||
|
||||
/// Currency native symbol.
|
||||
final String symbolNative;
|
||||
/// Currency native symbol.
|
||||
final String symbolNative;
|
||||
|
||||
/// Number of decimal digits.
|
||||
final int decimalDigits;
|
||||
/// Number of decimal digits.
|
||||
final int decimalDigits;
|
||||
|
||||
/// Currency digit rounding.
|
||||
final double rounding;
|
||||
/// 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 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 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,
|
||||
});
|
||||
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(),
|
||||
);
|
||||
}
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"symbol": symbol,
|
||||
"name": name,
|
||||
"symbolNative": symbolNative,
|
||||
"decimalDigits": decimalDigits,
|
||||
"rounding": rounding,
|
||||
"code": code,
|
||||
"namePlural": namePlural,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"symbol": symbol,
|
||||
"name": name,
|
||||
"symbolNative": symbolNative,
|
||||
"decimalDigits": decimalDigits,
|
||||
"rounding": rounding,
|
||||
"code": code,
|
||||
"namePlural": namePlural,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Currencies List
|
||||
class CurrencyList implements Model {
|
||||
/// Total number of currencies that matched your query.
|
||||
final int total;
|
||||
/// Total number of currencies 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"currencies": currencies.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"currencies": currencies.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,66 +2,66 @@ part of '../../models.dart';
|
||||
|
||||
/// Document
|
||||
class Document implements Model {
|
||||
/// Document ID.
|
||||
final String $id;
|
||||
/// Document ID.
|
||||
final String $id;
|
||||
|
||||
/// Document sequence ID.
|
||||
final int $sequence;
|
||||
/// Document sequence ID.
|
||||
final int $sequence;
|
||||
|
||||
/// Collection ID.
|
||||
final String $collectionId;
|
||||
/// Collection ID.
|
||||
final String $collectionId;
|
||||
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
|
||||
/// Document creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Document creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Document update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Document update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
/// Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
|
||||
final Map<String, dynamic> data;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
Document({
|
||||
required this.$id,
|
||||
required this.$sequence,
|
||||
required this.$collectionId,
|
||||
required this.$databaseId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.data,
|
||||
});
|
||||
Document({
|
||||
required this.$id,
|
||||
required this.$sequence,
|
||||
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(),
|
||||
$sequence: map['\$sequence'],
|
||||
$collectionId: map['\$collectionId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: List.from(map['\$permissions'] ?? []),
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
factory Document.fromMap(Map<String, dynamic> map) {
|
||||
return Document(
|
||||
$id: map['\$id'].toString(),
|
||||
$sequence: map['\$sequence'],
|
||||
$collectionId: map['\$collectionId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: List.from(map['\$permissions'] ?? []),
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$sequence": $sequence,
|
||||
"\$collectionId": $collectionId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$sequence": $sequence,
|
||||
"\$collectionId": $collectionId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
}
|
||||
|
||||
@@ -2,32 +2,33 @@ part of '../../models.dart';
|
||||
|
||||
/// Documents List
|
||||
class DocumentList implements Model {
|
||||
/// Total number of documents that matched your query.
|
||||
final int total;
|
||||
/// Total number of 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"documents": documents.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
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();
|
||||
}
|
||||
|
||||
+105
-101
@@ -2,125 +2,129 @@ 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 creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Execution update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Execution update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Execution roles.
|
||||
final List<String> $permissions;
|
||||
/// Execution roles.
|
||||
final List<String> $permissions;
|
||||
|
||||
/// Function ID.
|
||||
final String functionId;
|
||||
/// Function ID.
|
||||
final String functionId;
|
||||
|
||||
/// Function's deployment ID used to create the execution.
|
||||
final String deploymentId;
|
||||
/// Function's deployment ID used to create the execution.
|
||||
final String deploymentId;
|
||||
|
||||
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
|
||||
final enums.ExecutionTrigger trigger;
|
||||
/// The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
|
||||
final enums.ExecutionTrigger trigger;
|
||||
|
||||
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.
|
||||
final enums.ExecutionStatus status;
|
||||
/// The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`.
|
||||
final enums.ExecutionStatus status;
|
||||
|
||||
/// HTTP request method type.
|
||||
final String requestMethod;
|
||||
/// HTTP request method type.
|
||||
final String requestMethod;
|
||||
|
||||
/// HTTP request path and query.
|
||||
final String requestPath;
|
||||
/// HTTP request path and query.
|
||||
final String requestPath;
|
||||
|
||||
/// HTTP request 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 request 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 status code.
|
||||
final int responseStatusCode;
|
||||
|
||||
/// HTTP response body. This will return empty unless execution is created as synchronous.
|
||||
final String responseBody;
|
||||
/// 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;
|
||||
/// 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 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 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;
|
||||
|
||||
/// Resource(function/site) execution duration in seconds.
|
||||
final double duration;
|
||||
/// Resource(function/site) execution duration in seconds.
|
||||
final double duration;
|
||||
|
||||
/// The scheduled time for execution. If left empty, execution will be queued immediately.
|
||||
final String? scheduledAt;
|
||||
/// 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.deploymentId,
|
||||
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({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.functionId,
|
||||
required this.deploymentId,
|
||||
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: List.from(map['\$permissions'] ?? []),
|
||||
functionId: map['functionId'].toString(),
|
||||
deploymentId: map['deploymentId'].toString(),
|
||||
trigger: enums.ExecutionTrigger.values.firstWhere((e) => e.value == map['trigger']),
|
||||
status: enums.ExecutionStatus.values.firstWhere((e) => e.value == map['status']),
|
||||
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(),
|
||||
);
|
||||
}
|
||||
factory Execution.fromMap(Map<String, dynamic> map) {
|
||||
return Execution(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: List.from(map['\$permissions'] ?? []),
|
||||
functionId: map['functionId'].toString(),
|
||||
deploymentId: map['deploymentId'].toString(),
|
||||
trigger: enums.ExecutionTrigger.values
|
||||
.firstWhere((e) => e.value == map['trigger']),
|
||||
status: enums.ExecutionStatus.values
|
||||
.firstWhere((e) => e.value == map['status']),
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"functionId": functionId,
|
||||
"deploymentId": deploymentId,
|
||||
"trigger": trigger.value,
|
||||
"status": status.value,
|
||||
"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,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"functionId": functionId,
|
||||
"deploymentId": deploymentId,
|
||||
"trigger": trigger.value,
|
||||
"status": status.value,
|
||||
"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,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Executions List
|
||||
class ExecutionList implements Model {
|
||||
/// Total number of executions that matched your query.
|
||||
final int total;
|
||||
/// Total number of executions 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"executions": executions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"executions": executions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+76
-76
@@ -2,95 +2,95 @@ part of '../../models.dart';
|
||||
|
||||
/// File
|
||||
class File implements Model {
|
||||
/// File ID.
|
||||
final String $id;
|
||||
/// File ID.
|
||||
final String $id;
|
||||
|
||||
/// Bucket ID.
|
||||
final String bucketId;
|
||||
/// Bucket ID.
|
||||
final String bucketId;
|
||||
|
||||
/// File creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// File creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// File update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// File update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
/// File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
|
||||
/// File name.
|
||||
final String name;
|
||||
/// File name.
|
||||
final String name;
|
||||
|
||||
/// File MD5 signature.
|
||||
final String signature;
|
||||
/// File MD5 signature.
|
||||
final String signature;
|
||||
|
||||
/// File mime type.
|
||||
final String mimeType;
|
||||
/// File mime type.
|
||||
final String mimeType;
|
||||
|
||||
/// File original size in bytes.
|
||||
final int sizeOriginal;
|
||||
/// File original size in bytes.
|
||||
final int sizeOriginal;
|
||||
|
||||
/// Total number of chunks available
|
||||
final int chunksTotal;
|
||||
/// Total number of chunks available
|
||||
final int chunksTotal;
|
||||
|
||||
/// Total number of chunks uploaded
|
||||
final int chunksUploaded;
|
||||
/// Total number of chunks uploaded
|
||||
final int chunksUploaded;
|
||||
|
||||
/// Whether file contents are encrypted at rest.
|
||||
final bool encryption;
|
||||
/// Whether file contents are encrypted at rest.
|
||||
final bool encryption;
|
||||
|
||||
/// Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
final String compression;
|
||||
/// Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd).
|
||||
final String compression;
|
||||
|
||||
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,
|
||||
required this.encryption,
|
||||
required this.compression,
|
||||
});
|
||||
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,
|
||||
required this.encryption,
|
||||
required this.compression,
|
||||
});
|
||||
|
||||
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: List.from(map['\$permissions'] ?? []),
|
||||
name: map['name'].toString(),
|
||||
signature: map['signature'].toString(),
|
||||
mimeType: map['mimeType'].toString(),
|
||||
sizeOriginal: map['sizeOriginal'],
|
||||
chunksTotal: map['chunksTotal'],
|
||||
chunksUploaded: map['chunksUploaded'],
|
||||
encryption: map['encryption'],
|
||||
compression: map['compression'].toString(),
|
||||
);
|
||||
}
|
||||
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: List.from(map['\$permissions'] ?? []),
|
||||
name: map['name'].toString(),
|
||||
signature: map['signature'].toString(),
|
||||
mimeType: map['mimeType'].toString(),
|
||||
sizeOriginal: map['sizeOriginal'],
|
||||
chunksTotal: map['chunksTotal'],
|
||||
chunksUploaded: map['chunksUploaded'],
|
||||
encryption: map['encryption'],
|
||||
compression: map['compression'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
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,
|
||||
"encryption": encryption,
|
||||
"compression": compression,
|
||||
};
|
||||
}
|
||||
@override
|
||||
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,
|
||||
"encryption": encryption,
|
||||
"compression": compression,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ part of '../../models.dart';
|
||||
|
||||
/// Files List
|
||||
class FileList implements Model {
|
||||
/// Total number of files that matched your query.
|
||||
final int total;
|
||||
/// Total number of files 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"files": files.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"files": files.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -2,29 +2,29 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"value": value,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,77 +2,77 @@ 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 creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Identity update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Identity update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Identity Provider.
|
||||
final String provider;
|
||||
/// Identity Provider.
|
||||
final String provider;
|
||||
|
||||
/// ID of the User in the Identity Provider.
|
||||
final String providerUid;
|
||||
/// ID of the User in the Identity Provider.
|
||||
final String providerUid;
|
||||
|
||||
/// Email of the User in the Identity Provider.
|
||||
final String providerEmail;
|
||||
/// Email of the User in the Identity Provider.
|
||||
final String providerEmail;
|
||||
|
||||
/// Identity Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
/// Identity Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
|
||||
/// Identity Provider Refresh Token.
|
||||
final String providerRefreshToken;
|
||||
/// 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,
|
||||
});
|
||||
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(),
|
||||
);
|
||||
}
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
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,
|
||||
};
|
||||
}
|
||||
@override
|
||||
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,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Identities List
|
||||
class IdentityList implements Model {
|
||||
/// Total number of identities that matched your query.
|
||||
final int total;
|
||||
/// Total number of identities 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"identities": identities.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"identities": identities.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+16
-16
@@ -2,23 +2,23 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"jwt": jwt,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"jwt": jwt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,35 +2,35 @@ 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 two-character ISO 639-1 codes.
|
||||
final String code;
|
||||
|
||||
/// Language native name.
|
||||
final String nativeName;
|
||||
/// Language native name.
|
||||
final String nativeName;
|
||||
|
||||
Language({
|
||||
required this.name,
|
||||
required this.code,
|
||||
required this.nativeName,
|
||||
});
|
||||
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(),
|
||||
);
|
||||
}
|
||||
factory Language.fromMap(Map<String, dynamic> map) {
|
||||
return Language(
|
||||
name: map['name'].toString(),
|
||||
code: map['code'].toString(),
|
||||
nativeName: map['nativeName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
"nativeName": nativeName,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"name": name,
|
||||
"code": code,
|
||||
"nativeName": nativeName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Languages List
|
||||
class LanguageList implements Model {
|
||||
/// Total number of languages that matched your query.
|
||||
final int total;
|
||||
/// Total number of languages 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"languages": languages.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"languages": languages.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+46
-46
@@ -2,59 +2,59 @@ 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 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;
|
||||
/// 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 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;
|
||||
/// Continent name. This field support localization.
|
||||
final String continent;
|
||||
|
||||
/// True if country is part of the European Union.
|
||||
final bool eu;
|
||||
/// 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;
|
||||
/// 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,
|
||||
});
|
||||
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(),
|
||||
);
|
||||
}
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"ip": ip,
|
||||
"countryCode": countryCode,
|
||||
"country": country,
|
||||
"continentCode": continentCode,
|
||||
"continent": continent,
|
||||
"eu": eu,
|
||||
"currency": currency,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"ip": ip,
|
||||
"countryCode": countryCode,
|
||||
"country": country,
|
||||
"continentCode": continentCode,
|
||||
"continent": continent,
|
||||
"eu": eu,
|
||||
"currency": currency,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ 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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Locale codes list
|
||||
class LocaleCodeList implements Model {
|
||||
/// Total number of localeCodes that matched your query.
|
||||
final int total;
|
||||
/// Total number of localeCodes 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"localeCodes": localeCodes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"localeCodes": localeCodes.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+116
-116
@@ -2,143 +2,143 @@ 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 ID.
|
||||
final String userId;
|
||||
|
||||
/// User Email.
|
||||
final String userEmail;
|
||||
/// User Email.
|
||||
final String userEmail;
|
||||
|
||||
/// User Name.
|
||||
final String userName;
|
||||
/// User Name.
|
||||
final String userName;
|
||||
|
||||
/// API mode when event triggered.
|
||||
final String mode;
|
||||
/// API mode when event triggered.
|
||||
final String mode;
|
||||
|
||||
/// IP session in use when the session was created.
|
||||
final String ip;
|
||||
/// IP session in use when the session was created.
|
||||
final String ip;
|
||||
|
||||
/// Log creation date in ISO 8601 format.
|
||||
final String time;
|
||||
/// 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 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 name.
|
||||
final String osName;
|
||||
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
|
||||
/// Client type.
|
||||
final String clientType;
|
||||
/// 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 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 name.
|
||||
final String clientName;
|
||||
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
/// 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,
|
||||
});
|
||||
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(),
|
||||
);
|
||||
}
|
||||
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(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
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,
|
||||
};
|
||||
}
|
||||
@override
|
||||
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,29 +2,29 @@ part of '../../models.dart';
|
||||
|
||||
/// Logs List
|
||||
class LogList implements Model {
|
||||
/// Total number of logs that matched your query.
|
||||
final int total;
|
||||
/// Total number of logs 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))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"logs": logs.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"logs": logs.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,95 +2,95 @@ part of '../../models.dart';
|
||||
|
||||
/// Membership
|
||||
class Membership implements Model {
|
||||
/// Membership ID.
|
||||
final String $id;
|
||||
/// Membership ID.
|
||||
final String $id;
|
||||
|
||||
/// Membership creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Membership creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Membership update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Membership update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// User name. Hide this attribute by toggling membership privacy in the Console.
|
||||
final String userName;
|
||||
/// User name. Hide this attribute by toggling membership privacy in the Console.
|
||||
final String userName;
|
||||
|
||||
/// User email address. Hide this attribute by toggling membership privacy in the Console.
|
||||
final String userEmail;
|
||||
/// User email address. Hide this attribute by toggling membership privacy in the Console.
|
||||
final String userEmail;
|
||||
|
||||
/// Team ID.
|
||||
final String teamId;
|
||||
/// Team ID.
|
||||
final String teamId;
|
||||
|
||||
/// Team name.
|
||||
final String teamName;
|
||||
/// Team name.
|
||||
final String teamName;
|
||||
|
||||
/// Date, the user has been invited to join the team in ISO 8601 format.
|
||||
final String invited;
|
||||
/// Date, the user has been invited to join the team in ISO 8601 format.
|
||||
final String invited;
|
||||
|
||||
/// Date, the user has accepted the invitation to join the team in ISO 8601 format.
|
||||
final String joined;
|
||||
/// Date, the user has accepted the invitation to join the team in ISO 8601 format.
|
||||
final String joined;
|
||||
|
||||
/// User confirmation status, true if the user has joined the team or false otherwise.
|
||||
final bool confirm;
|
||||
/// User confirmation status, true if the user has joined the team or false otherwise.
|
||||
final bool confirm;
|
||||
|
||||
/// Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
||||
final bool mfa;
|
||||
/// Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.
|
||||
final bool mfa;
|
||||
|
||||
/// User list of roles
|
||||
final List<String> roles;
|
||||
/// User list of roles
|
||||
final List<String> roles;
|
||||
|
||||
Membership({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.userName,
|
||||
required this.userEmail,
|
||||
required this.teamId,
|
||||
required this.teamName,
|
||||
required this.invited,
|
||||
required this.joined,
|
||||
required this.confirm,
|
||||
required this.mfa,
|
||||
required this.roles,
|
||||
});
|
||||
Membership({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.userName,
|
||||
required this.userEmail,
|
||||
required this.teamId,
|
||||
required this.teamName,
|
||||
required this.invited,
|
||||
required this.joined,
|
||||
required this.confirm,
|
||||
required this.mfa,
|
||||
required this.roles,
|
||||
});
|
||||
|
||||
factory Membership.fromMap(Map<String, dynamic> map) {
|
||||
return Membership(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
userEmail: map['userEmail'].toString(),
|
||||
teamId: map['teamId'].toString(),
|
||||
teamName: map['teamName'].toString(),
|
||||
invited: map['invited'].toString(),
|
||||
joined: map['joined'].toString(),
|
||||
confirm: map['confirm'],
|
||||
mfa: map['mfa'],
|
||||
roles: List.from(map['roles'] ?? []),
|
||||
);
|
||||
}
|
||||
factory Membership.fromMap(Map<String, dynamic> map) {
|
||||
return Membership(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
userEmail: map['userEmail'].toString(),
|
||||
teamId: map['teamId'].toString(),
|
||||
teamName: map['teamName'].toString(),
|
||||
invited: map['invited'].toString(),
|
||||
joined: map['joined'].toString(),
|
||||
confirm: map['confirm'],
|
||||
mfa: map['mfa'],
|
||||
roles: List.from(map['roles'] ?? []),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"userName": userName,
|
||||
"userEmail": userEmail,
|
||||
"teamId": teamId,
|
||||
"teamName": teamName,
|
||||
"invited": invited,
|
||||
"joined": joined,
|
||||
"confirm": confirm,
|
||||
"mfa": mfa,
|
||||
"roles": roles,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"userName": userName,
|
||||
"userEmail": userEmail,
|
||||
"teamId": teamId,
|
||||
"teamName": teamName,
|
||||
"invited": invited,
|
||||
"joined": joined,
|
||||
"confirm": confirm,
|
||||
"mfa": mfa,
|
||||
"roles": roles,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Memberships List
|
||||
class MembershipList implements Model {
|
||||
/// Total number of memberships that matched your query.
|
||||
final int total;
|
||||
/// Total number of memberships that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of memberships.
|
||||
final List<Membership> memberships;
|
||||
/// List of memberships.
|
||||
final List<Membership> memberships;
|
||||
|
||||
MembershipList({
|
||||
required this.total,
|
||||
required this.memberships,
|
||||
});
|
||||
MembershipList({
|
||||
required this.total,
|
||||
required this.memberships,
|
||||
});
|
||||
|
||||
factory MembershipList.fromMap(Map<String, dynamic> map) {
|
||||
return MembershipList(
|
||||
total: map['total'],
|
||||
memberships: List<Membership>.from(map['memberships'].map((p) => Membership.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory MembershipList.fromMap(Map<String, dynamic> map) {
|
||||
return MembershipList(
|
||||
total: map['total'],
|
||||
memberships: List<Membership>.from(
|
||||
map['memberships'].map((p) => Membership.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"memberships": memberships.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"memberships": memberships.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,41 +2,41 @@ part of '../../models.dart';
|
||||
|
||||
/// MFA Challenge
|
||||
class MfaChallenge implements Model {
|
||||
/// Token ID.
|
||||
final String $id;
|
||||
/// Token ID.
|
||||
final String $id;
|
||||
|
||||
/// Token creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Token creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Token expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
/// Token expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
|
||||
MfaChallenge({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.userId,
|
||||
required this.expire,
|
||||
});
|
||||
MfaChallenge({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.userId,
|
||||
required this.expire,
|
||||
});
|
||||
|
||||
factory MfaChallenge.fromMap(Map<String, dynamic> map) {
|
||||
return MfaChallenge(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
);
|
||||
}
|
||||
factory MfaChallenge.fromMap(Map<String, dynamic> map) {
|
||||
return MfaChallenge(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"userId": userId,
|
||||
"expire": expire,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"userId": userId,
|
||||
"expire": expire,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,41 +2,41 @@ part of '../../models.dart';
|
||||
|
||||
/// MFAFactors
|
||||
class MfaFactors implements Model {
|
||||
/// Can TOTP be used for MFA challenge for this account.
|
||||
final bool totp;
|
||||
/// Can TOTP be used for MFA challenge for this account.
|
||||
final bool totp;
|
||||
|
||||
/// Can phone (SMS) be used for MFA challenge for this account.
|
||||
final bool phone;
|
||||
/// Can phone (SMS) be used for MFA challenge for this account.
|
||||
final bool phone;
|
||||
|
||||
/// Can email be used for MFA challenge for this account.
|
||||
final bool email;
|
||||
/// Can email be used for MFA challenge for this account.
|
||||
final bool email;
|
||||
|
||||
/// Can recovery code be used for MFA challenge for this account.
|
||||
final bool recoveryCode;
|
||||
/// Can recovery code be used for MFA challenge for this account.
|
||||
final bool recoveryCode;
|
||||
|
||||
MfaFactors({
|
||||
required this.totp,
|
||||
required this.phone,
|
||||
required this.email,
|
||||
required this.recoveryCode,
|
||||
});
|
||||
MfaFactors({
|
||||
required this.totp,
|
||||
required this.phone,
|
||||
required this.email,
|
||||
required this.recoveryCode,
|
||||
});
|
||||
|
||||
factory MfaFactors.fromMap(Map<String, dynamic> map) {
|
||||
return MfaFactors(
|
||||
totp: map['totp'],
|
||||
phone: map['phone'],
|
||||
email: map['email'],
|
||||
recoveryCode: map['recoveryCode'],
|
||||
);
|
||||
}
|
||||
factory MfaFactors.fromMap(Map<String, dynamic> map) {
|
||||
return MfaFactors(
|
||||
totp: map['totp'],
|
||||
phone: map['phone'],
|
||||
email: map['email'],
|
||||
recoveryCode: map['recoveryCode'],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"totp": totp,
|
||||
"phone": phone,
|
||||
"email": email,
|
||||
"recoveryCode": recoveryCode,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"totp": totp,
|
||||
"phone": phone,
|
||||
"email": email,
|
||||
"recoveryCode": recoveryCode,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,23 +2,23 @@ part of '../../models.dart';
|
||||
|
||||
/// MFA Recovery Codes
|
||||
class MfaRecoveryCodes implements Model {
|
||||
/// Recovery codes.
|
||||
final List<String> recoveryCodes;
|
||||
/// Recovery codes.
|
||||
final List<String> recoveryCodes;
|
||||
|
||||
MfaRecoveryCodes({
|
||||
required this.recoveryCodes,
|
||||
});
|
||||
MfaRecoveryCodes({
|
||||
required this.recoveryCodes,
|
||||
});
|
||||
|
||||
factory MfaRecoveryCodes.fromMap(Map<String, dynamic> map) {
|
||||
return MfaRecoveryCodes(
|
||||
recoveryCodes: List.from(map['recoveryCodes'] ?? []),
|
||||
);
|
||||
}
|
||||
factory MfaRecoveryCodes.fromMap(Map<String, dynamic> map) {
|
||||
return MfaRecoveryCodes(
|
||||
recoveryCodes: List.from(map['recoveryCodes'] ?? []),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"recoveryCodes": recoveryCodes,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"recoveryCodes": recoveryCodes,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ part of '../../models.dart';
|
||||
|
||||
/// MFAType
|
||||
class MfaType implements Model {
|
||||
/// Secret token used for TOTP factor.
|
||||
final String secret;
|
||||
/// Secret token used for TOTP factor.
|
||||
final String secret;
|
||||
|
||||
/// URI for authenticator apps.
|
||||
final String uri;
|
||||
/// URI for authenticator apps.
|
||||
final String uri;
|
||||
|
||||
MfaType({
|
||||
required this.secret,
|
||||
required this.uri,
|
||||
});
|
||||
MfaType({
|
||||
required this.secret,
|
||||
required this.uri,
|
||||
});
|
||||
|
||||
factory MfaType.fromMap(Map<String, dynamic> map) {
|
||||
return MfaType(
|
||||
secret: map['secret'].toString(),
|
||||
uri: map['uri'].toString(),
|
||||
);
|
||||
}
|
||||
factory MfaType.fromMap(Map<String, dynamic> map) {
|
||||
return MfaType(
|
||||
secret: map['secret'].toString(),
|
||||
uri: map['uri'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"secret": secret,
|
||||
"uri": uri,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"secret": secret,
|
||||
"uri": uri,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ part of '../../models.dart';
|
||||
|
||||
abstract class Model {
|
||||
Map<String, dynamic> toMap();
|
||||
}
|
||||
}
|
||||
|
||||
+26
-26
@@ -2,35 +2,35 @@ part of '../../models.dart';
|
||||
|
||||
/// Phone
|
||||
class Phone implements Model {
|
||||
/// Phone code.
|
||||
final String code;
|
||||
/// Phone code.
|
||||
final String code;
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
|
||||
Phone({
|
||||
required this.code,
|
||||
required this.countryCode,
|
||||
required this.countryName,
|
||||
});
|
||||
Phone({
|
||||
required this.code,
|
||||
required this.countryCode,
|
||||
required this.countryName,
|
||||
});
|
||||
|
||||
factory Phone.fromMap(Map<String, dynamic> map) {
|
||||
return Phone(
|
||||
code: map['code'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
countryName: map['countryName'].toString(),
|
||||
);
|
||||
}
|
||||
factory Phone.fromMap(Map<String, dynamic> map) {
|
||||
return Phone(
|
||||
code: map['code'].toString(),
|
||||
countryCode: map['countryCode'].toString(),
|
||||
countryName: map['countryName'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"countryCode": countryCode,
|
||||
"countryName": countryName,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"code": code,
|
||||
"countryCode": countryCode,
|
||||
"countryName": countryName,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ part of '../../models.dart';
|
||||
|
||||
/// Phones List
|
||||
class PhoneList implements Model {
|
||||
/// Total number of phones that matched your query.
|
||||
final int total;
|
||||
/// Total number of phones that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of phones.
|
||||
final List<Phone> phones;
|
||||
/// List of phones.
|
||||
final List<Phone> phones;
|
||||
|
||||
PhoneList({
|
||||
required this.total,
|
||||
required this.phones,
|
||||
});
|
||||
PhoneList({
|
||||
required this.total,
|
||||
required this.phones,
|
||||
});
|
||||
|
||||
factory PhoneList.fromMap(Map<String, dynamic> map) {
|
||||
return PhoneList(
|
||||
total: map['total'],
|
||||
phones: List<Phone>.from(map['phones'].map((p) => Phone.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory PhoneList.fromMap(Map<String, dynamic> map) {
|
||||
return PhoneList(
|
||||
total: map['total'],
|
||||
phones: List<Phone>.from(map['phones'].map((p) => Phone.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"phones": phones.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"phones": phones.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,24 +2,24 @@ part of '../../models.dart';
|
||||
|
||||
/// Preferences
|
||||
class Preferences implements Model {
|
||||
final Map<String, dynamic> data;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
Preferences({
|
||||
required this.data,
|
||||
});
|
||||
Preferences({
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory Preferences.fromMap(Map<String, dynamic> map) {
|
||||
return Preferences(
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
factory Preferences.fromMap(Map<String, dynamic> map) {
|
||||
return Preferences(
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
}
|
||||
|
||||
+51
-51
@@ -2,66 +2,66 @@ part of '../../models.dart';
|
||||
|
||||
/// Row
|
||||
class Row implements Model {
|
||||
/// Row ID.
|
||||
final String $id;
|
||||
/// Row ID.
|
||||
final String $id;
|
||||
|
||||
/// Row sequence ID.
|
||||
final int $sequence;
|
||||
/// Row sequence ID.
|
||||
final int $sequence;
|
||||
|
||||
/// Table ID.
|
||||
final String $tableId;
|
||||
/// Table ID.
|
||||
final String $tableId;
|
||||
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
/// Database ID.
|
||||
final String $databaseId;
|
||||
|
||||
/// Row creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Row creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Row update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Row update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
/// Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
||||
final List<String> $permissions;
|
||||
|
||||
final Map<String, dynamic> data;
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
Row({
|
||||
required this.$id,
|
||||
required this.$sequence,
|
||||
required this.$tableId,
|
||||
required this.$databaseId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.data,
|
||||
});
|
||||
Row({
|
||||
required this.$id,
|
||||
required this.$sequence,
|
||||
required this.$tableId,
|
||||
required this.$databaseId,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.$permissions,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory Row.fromMap(Map<String, dynamic> map) {
|
||||
return Row(
|
||||
$id: map['\$id'].toString(),
|
||||
$sequence: map['\$sequence'],
|
||||
$tableId: map['\$tableId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: List.from(map['\$permissions'] ?? []),
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
factory Row.fromMap(Map<String, dynamic> map) {
|
||||
return Row(
|
||||
$id: map['\$id'].toString(),
|
||||
$sequence: map['\$sequence'],
|
||||
$tableId: map['\$tableId'].toString(),
|
||||
$databaseId: map['\$databaseId'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
$permissions: List.from(map['\$permissions'] ?? []),
|
||||
data: map["data"] ?? map,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$sequence": $sequence,
|
||||
"\$tableId": $tableId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$sequence": $sequence,
|
||||
"\$tableId": $tableId,
|
||||
"\$databaseId": $databaseId,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"\$permissions": $permissions,
|
||||
"data": data,
|
||||
};
|
||||
}
|
||||
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
T convertTo<T>(T Function(Map<String, dynamic>) fromJson) => fromJson(data);
|
||||
}
|
||||
|
||||
@@ -2,32 +2,32 @@ part of '../../models.dart';
|
||||
|
||||
/// Rows List
|
||||
class RowList implements Model {
|
||||
/// Total number of rows that matched your query.
|
||||
final int total;
|
||||
/// Total number of rows that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of rows.
|
||||
final List<Row> rows;
|
||||
/// List of rows.
|
||||
final List<Row> rows;
|
||||
|
||||
RowList({
|
||||
required this.total,
|
||||
required this.rows,
|
||||
});
|
||||
RowList({
|
||||
required this.total,
|
||||
required this.rows,
|
||||
});
|
||||
|
||||
factory RowList.fromMap(Map<String, dynamic> map) {
|
||||
return RowList(
|
||||
total: map['total'],
|
||||
rows: List<Row>.from(map['rows'].map((p) => Row.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory RowList.fromMap(Map<String, dynamic> map) {
|
||||
return RowList(
|
||||
total: map['total'],
|
||||
rows: List<Row>.from(map['rows'].map((p) => Row.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"rows": rows.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"rows": rows.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
|
||||
List<T> convertTo<T>(T Function(Map) fromJson) =>
|
||||
rows.map((d) => d.convertTo<T>(fromJson)).toList();
|
||||
List<T> convertTo<T>(T Function(Map) fromJson) =>
|
||||
rows.map((d) => d.convertTo<T>(fromJson)).toList();
|
||||
}
|
||||
|
||||
+156
-156
@@ -2,191 +2,191 @@ part of '../../models.dart';
|
||||
|
||||
/// Session
|
||||
class Session implements Model {
|
||||
/// Session ID.
|
||||
final String $id;
|
||||
/// Session ID.
|
||||
final String $id;
|
||||
|
||||
/// Session creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Session creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Session update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Session update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Session expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
/// Session expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
|
||||
/// Session Provider.
|
||||
final String provider;
|
||||
/// Session Provider.
|
||||
final String provider;
|
||||
|
||||
/// Session Provider User ID.
|
||||
final String providerUid;
|
||||
/// Session Provider User ID.
|
||||
final String providerUid;
|
||||
|
||||
/// Session Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
/// Session Provider Access Token.
|
||||
final String providerAccessToken;
|
||||
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
/// The date of when the access token expires in ISO 8601 format.
|
||||
final String providerAccessTokenExpiry;
|
||||
|
||||
/// Session Provider Refresh Token.
|
||||
final String providerRefreshToken;
|
||||
/// Session Provider Refresh Token.
|
||||
final String providerRefreshToken;
|
||||
|
||||
/// IP in use when the session was created.
|
||||
final String ip;
|
||||
/// IP in use when the session was created.
|
||||
final String ip;
|
||||
|
||||
/// 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 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 name.
|
||||
final String osName;
|
||||
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
/// Operating system version.
|
||||
final String osVersion;
|
||||
|
||||
/// Client type.
|
||||
final String clientType;
|
||||
/// 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 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 name.
|
||||
final String clientName;
|
||||
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
/// Client version.
|
||||
final String clientVersion;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
/// Client engine name.
|
||||
final String clientEngine;
|
||||
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
/// Client engine name.
|
||||
final String clientEngineVersion;
|
||||
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
/// Device name.
|
||||
final String deviceName;
|
||||
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
/// Device brand name.
|
||||
final String deviceBrand;
|
||||
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
/// Device model name.
|
||||
final String deviceModel;
|
||||
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
/// Country two-character ISO 3166-1 alpha code.
|
||||
final String countryCode;
|
||||
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
/// Country name.
|
||||
final String countryName;
|
||||
|
||||
/// Returns true if this the current user session.
|
||||
final bool current;
|
||||
/// Returns true if this the current user session.
|
||||
final bool current;
|
||||
|
||||
/// Returns a list of active session factors.
|
||||
final List<String> factors;
|
||||
/// Returns a list of active session factors.
|
||||
final List<String> factors;
|
||||
|
||||
/// Secret used to authenticate the user. Only included if the request was made with an API key
|
||||
final String secret;
|
||||
/// Secret used to authenticate the user. Only included if the request was made with an API key
|
||||
final String secret;
|
||||
|
||||
/// Most recent date in ISO 8601 format when the session successfully passed MFA challenge.
|
||||
final String mfaUpdatedAt;
|
||||
/// Most recent date in ISO 8601 format when the session successfully passed MFA challenge.
|
||||
final String mfaUpdatedAt;
|
||||
|
||||
Session({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.expire,
|
||||
required this.provider,
|
||||
required this.providerUid,
|
||||
required this.providerAccessToken,
|
||||
required this.providerAccessTokenExpiry,
|
||||
required this.providerRefreshToken,
|
||||
required this.ip,
|
||||
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,
|
||||
required this.current,
|
||||
required this.factors,
|
||||
required this.secret,
|
||||
required this.mfaUpdatedAt,
|
||||
});
|
||||
Session({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.userId,
|
||||
required this.expire,
|
||||
required this.provider,
|
||||
required this.providerUid,
|
||||
required this.providerAccessToken,
|
||||
required this.providerAccessTokenExpiry,
|
||||
required this.providerRefreshToken,
|
||||
required this.ip,
|
||||
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,
|
||||
required this.current,
|
||||
required this.factors,
|
||||
required this.secret,
|
||||
required this.mfaUpdatedAt,
|
||||
});
|
||||
|
||||
factory Session.fromMap(Map<String, dynamic> map) {
|
||||
return Session(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
provider: map['provider'].toString(),
|
||||
providerUid: map['providerUid'].toString(),
|
||||
providerAccessToken: map['providerAccessToken'].toString(),
|
||||
providerAccessTokenExpiry: map['providerAccessTokenExpiry'].toString(),
|
||||
providerRefreshToken: map['providerRefreshToken'].toString(),
|
||||
ip: map['ip'].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(),
|
||||
current: map['current'],
|
||||
factors: List.from(map['factors'] ?? []),
|
||||
secret: map['secret'].toString(),
|
||||
mfaUpdatedAt: map['mfaUpdatedAt'].toString(),
|
||||
);
|
||||
}
|
||||
factory Session.fromMap(Map<String, dynamic> map) {
|
||||
return Session(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
provider: map['provider'].toString(),
|
||||
providerUid: map['providerUid'].toString(),
|
||||
providerAccessToken: map['providerAccessToken'].toString(),
|
||||
providerAccessTokenExpiry: map['providerAccessTokenExpiry'].toString(),
|
||||
providerRefreshToken: map['providerRefreshToken'].toString(),
|
||||
ip: map['ip'].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(),
|
||||
current: map['current'],
|
||||
factors: List.from(map['factors'] ?? []),
|
||||
secret: map['secret'].toString(),
|
||||
mfaUpdatedAt: map['mfaUpdatedAt'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"expire": expire,
|
||||
"provider": provider,
|
||||
"providerUid": providerUid,
|
||||
"providerAccessToken": providerAccessToken,
|
||||
"providerAccessTokenExpiry": providerAccessTokenExpiry,
|
||||
"providerRefreshToken": providerRefreshToken,
|
||||
"ip": ip,
|
||||
"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,
|
||||
"current": current,
|
||||
"factors": factors,
|
||||
"secret": secret,
|
||||
"mfaUpdatedAt": mfaUpdatedAt,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"userId": userId,
|
||||
"expire": expire,
|
||||
"provider": provider,
|
||||
"providerUid": providerUid,
|
||||
"providerAccessToken": providerAccessToken,
|
||||
"providerAccessTokenExpiry": providerAccessTokenExpiry,
|
||||
"providerRefreshToken": providerRefreshToken,
|
||||
"ip": ip,
|
||||
"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,
|
||||
"current": current,
|
||||
"factors": factors,
|
||||
"secret": secret,
|
||||
"mfaUpdatedAt": mfaUpdatedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Sessions List
|
||||
class SessionList implements Model {
|
||||
/// Total number of sessions that matched your query.
|
||||
final int total;
|
||||
/// Total number of sessions that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of sessions.
|
||||
final List<Session> sessions;
|
||||
/// List of sessions.
|
||||
final List<Session> sessions;
|
||||
|
||||
SessionList({
|
||||
required this.total,
|
||||
required this.sessions,
|
||||
});
|
||||
SessionList({
|
||||
required this.total,
|
||||
required this.sessions,
|
||||
});
|
||||
|
||||
factory SessionList.fromMap(Map<String, dynamic> map) {
|
||||
return SessionList(
|
||||
total: map['total'],
|
||||
sessions: List<Session>.from(map['sessions'].map((p) => Session.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory SessionList.fromMap(Map<String, dynamic> map) {
|
||||
return SessionList(
|
||||
total: map['total'],
|
||||
sessions:
|
||||
List<Session>.from(map['sessions'].map((p) => Session.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"sessions": sessions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"sessions": sessions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,71 +2,71 @@ part of '../../models.dart';
|
||||
|
||||
/// Subscriber
|
||||
class Subscriber implements Model {
|
||||
/// Subscriber ID.
|
||||
final String $id;
|
||||
/// Subscriber ID.
|
||||
final String $id;
|
||||
|
||||
/// Subscriber creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Subscriber creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Subscriber update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Subscriber update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Target ID.
|
||||
final String targetId;
|
||||
/// Target ID.
|
||||
final String targetId;
|
||||
|
||||
/// Target.
|
||||
final Target target;
|
||||
/// Target.
|
||||
final Target target;
|
||||
|
||||
/// Topic ID.
|
||||
final String userId;
|
||||
/// Topic ID.
|
||||
final String userId;
|
||||
|
||||
/// User Name.
|
||||
final String userName;
|
||||
/// User Name.
|
||||
final String userName;
|
||||
|
||||
/// Topic ID.
|
||||
final String topicId;
|
||||
/// Topic ID.
|
||||
final String topicId;
|
||||
|
||||
/// The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
||||
final String providerType;
|
||||
/// The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
||||
final String providerType;
|
||||
|
||||
Subscriber({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.targetId,
|
||||
required this.target,
|
||||
required this.userId,
|
||||
required this.userName,
|
||||
required this.topicId,
|
||||
required this.providerType,
|
||||
});
|
||||
Subscriber({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.targetId,
|
||||
required this.target,
|
||||
required this.userId,
|
||||
required this.userName,
|
||||
required this.topicId,
|
||||
required this.providerType,
|
||||
});
|
||||
|
||||
factory Subscriber.fromMap(Map<String, dynamic> map) {
|
||||
return Subscriber(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
targetId: map['targetId'].toString(),
|
||||
target: Target.fromMap(map['target']),
|
||||
userId: map['userId'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
topicId: map['topicId'].toString(),
|
||||
providerType: map['providerType'].toString(),
|
||||
);
|
||||
}
|
||||
factory Subscriber.fromMap(Map<String, dynamic> map) {
|
||||
return Subscriber(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
targetId: map['targetId'].toString(),
|
||||
target: Target.fromMap(map['target']),
|
||||
userId: map['userId'].toString(),
|
||||
userName: map['userName'].toString(),
|
||||
topicId: map['topicId'].toString(),
|
||||
providerType: map['providerType'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"targetId": targetId,
|
||||
"target": target.toMap(),
|
||||
"userId": userId,
|
||||
"userName": userName,
|
||||
"topicId": topicId,
|
||||
"providerType": providerType,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"targetId": targetId,
|
||||
"target": target.toMap(),
|
||||
"userId": userId,
|
||||
"userName": userName,
|
||||
"topicId": topicId,
|
||||
"providerType": providerType,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+56
-56
@@ -2,71 +2,71 @@ part of '../../models.dart';
|
||||
|
||||
/// Target
|
||||
class Target implements Model {
|
||||
/// Target ID.
|
||||
final String $id;
|
||||
/// Target ID.
|
||||
final String $id;
|
||||
|
||||
/// Target creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Target creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Target update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Target update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Target Name.
|
||||
final String name;
|
||||
/// Target Name.
|
||||
final String name;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Provider ID.
|
||||
final String? providerId;
|
||||
/// Provider ID.
|
||||
final String? providerId;
|
||||
|
||||
/// The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
||||
final String providerType;
|
||||
/// The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
||||
final String providerType;
|
||||
|
||||
/// The target identifier.
|
||||
final String identifier;
|
||||
/// The target identifier.
|
||||
final String identifier;
|
||||
|
||||
/// Is the target expired.
|
||||
final bool expired;
|
||||
/// Is the target expired.
|
||||
final bool expired;
|
||||
|
||||
Target({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
required this.userId,
|
||||
this.providerId,
|
||||
required this.providerType,
|
||||
required this.identifier,
|
||||
required this.expired,
|
||||
});
|
||||
Target({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
required this.userId,
|
||||
this.providerId,
|
||||
required this.providerType,
|
||||
required this.identifier,
|
||||
required this.expired,
|
||||
});
|
||||
|
||||
factory Target.fromMap(Map<String, dynamic> map) {
|
||||
return Target(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
providerId: map['providerId']?.toString(),
|
||||
providerType: map['providerType'].toString(),
|
||||
identifier: map['identifier'].toString(),
|
||||
expired: map['expired'],
|
||||
);
|
||||
}
|
||||
factory Target.fromMap(Map<String, dynamic> map) {
|
||||
return Target(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
providerId: map['providerId']?.toString(),
|
||||
providerType: map['providerType'].toString(),
|
||||
identifier: map['identifier'].toString(),
|
||||
expired: map['expired'],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"userId": userId,
|
||||
"providerId": providerId,
|
||||
"providerType": providerType,
|
||||
"identifier": identifier,
|
||||
"expired": expired,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"userId": userId,
|
||||
"providerId": providerId,
|
||||
"providerType": providerType,
|
||||
"identifier": identifier,
|
||||
"expired": expired,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+41
-41
@@ -2,53 +2,53 @@ part of '../../models.dart';
|
||||
|
||||
/// Team
|
||||
class Team implements Model {
|
||||
/// Team ID.
|
||||
final String $id;
|
||||
/// Team ID.
|
||||
final String $id;
|
||||
|
||||
/// Team creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Team creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Team update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Team update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Team name.
|
||||
final String name;
|
||||
/// Team name.
|
||||
final String name;
|
||||
|
||||
/// Total number of team members.
|
||||
final int total;
|
||||
/// Total number of team members.
|
||||
final int total;
|
||||
|
||||
/// Team preferences as a key-value object
|
||||
final Preferences prefs;
|
||||
/// Team preferences as a key-value object
|
||||
final Preferences prefs;
|
||||
|
||||
Team({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
required this.total,
|
||||
required this.prefs,
|
||||
});
|
||||
Team({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
required this.total,
|
||||
required this.prefs,
|
||||
});
|
||||
|
||||
factory Team.fromMap(Map<String, dynamic> map) {
|
||||
return Team(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
total: map['total'],
|
||||
prefs: Preferences.fromMap(map['prefs']),
|
||||
);
|
||||
}
|
||||
factory Team.fromMap(Map<String, dynamic> map) {
|
||||
return Team(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
total: map['total'],
|
||||
prefs: Preferences.fromMap(map['prefs']),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"total": total,
|
||||
"prefs": prefs.toMap(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"total": total,
|
||||
"prefs": prefs.toMap(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,29 @@ part of '../../models.dart';
|
||||
|
||||
/// Teams List
|
||||
class TeamList implements Model {
|
||||
/// Total number of teams that matched your query.
|
||||
final int total;
|
||||
/// Total number of teams that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of teams.
|
||||
final List<Team> teams;
|
||||
/// List of teams.
|
||||
final List<Team> teams;
|
||||
|
||||
TeamList({
|
||||
required this.total,
|
||||
required this.teams,
|
||||
});
|
||||
TeamList({
|
||||
required this.total,
|
||||
required this.teams,
|
||||
});
|
||||
|
||||
factory TeamList.fromMap(Map<String, dynamic> map) {
|
||||
return TeamList(
|
||||
total: map['total'],
|
||||
teams: List<Team>.from(map['teams'].map((p) => Team.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory TeamList.fromMap(Map<String, dynamic> map) {
|
||||
return TeamList(
|
||||
total: map['total'],
|
||||
teams: List<Team>.from(map['teams'].map((p) => Team.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"teams": teams.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"teams": teams.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+41
-41
@@ -2,53 +2,53 @@ part of '../../models.dart';
|
||||
|
||||
/// Token
|
||||
class Token implements Model {
|
||||
/// Token ID.
|
||||
final String $id;
|
||||
/// Token ID.
|
||||
final String $id;
|
||||
|
||||
/// Token creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Token creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// User ID.
|
||||
final String userId;
|
||||
/// User ID.
|
||||
final String userId;
|
||||
|
||||
/// Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String secret;
|
||||
/// Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.
|
||||
final String secret;
|
||||
|
||||
/// Token expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
/// Token expiration date in ISO 8601 format.
|
||||
final String expire;
|
||||
|
||||
/// Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.
|
||||
final String phrase;
|
||||
/// Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.
|
||||
final String phrase;
|
||||
|
||||
Token({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.userId,
|
||||
required this.secret,
|
||||
required this.expire,
|
||||
required this.phrase,
|
||||
});
|
||||
Token({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.userId,
|
||||
required this.secret,
|
||||
required this.expire,
|
||||
required this.phrase,
|
||||
});
|
||||
|
||||
factory Token.fromMap(Map<String, dynamic> map) {
|
||||
return Token(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
secret: map['secret'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
phrase: map['phrase'].toString(),
|
||||
);
|
||||
}
|
||||
factory Token.fromMap(Map<String, dynamic> map) {
|
||||
return Token(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
userId: map['userId'].toString(),
|
||||
secret: map['secret'].toString(),
|
||||
expire: map['expire'].toString(),
|
||||
phrase: map['phrase'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"userId": userId,
|
||||
"secret": secret,
|
||||
"expire": expire,
|
||||
"phrase": phrase,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"userId": userId,
|
||||
"secret": secret,
|
||||
"expire": expire,
|
||||
"phrase": phrase,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,53 +2,53 @@ part of '../../models.dart';
|
||||
|
||||
/// Transaction
|
||||
class Transaction implements Model {
|
||||
/// Transaction ID.
|
||||
final String $id;
|
||||
/// Transaction ID.
|
||||
final String $id;
|
||||
|
||||
/// Transaction creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// Transaction creation time in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// Transaction update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// Transaction update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.
|
||||
final String status;
|
||||
/// Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.
|
||||
final String status;
|
||||
|
||||
/// Number of operations in the transaction.
|
||||
final int operations;
|
||||
/// Number of operations in the transaction.
|
||||
final int operations;
|
||||
|
||||
/// Expiration time in ISO 8601 format.
|
||||
final String expiresAt;
|
||||
/// Expiration time in ISO 8601 format.
|
||||
final String expiresAt;
|
||||
|
||||
Transaction({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.status,
|
||||
required this.operations,
|
||||
required this.expiresAt,
|
||||
});
|
||||
Transaction({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.status,
|
||||
required this.operations,
|
||||
required this.expiresAt,
|
||||
});
|
||||
|
||||
factory Transaction.fromMap(Map<String, dynamic> map) {
|
||||
return Transaction(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
status: map['status'].toString(),
|
||||
operations: map['operations'],
|
||||
expiresAt: map['expiresAt'].toString(),
|
||||
);
|
||||
}
|
||||
factory Transaction.fromMap(Map<String, dynamic> map) {
|
||||
return Transaction(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
status: map['status'].toString(),
|
||||
operations: map['operations'],
|
||||
expiresAt: map['expiresAt'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"status": status,
|
||||
"operations": operations,
|
||||
"expiresAt": expiresAt,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"status": status,
|
||||
"operations": operations,
|
||||
"expiresAt": expiresAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,29 +2,30 @@ part of '../../models.dart';
|
||||
|
||||
/// Transaction List
|
||||
class TransactionList implements Model {
|
||||
/// Total number of transactions that matched your query.
|
||||
final int total;
|
||||
/// Total number of transactions that matched your query.
|
||||
final int total;
|
||||
|
||||
/// List of transactions.
|
||||
final List<Transaction> transactions;
|
||||
/// List of transactions.
|
||||
final List<Transaction> transactions;
|
||||
|
||||
TransactionList({
|
||||
required this.total,
|
||||
required this.transactions,
|
||||
});
|
||||
TransactionList({
|
||||
required this.total,
|
||||
required this.transactions,
|
||||
});
|
||||
|
||||
factory TransactionList.fromMap(Map<String, dynamic> map) {
|
||||
return TransactionList(
|
||||
total: map['total'],
|
||||
transactions: List<Transaction>.from(map['transactions'].map((p) => Transaction.fromMap(p))),
|
||||
);
|
||||
}
|
||||
factory TransactionList.fromMap(Map<String, dynamic> map) {
|
||||
return TransactionList(
|
||||
total: map['total'],
|
||||
transactions: List<Transaction>.from(
|
||||
map['transactions'].map((p) => Transaction.fromMap(p))),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"transactions": transactions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"total": total,
|
||||
"transactions": transactions.map((p) => p.toMap()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+106
-106
@@ -2,131 +2,131 @@ part of '../../models.dart';
|
||||
|
||||
/// User
|
||||
class User implements Model {
|
||||
/// User ID.
|
||||
final String $id;
|
||||
/// User ID.
|
||||
final String $id;
|
||||
|
||||
/// User creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
/// User creation date in ISO 8601 format.
|
||||
final String $createdAt;
|
||||
|
||||
/// User update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
/// User update date in ISO 8601 format.
|
||||
final String $updatedAt;
|
||||
|
||||
/// User name.
|
||||
final String name;
|
||||
/// User name.
|
||||
final String name;
|
||||
|
||||
/// Hashed user password.
|
||||
final String? password;
|
||||
/// Hashed user password.
|
||||
final String? password;
|
||||
|
||||
/// Password hashing algorithm.
|
||||
final String? hash;
|
||||
/// Password hashing algorithm.
|
||||
final String? hash;
|
||||
|
||||
/// Password hashing algorithm configuration.
|
||||
final Map? hashOptions;
|
||||
/// Password hashing algorithm configuration.
|
||||
final Map? hashOptions;
|
||||
|
||||
/// User registration date in ISO 8601 format.
|
||||
final String registration;
|
||||
/// User registration date in ISO 8601 format.
|
||||
final String registration;
|
||||
|
||||
/// User status. Pass `true` for enabled and `false` for disabled.
|
||||
final bool status;
|
||||
/// User status. Pass `true` for enabled and `false` for disabled.
|
||||
final bool status;
|
||||
|
||||
/// Labels for the user.
|
||||
final List<String> labels;
|
||||
/// Labels for the user.
|
||||
final List<String> labels;
|
||||
|
||||
/// Password update time in ISO 8601 format.
|
||||
final String passwordUpdate;
|
||||
/// Password update time in ISO 8601 format.
|
||||
final String passwordUpdate;
|
||||
|
||||
/// User email address.
|
||||
final String email;
|
||||
/// User email address.
|
||||
final String email;
|
||||
|
||||
/// User phone number in E.164 format.
|
||||
final String phone;
|
||||
/// User phone number in E.164 format.
|
||||
final String phone;
|
||||
|
||||
/// Email verification status.
|
||||
final bool emailVerification;
|
||||
/// Email verification status.
|
||||
final bool emailVerification;
|
||||
|
||||
/// Phone verification status.
|
||||
final bool phoneVerification;
|
||||
/// Phone verification status.
|
||||
final bool phoneVerification;
|
||||
|
||||
/// Multi factor authentication status.
|
||||
final bool mfa;
|
||||
/// Multi factor authentication status.
|
||||
final bool mfa;
|
||||
|
||||
/// User preferences as a key-value object
|
||||
final Preferences prefs;
|
||||
/// User preferences as a key-value object
|
||||
final Preferences prefs;
|
||||
|
||||
/// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.
|
||||
final List<Target> targets;
|
||||
/// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.
|
||||
final List<Target> targets;
|
||||
|
||||
/// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
|
||||
final String accessedAt;
|
||||
/// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
|
||||
final String accessedAt;
|
||||
|
||||
User({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
this.password,
|
||||
this.hash,
|
||||
this.hashOptions,
|
||||
required this.registration,
|
||||
required this.status,
|
||||
required this.labels,
|
||||
required this.passwordUpdate,
|
||||
required this.email,
|
||||
required this.phone,
|
||||
required this.emailVerification,
|
||||
required this.phoneVerification,
|
||||
required this.mfa,
|
||||
required this.prefs,
|
||||
required this.targets,
|
||||
required this.accessedAt,
|
||||
});
|
||||
User({
|
||||
required this.$id,
|
||||
required this.$createdAt,
|
||||
required this.$updatedAt,
|
||||
required this.name,
|
||||
this.password,
|
||||
this.hash,
|
||||
this.hashOptions,
|
||||
required this.registration,
|
||||
required this.status,
|
||||
required this.labels,
|
||||
required this.passwordUpdate,
|
||||
required this.email,
|
||||
required this.phone,
|
||||
required this.emailVerification,
|
||||
required this.phoneVerification,
|
||||
required this.mfa,
|
||||
required this.prefs,
|
||||
required this.targets,
|
||||
required this.accessedAt,
|
||||
});
|
||||
|
||||
factory User.fromMap(Map<String, dynamic> map) {
|
||||
return User(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
password: map['password']?.toString(),
|
||||
hash: map['hash']?.toString(),
|
||||
hashOptions: map['hashOptions'],
|
||||
registration: map['registration'].toString(),
|
||||
status: map['status'],
|
||||
labels: List.from(map['labels'] ?? []),
|
||||
passwordUpdate: map['passwordUpdate'].toString(),
|
||||
email: map['email'].toString(),
|
||||
phone: map['phone'].toString(),
|
||||
emailVerification: map['emailVerification'],
|
||||
phoneVerification: map['phoneVerification'],
|
||||
mfa: map['mfa'],
|
||||
prefs: Preferences.fromMap(map['prefs']),
|
||||
targets: List<Target>.from(map['targets'].map((p) => Target.fromMap(p))),
|
||||
accessedAt: map['accessedAt'].toString(),
|
||||
);
|
||||
}
|
||||
factory User.fromMap(Map<String, dynamic> map) {
|
||||
return User(
|
||||
$id: map['\$id'].toString(),
|
||||
$createdAt: map['\$createdAt'].toString(),
|
||||
$updatedAt: map['\$updatedAt'].toString(),
|
||||
name: map['name'].toString(),
|
||||
password: map['password']?.toString(),
|
||||
hash: map['hash']?.toString(),
|
||||
hashOptions: map['hashOptions'],
|
||||
registration: map['registration'].toString(),
|
||||
status: map['status'],
|
||||
labels: List.from(map['labels'] ?? []),
|
||||
passwordUpdate: map['passwordUpdate'].toString(),
|
||||
email: map['email'].toString(),
|
||||
phone: map['phone'].toString(),
|
||||
emailVerification: map['emailVerification'],
|
||||
phoneVerification: map['phoneVerification'],
|
||||
mfa: map['mfa'],
|
||||
prefs: Preferences.fromMap(map['prefs']),
|
||||
targets: List<Target>.from(map['targets'].map((p) => Target.fromMap(p))),
|
||||
accessedAt: map['accessedAt'].toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"password": password,
|
||||
"hash": hash,
|
||||
"hashOptions": hashOptions,
|
||||
"registration": registration,
|
||||
"status": status,
|
||||
"labels": labels,
|
||||
"passwordUpdate": passwordUpdate,
|
||||
"email": email,
|
||||
"phone": phone,
|
||||
"emailVerification": emailVerification,
|
||||
"phoneVerification": phoneVerification,
|
||||
"mfa": mfa,
|
||||
"prefs": prefs.toMap(),
|
||||
"targets": targets.map((p) => p.toMap()).toList(),
|
||||
"accessedAt": accessedAt,
|
||||
};
|
||||
}
|
||||
@override
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
"\$id": $id,
|
||||
"\$createdAt": $createdAt,
|
||||
"\$updatedAt": $updatedAt,
|
||||
"name": name,
|
||||
"password": password,
|
||||
"hash": hash,
|
||||
"hashOptions": hashOptions,
|
||||
"registration": registration,
|
||||
"status": status,
|
||||
"labels": labels,
|
||||
"passwordUpdate": passwordUpdate,
|
||||
"email": email,
|
||||
"phone": phone,
|
||||
"emailVerification": emailVerification,
|
||||
"phoneVerification": phoneVerification,
|
||||
"mfa": mfa,
|
||||
"prefs": prefs.toMap(),
|
||||
"targets": targets.map((p) => p.toMap()).toList(),
|
||||
"accessedAt": accessedAt,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ abstract class Realtime extends Service {
|
||||
/// Initializes a [Realtime] service
|
||||
factory Realtime(Client client) => createRealtime(client);
|
||||
|
||||
/// Subscribes to Appwrite events and returns a `RealtimeSubscription` object, which can be used
|
||||
/// Subscribes to Appwrite events and returns a `RealtimeSubscription` object, which can be used
|
||||
/// to listen to events on the channels in realtime and to close the subscription to stop listening.
|
||||
///
|
||||
///
|
||||
/// Possible channels are:
|
||||
/// - account
|
||||
/// - collections
|
||||
@@ -41,7 +41,7 @@ abstract class Realtime extends Service {
|
||||
///
|
||||
/// subscription.close();
|
||||
/// ```
|
||||
///
|
||||
///
|
||||
/// You can also use Channel builders:
|
||||
/// ```dart
|
||||
/// final subscription = realtime.subscribe([
|
||||
|
||||
@@ -15,7 +15,6 @@ import 'client_io.dart';
|
||||
RealtimeBase createRealtime(Client client) => RealtimeIO(client);
|
||||
|
||||
class RealtimeIO extends RealtimeBase with RealtimeMixin {
|
||||
|
||||
RealtimeIO(Client client) {
|
||||
this.client = client;
|
||||
getWebSocket = _getWebSocket;
|
||||
@@ -23,7 +22,8 @@ class RealtimeIO extends RealtimeBase with RealtimeMixin {
|
||||
|
||||
Future<WebSocketChannel> _getWebSocket(Uri uri) async {
|
||||
Map<String, String>? headers;
|
||||
while (!(client as ClientIO).initialized && (client as ClientIO).initProgress) {
|
||||
while (!(client as ClientIO).initialized &&
|
||||
(client as ClientIO).initProgress) {
|
||||
await Future.delayed(Duration(milliseconds: 10));
|
||||
}
|
||||
if (!(client as ClientIO).initialized) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/foundation.dart';
|
||||
/// Realtime Message
|
||||
class RealtimeMessage {
|
||||
/// All permutations of the system event that triggered this message
|
||||
///
|
||||
///
|
||||
/// The first event in the list is the most specfic event without wildcards.
|
||||
final List<String> events;
|
||||
|
||||
|
||||
+30
-23
@@ -48,9 +48,7 @@ mixin RealtimeMixin {
|
||||
_stopHeartbeat();
|
||||
_heartbeatTimer = Timer.periodic(Duration(seconds: 20), (_) {
|
||||
if (_websok != null) {
|
||||
_websok!.sink.add(jsonEncode({
|
||||
"type": "ping"
|
||||
}));
|
||||
_websok!.sink.add(jsonEncode({"type": "ping"}));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -66,7 +64,7 @@ mixin RealtimeMixin {
|
||||
for (var subscription in _subscriptions.values) {
|
||||
allChannels.addAll(subscription.channels);
|
||||
}
|
||||
|
||||
|
||||
if (_creatingSocket) {
|
||||
_pendingSocketRebuild = true;
|
||||
return;
|
||||
@@ -97,13 +95,14 @@ mixin RealtimeMixin {
|
||||
case 'connected':
|
||||
// channels, user, subscriptions?
|
||||
final message = RealtimeResponseConnected.fromMap(data.data);
|
||||
|
||||
|
||||
// Store subscription ID mappings from backend
|
||||
// Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
|
||||
_slotToSubscriptionId.clear();
|
||||
_subscriptionIdToSlot.clear();
|
||||
if (data.data['subscriptions'] != null) {
|
||||
final subscriptions = data.data['subscriptions'] as Map<String, dynamic>;
|
||||
final subscriptions =
|
||||
data.data['subscriptions'] as Map<String, dynamic>;
|
||||
subscriptions.forEach((slotStr, subscriptionId) {
|
||||
final slot = int.tryParse(slotStr);
|
||||
if (slot != null) {
|
||||
@@ -112,7 +111,7 @@ mixin RealtimeMixin {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (message.user.isEmpty) {
|
||||
// send fallback cookie if exists
|
||||
final cookie = getFallbackCookie?.call();
|
||||
@@ -133,10 +132,12 @@ mixin RealtimeMixin {
|
||||
case 'event':
|
||||
final messageData = data.data as Map<String, dynamic>;
|
||||
final message = RealtimeMessage.fromMap(messageData);
|
||||
final subscriptions = (messageData['subscriptions'] as List<dynamic>?)
|
||||
?.map((x) => x.toString())
|
||||
.toList() ?? <String>[];
|
||||
|
||||
final subscriptions =
|
||||
(messageData['subscriptions'] as List<dynamic>?)
|
||||
?.map((x) => x.toString())
|
||||
.toList() ??
|
||||
<String>[];
|
||||
|
||||
if (subscriptions.isEmpty) {
|
||||
break;
|
||||
}
|
||||
@@ -205,20 +206,21 @@ mixin RealtimeMixin {
|
||||
"Please set endPointRealtime to connect to realtime server");
|
||||
}
|
||||
var uri = Uri.parse(client.endPointRealtime!);
|
||||
|
||||
|
||||
// Collect all unique channels from all slots
|
||||
final allChannels = <String>{};
|
||||
for (var subscription in _subscriptions.values) {
|
||||
allChannels.addAll(subscription.channels);
|
||||
}
|
||||
|
||||
|
||||
// Build query string from slots → channels → queries
|
||||
// Format: channel[slot][]=query (each query sent as separate parameter)
|
||||
// For each slot, repeat its queries under each channel it subscribes to
|
||||
// Example: slot 1 → channels [tests, prod], queries [q1, q2]
|
||||
// Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
|
||||
var queryParams = "project=${Uri.encodeComponent(client.config['project']!)}";
|
||||
|
||||
var queryParams =
|
||||
"project=${Uri.encodeComponent(client.config['project']!)}";
|
||||
|
||||
for (var channel in allChannels) {
|
||||
final encodedChannel = Uri.encodeComponent(channel);
|
||||
queryParams += "&channels[]=$encodedChannel";
|
||||
@@ -230,10 +232,12 @@ mixin RealtimeMixin {
|
||||
for (var entry in _subscriptions.entries) {
|
||||
final slot = entry.key;
|
||||
final subscription = entry.value;
|
||||
|
||||
|
||||
// Get queries array - each query is a separate string
|
||||
final queries = subscription.queries.isEmpty ? [selectAllQuery] : subscription.queries;
|
||||
|
||||
final queries = subscription.queries.isEmpty
|
||||
? [selectAllQuery]
|
||||
: subscription.queries;
|
||||
|
||||
// Repeat this slot's queries under each channel it subscribes to
|
||||
// Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
|
||||
for (var channel in subscription.channels) {
|
||||
@@ -248,7 +252,8 @@ mixin RealtimeMixin {
|
||||
final portPart = (uri.hasPort && uri.port != 80 && uri.port != 443)
|
||||
? ':${uri.port}'
|
||||
: '';
|
||||
return Uri.parse("${uri.scheme}://${uri.host}$portPart${uri.path}/realtime?$queryParams");
|
||||
return Uri.parse(
|
||||
"${uri.scheme}://${uri.host}$portPart${uri.path}/realtime?$queryParams");
|
||||
}
|
||||
|
||||
/// Convert channel value to string
|
||||
@@ -257,9 +262,11 @@ mixin RealtimeMixin {
|
||||
return channel is String ? channel : channel.toString();
|
||||
}
|
||||
|
||||
RealtimeSubscription subscribeTo(List<Object> channels, [List<String> queries = const []]) {
|
||||
RealtimeSubscription subscribeTo(List<Object> channels,
|
||||
[List<String> queries = const []]) {
|
||||
StreamController<RealtimeMessage> controller = StreamController.broadcast();
|
||||
final channelStrings = channels.map((ch) => _channelToString(ch)).toList().cast<String>();
|
||||
final channelStrings =
|
||||
channels.map((ch) => _channelToString(ch)).toList().cast<String>();
|
||||
final queryStrings = List<String>.from(queries);
|
||||
|
||||
// Allocate a new slot index
|
||||
@@ -295,7 +302,7 @@ mixin RealtimeMixin {
|
||||
}
|
||||
});
|
||||
_subscriptions[slot] = subscription;
|
||||
|
||||
|
||||
Future.delayed(Duration.zero, () => _createSocket());
|
||||
return subscription;
|
||||
}
|
||||
@@ -310,4 +317,4 @@ mixin RealtimeMixin {
|
||||
_retry();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ class RealtimeResponse {
|
||||
required this.type,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
|
||||
RealtimeResponse copyWith({
|
||||
String? type,
|
||||
@@ -36,7 +35,8 @@ class RealtimeResponse {
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory RealtimeResponse.fromJson(String source) => RealtimeResponse.fromMap(json.decode(source));
|
||||
factory RealtimeResponse.fromJson(String source) =>
|
||||
RealtimeResponse.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() => 'RealtimeResponse(type: $type, data: $data)';
|
||||
@@ -44,10 +44,10 @@ class RealtimeResponse {
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
|
||||
return other is RealtimeResponse &&
|
||||
other.type == type &&
|
||||
mapEquals(other.data, data);
|
||||
other.type == type &&
|
||||
mapEquals(other.data, data);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -3,5 +3,5 @@ import 'client.dart';
|
||||
|
||||
/// Implemented in `realtime_browser.dart` and `realtime_io.dart`.
|
||||
RealtimeBase createRealtime(Client client) => throw UnsupportedError(
|
||||
'Cannot create a client without dart:html or dart:io.',
|
||||
);
|
||||
'Cannot create a client without dart:html or dart:io.',
|
||||
);
|
||||
|
||||
+29
-13
@@ -13,12 +13,22 @@ void main() {
|
||||
});
|
||||
|
||||
test('returns database channel with action', () {
|
||||
expect(Channel.database('db1').collection('col1').document('doc1').create().toString(),
|
||||
expect(
|
||||
Channel.database('db1')
|
||||
.collection('col1')
|
||||
.document('doc1')
|
||||
.create()
|
||||
.toString(),
|
||||
'databases.db1.collections.col1.documents.doc1.create');
|
||||
});
|
||||
|
||||
test('returns database channel with upsert action', () {
|
||||
expect(Channel.database('db1').collection('col1').document('doc1').upsert().toString(),
|
||||
expect(
|
||||
Channel.database('db1')
|
||||
.collection('col1')
|
||||
.document('doc1')
|
||||
.upsert()
|
||||
.toString(),
|
||||
'databases.db1.collections.col1.documents.doc1.upsert');
|
||||
});
|
||||
});
|
||||
@@ -34,7 +44,12 @@ void main() {
|
||||
});
|
||||
|
||||
test('returns tablesdb channel with action', () {
|
||||
expect(Channel.tablesdb('db1').table('table1').row('row1').update().toString(),
|
||||
expect(
|
||||
Channel.tablesdb('db1')
|
||||
.table('table1')
|
||||
.row('row1')
|
||||
.update()
|
||||
.toString(),
|
||||
'tablesdb.db1.tables.table1.rows.row1.update');
|
||||
});
|
||||
});
|
||||
@@ -47,16 +62,16 @@ void main() {
|
||||
|
||||
group('bucket()', () {
|
||||
test('throws when bucket id is missing', () {
|
||||
expect(() => Channel.bucket(''), throwsArgumentError);
|
||||
expect(() => Channel.bucket(''), throwsArgumentError);
|
||||
});
|
||||
|
||||
test('returns buckets channel with specific IDs', () {
|
||||
expect(Channel.bucket('bucket1').file().toString(),
|
||||
'buckets.bucket1.files');
|
||||
expect(
|
||||
Channel.bucket('bucket1').file().toString(), 'buckets.bucket1.files');
|
||||
});
|
||||
|
||||
test('returns buckets channel with action', () {
|
||||
expect(Channel.bucket('bucket1').file('file1').delete().toString(),
|
||||
expect(Channel.bucket('bucket1').file('file1').delete().toString(),
|
||||
'buckets.bucket1.files.file1.delete');
|
||||
});
|
||||
});
|
||||
@@ -83,29 +98,30 @@ void main() {
|
||||
|
||||
group('teams()', () {
|
||||
test('throws when team id is missing', () {
|
||||
expect(() => Channel.team(''), throwsArgumentError);
|
||||
expect(() => Channel.team(''), throwsArgumentError);
|
||||
});
|
||||
|
||||
test('returns teams channel with specific team ID', () {
|
||||
expect(Channel.team('team1').toString(), 'teams.team1');
|
||||
expect(Channel.team('team1').toString(), 'teams.team1');
|
||||
});
|
||||
|
||||
test('returns teams channel with action', () {
|
||||
expect(Channel.team('team1').create().toString(), 'teams.team1.create');
|
||||
expect(Channel.team('team1').create().toString(), 'teams.team1.create');
|
||||
});
|
||||
});
|
||||
|
||||
group('memberships()', () {
|
||||
test('throws when membership id is missing', () {
|
||||
expect(() => Channel.membership(''), throwsArgumentError);
|
||||
expect(() => Channel.membership(''), throwsArgumentError);
|
||||
});
|
||||
|
||||
test('returns memberships channel with specific membership ID', () {
|
||||
expect(Channel.membership('membership1').toString(), 'memberships.membership1');
|
||||
expect(Channel.membership('membership1').toString(),
|
||||
'memberships.membership1');
|
||||
});
|
||||
|
||||
test('returns memberships channel with action', () {
|
||||
expect(Channel.membership('membership1').update().toString(),
|
||||
expect(Channel.membership('membership1').update().toString(),
|
||||
'memberships.membership1.update');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -354,4 +354,3 @@ void main() {
|
||||
expect(query['method'], 'between');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1348
-1475
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user