mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
updated spec
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
BillingAddress result = await account.createBillingAddress(
|
||||
country: '<COUNTRY>',
|
||||
city: '<CITY>',
|
||||
streetAddress: '<STREET_ADDRESS>',
|
||||
addressLine2: '<ADDRESS_LINE2>', // optional
|
||||
state: '<STATE>', // optional
|
||||
postalCode: '<POSTAL_CODE>', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
Key result = await account.createKey(
|
||||
name: '<NAME>',
|
||||
scopes: [enums.Scopes.account],
|
||||
expire: '', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,11 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethod result = await account.createPaymentMethod();
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
await account.deleteBillingAddress(
|
||||
billingAddressId: '<BILLING_ADDRESS_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
await account.deleteKey(
|
||||
keyId: '<KEY_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
await account.deletePaymentMethod(
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
BillingAddress result = await account.getBillingAddress(
|
||||
billingAddressId: '<BILLING_ADDRESS_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
Key result = await account.getKey(
|
||||
keyId: '<KEY_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethod result = await account.getPaymentMethod(
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
BillingAddressList result = await account.listBillingAddresses(
|
||||
queries: [], // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
KeyList result = await account.listKeys(
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethodList result = await account.listPaymentMethods(
|
||||
queries: [], // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
BillingAddress result = await account.updateBillingAddress(
|
||||
billingAddressId: '<BILLING_ADDRESS_ID>',
|
||||
country: '<COUNTRY>',
|
||||
city: '<CITY>',
|
||||
streetAddress: '<STREET_ADDRESS>',
|
||||
addressLine2: '<ADDRESS_LINE2>', // optional
|
||||
state: '<STATE>', // optional
|
||||
postalCode: '<POSTAL_CODE>', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
Key result = await account.updateKey(
|
||||
keyId: '<KEY_ID>',
|
||||
name: '<NAME>',
|
||||
scopes: [enums.Scopes.account],
|
||||
expire: '', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethod result = await account.updatePaymentMethodMandateOptions(
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethod result = await account.updatePaymentMethodProvider(
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
providerMethodId: '<PROVIDER_METHOD_ID>',
|
||||
name: '<NAME>',
|
||||
state: '<STATE>', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Account account = Account(client);
|
||||
|
||||
PaymentMethod result = await account.updatePaymentMethod(
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
expiryMonth: 1,
|
||||
expiryYear: 2026,
|
||||
state: '<STATE>', // optional
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Organizations organizations = Organizations(client);
|
||||
|
||||
DowngradeFeedback result = await organizations.createDowngradeFeedback(
|
||||
organizationId: '<ORGANIZATION_ID>',
|
||||
reason: '<REASON>',
|
||||
message: '<MESSAGE>',
|
||||
fromPlanId: '<FROM_PLAN_ID>',
|
||||
toPlanId: '<TO_PLAN_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Organizations organizations = Organizations(client);
|
||||
|
||||
await organizations.delete(
|
||||
organizationId: '<ORGANIZATION_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Organizations organizations = Organizations(client);
|
||||
|
||||
EstimationDeleteOrganization result = await organizations.estimationDeleteOrganization(
|
||||
organizationId: '<ORGANIZATION_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Organizations organizations = Organizations(client);
|
||||
|
||||
BillingAddress result = await organizations.getBillingAddress(
|
||||
organizationId: '<ORGANIZATION_ID>',
|
||||
billingAddressId: '<BILLING_ADDRESS_ID>',
|
||||
);
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Organizations organizations = Organizations(client);
|
||||
|
||||
PaymentMethod result = await organizations.getPaymentMethod(
|
||||
organizationId: '<ORGANIZATION_ID>',
|
||||
paymentMethodId: '<PAYMENT_METHOD_ID>',
|
||||
);
|
||||
```
|
||||
Reference in New Issue
Block a user