Updated SDKs
This commit is contained in:
parent
2d0ad0a9a2
commit
51746f7ba1
14
app/sdks/dart/.packages
Normal file
14
app/sdks/dart/.packages
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Generated by pub on 2019-10-18 21:11:54.500301.
|
||||
charcode:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
|
||||
collection:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/collection-1.14.12/lib/
|
||||
cookie_jar:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/cookie_jar-1.0.1/lib/
|
||||
dio:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio-3.0.3/lib/
|
||||
dio_cookie_manager:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/dio_cookie_manager-1.0.0/lib/
|
||||
http_parser:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/
|
||||
meta:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/meta-1.1.7/lib/
|
||||
path:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/path-1.6.4/lib/
|
||||
source_span:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/source_span-1.5.5/lib/
|
||||
string_scanner:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.5/lib/
|
||||
term_glyph:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.1.0/lib/
|
||||
typed_data:file:///Users/eldadfux/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/
|
||||
appwrite:lib/
|
|
@ -54,7 +54,7 @@ class Auth extends Service {
|
|||
|
||||
return await this.client.call('delete', path: path, params: params);
|
||||
}
|
||||
Future<Response> oauth({provider, success = null, failure = null}) async {
|
||||
Future<Response> oauth({provider, success, failure}) async {
|
||||
String path = '/auth/oauth/{provider}'.replaceAll(RegExp('{provider}'), provider);
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
|
|
|
@ -23,7 +23,7 @@ class Database extends Service {
|
|||
return await this.client.call('get', path: path, params: params);
|
||||
}
|
||||
/// Create a new Collection.
|
||||
Future<Response> createCollection({name, read = const [], write = const [], rules = const []}) async {
|
||||
Future<Response> createCollection({name, read, write, rules}) async {
|
||||
String path = '/database';
|
||||
|
||||
Map<String, dynamic> params = {
|
||||
|
|
89
app/sdks/dart/pubspec.lock
Normal file
89
app/sdks/dart/pubspec.lock
Normal file
|
@ -0,0 +1,89 @@
|
|||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.12"
|
||||
cookie_jar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cookie_jar
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dio
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
dio_cookie_manager:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dio_cookie_manager
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.7"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.5"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
sdks:
|
||||
dart: ">2.4.0 <3.0.0"
|
35
app/sdks/go/docs/examples/Account/get-prefs.md
Normal file
35
app/sdks/go/docs/examples/Account/get-prefs.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## GetPrefs
|
||||
|
||||
```go
|
||||
package appwrite-getprefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetPrefs method and handle results
|
||||
var res, err := srv.GetPrefs()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/get-security.md
Normal file
35
app/sdks/go/docs/examples/Account/get-security.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## GetSecurity
|
||||
|
||||
```go
|
||||
package appwrite-getsecurity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetSecurity method and handle results
|
||||
var res, err := srv.GetSecurity()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/get-sessions.md
Normal file
35
app/sdks/go/docs/examples/Account/get-sessions.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## GetSessions
|
||||
|
||||
```go
|
||||
package appwrite-getsessions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetSessions method and handle results
|
||||
var res, err := srv.GetSessions()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/update-email.md
Normal file
35
app/sdks/go/docs/examples/Account/update-email.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## UpdateEmail
|
||||
|
||||
```go
|
||||
package appwrite-updateemail
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateEmail method and handle results
|
||||
var res, err := srv.UpdateEmail("email@example.com", "password")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/update-name.md
Normal file
35
app/sdks/go/docs/examples/Account/update-name.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## UpdateName
|
||||
|
||||
```go
|
||||
package appwrite-updatename
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateName method and handle results
|
||||
var res, err := srv.UpdateName("[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/update-password.md
Normal file
35
app/sdks/go/docs/examples/Account/update-password.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## UpdatePassword
|
||||
|
||||
```go
|
||||
package appwrite-updatepassword
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdatePassword method and handle results
|
||||
var res, err := srv.UpdatePassword("password", "password")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Account/update-prefs.md
Normal file
35
app/sdks/go/docs/examples/Account/update-prefs.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Account Examples
|
||||
|
||||
## UpdatePrefs
|
||||
|
||||
```go
|
||||
package appwrite-updateprefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Account service passing Client
|
||||
var srv := appwrite.Account{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdatePrefs method and handle results
|
||||
var res, err := srv.UpdatePrefs("{}")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
|
@ -25,7 +25,7 @@
|
|||
}
|
||||
|
||||
// Call Oauth method and handle results
|
||||
var res, err := srv.Oauth("bitbucket")
|
||||
var res, err := srv.Oauth("bitbucket", "https://example.com", "https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
35
app/sdks/go/docs/examples/Auth/confirm-resend.md
Normal file
35
app/sdks/go/docs/examples/Auth/confirm-resend.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Auth Examples
|
||||
|
||||
## ConfirmResend
|
||||
|
||||
```go
|
||||
package appwrite-confirmresend
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Auth service passing Client
|
||||
var srv := appwrite.Auth{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ConfirmResend method and handle results
|
||||
var res, err := srv.ConfirmResend("https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Auth/logout-by-session.md
Normal file
35
app/sdks/go/docs/examples/Auth/logout-by-session.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Auth Examples
|
||||
|
||||
## LogoutBySession
|
||||
|
||||
```go
|
||||
package appwrite-logoutbysession
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Auth service passing Client
|
||||
var srv := appwrite.Auth{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call LogoutBySession method and handle results
|
||||
var res, err := srv.LogoutBySession("[ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Auth/recovery-reset.md
Normal file
35
app/sdks/go/docs/examples/Auth/recovery-reset.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Auth Examples
|
||||
|
||||
## RecoveryReset
|
||||
|
||||
```go
|
||||
package appwrite-recoveryreset
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Auth service passing Client
|
||||
var srv := appwrite.Auth{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call RecoveryReset method and handle results
|
||||
var res, err := srv.RecoveryReset("[USER_ID]", "[TOKEN]", "password", "password")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-browser.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-browser.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetBrowser
|
||||
|
||||
```go
|
||||
package appwrite-getbrowser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetBrowser method and handle results
|
||||
var res, err := srv.GetBrowser("aa")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-credit-card.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-credit-card.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetCreditCard
|
||||
|
||||
```go
|
||||
package appwrite-getcreditcard
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCreditCard method and handle results
|
||||
var res, err := srv.GetCreditCard("amex")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-favicon.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-favicon.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetFavicon
|
||||
|
||||
```go
|
||||
package appwrite-getfavicon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFavicon method and handle results
|
||||
var res, err := srv.GetFavicon("https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-flag.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-flag.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetFlag
|
||||
|
||||
```go
|
||||
package appwrite-getflag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFlag method and handle results
|
||||
var res, err := srv.GetFlag("af")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-image.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-image.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetImage
|
||||
|
||||
```go
|
||||
package appwrite-getimage
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetImage method and handle results
|
||||
var res, err := srv.GetImage("https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Avatars/get-q-r.md
Normal file
35
app/sdks/go/docs/examples/Avatars/get-q-r.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Avatars Examples
|
||||
|
||||
## GetQR
|
||||
|
||||
```go
|
||||
package appwrite-getqr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Avatars service passing Client
|
||||
var srv := appwrite.Avatars{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetQR method and handle results
|
||||
var res, err := srv.GetQR("[TEXT]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/create-collection.md
Normal file
35
app/sdks/go/docs/examples/Database/create-collection.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## CreateCollection
|
||||
|
||||
```go
|
||||
package appwrite-createcollection
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateCollection method and handle results
|
||||
var res, err := srv.CreateCollection("[NAME]", [], [], [])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/create-document.md
Normal file
35
app/sdks/go/docs/examples/Database/create-document.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## CreateDocument
|
||||
|
||||
```go
|
||||
package appwrite-createdocument
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateDocument method and handle results
|
||||
var res, err := srv.CreateDocument("[COLLECTION_ID]", "{}")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/delete-collection.md
Normal file
35
app/sdks/go/docs/examples/Database/delete-collection.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## DeleteCollection
|
||||
|
||||
```go
|
||||
package appwrite-deletecollection
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteCollection method and handle results
|
||||
var res, err := srv.DeleteCollection("[COLLECTION_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/delete-document.md
Normal file
35
app/sdks/go/docs/examples/Database/delete-document.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## DeleteDocument
|
||||
|
||||
```go
|
||||
package appwrite-deletedocument
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteDocument method and handle results
|
||||
var res, err := srv.DeleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/get-collection.md
Normal file
35
app/sdks/go/docs/examples/Database/get-collection.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## GetCollection
|
||||
|
||||
```go
|
||||
package appwrite-getcollection
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCollection method and handle results
|
||||
var res, err := srv.GetCollection("[COLLECTION_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/get-document.md
Normal file
35
app/sdks/go/docs/examples/Database/get-document.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## GetDocument
|
||||
|
||||
```go
|
||||
package appwrite-getdocument
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetDocument method and handle results
|
||||
var res, err := srv.GetDocument("[COLLECTION_ID]", "[DOCUMENT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/list-collections.md
Normal file
35
app/sdks/go/docs/examples/Database/list-collections.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## ListCollections
|
||||
|
||||
```go
|
||||
package appwrite-listcollections
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListCollections method and handle results
|
||||
var res, err := srv.ListCollections()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/list-documents.md
Normal file
35
app/sdks/go/docs/examples/Database/list-documents.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## ListDocuments
|
||||
|
||||
```go
|
||||
package appwrite-listdocuments
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListDocuments method and handle results
|
||||
var res, err := srv.ListDocuments("[COLLECTION_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/update-collection.md
Normal file
35
app/sdks/go/docs/examples/Database/update-collection.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## UpdateCollection
|
||||
|
||||
```go
|
||||
package appwrite-updatecollection
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateCollection method and handle results
|
||||
var res, err := srv.UpdateCollection("[COLLECTION_ID]", "[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Database/update-document.md
Normal file
35
app/sdks/go/docs/examples/Database/update-document.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Database Examples
|
||||
|
||||
## UpdateDocument
|
||||
|
||||
```go
|
||||
package appwrite-updatedocument
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Database service passing Client
|
||||
var srv := appwrite.Database{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateDocument method and handle results
|
||||
var res, err := srv.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", "{}")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Locale/get-countries-e-u.md
Normal file
35
app/sdks/go/docs/examples/Locale/get-countries-e-u.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Locale Examples
|
||||
|
||||
## GetCountriesEU
|
||||
|
||||
```go
|
||||
package appwrite-getcountrieseu
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Locale service passing Client
|
||||
var srv := appwrite.Locale{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCountriesEU method and handle results
|
||||
var res, err := srv.GetCountriesEU()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Locale/get-countries-phones.md
Normal file
35
app/sdks/go/docs/examples/Locale/get-countries-phones.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Locale Examples
|
||||
|
||||
## GetCountriesPhones
|
||||
|
||||
```go
|
||||
package appwrite-getcountriesphones
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Locale service passing Client
|
||||
var srv := appwrite.Locale{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCountriesPhones method and handle results
|
||||
var res, err := srv.GetCountriesPhones()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Locale/get-countries.md
Normal file
35
app/sdks/go/docs/examples/Locale/get-countries.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Locale Examples
|
||||
|
||||
## GetCountries
|
||||
|
||||
```go
|
||||
package appwrite-getcountries
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Locale service passing Client
|
||||
var srv := appwrite.Locale{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCountries method and handle results
|
||||
var res, err := srv.GetCountries()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Locale/get-currencies.md
Normal file
35
app/sdks/go/docs/examples/Locale/get-currencies.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Locale Examples
|
||||
|
||||
## GetCurrencies
|
||||
|
||||
```go
|
||||
package appwrite-getcurrencies
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Locale service passing Client
|
||||
var srv := appwrite.Locale{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetCurrencies method and handle results
|
||||
var res, err := srv.GetCurrencies()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Locale/get-locale.md
Normal file
35
app/sdks/go/docs/examples/Locale/get-locale.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Locale Examples
|
||||
|
||||
## GetLocale
|
||||
|
||||
```go
|
||||
package appwrite-getlocale
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Locale service passing Client
|
||||
var srv := appwrite.Locale{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetLocale method and handle results
|
||||
var res, err := srv.GetLocale()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/create-key.md
Normal file
35
app/sdks/go/docs/examples/Projects/create-key.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## CreateKey
|
||||
|
||||
```go
|
||||
package appwrite-createkey
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateKey method and handle results
|
||||
var res, err := srv.CreateKey("[PROJECT_ID]", "[NAME]", [])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/create-platform.md
Normal file
35
app/sdks/go/docs/examples/Projects/create-platform.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## CreatePlatform
|
||||
|
||||
```go
|
||||
package appwrite-createplatform
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreatePlatform method and handle results
|
||||
var res, err := srv.CreatePlatform("[PROJECT_ID]", "web", "[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/create-project.md
Normal file
35
app/sdks/go/docs/examples/Projects/create-project.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## CreateProject
|
||||
|
||||
```go
|
||||
package appwrite-createproject
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateProject method and handle results
|
||||
var res, err := srv.CreateProject("[NAME]", "[TEAM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/create-task.md
Normal file
35
app/sdks/go/docs/examples/Projects/create-task.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## CreateTask
|
||||
|
||||
```go
|
||||
package appwrite-createtask
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateTask method and handle results
|
||||
var res, err := srv.CreateTask("[PROJECT_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/create-webhook.md
Normal file
35
app/sdks/go/docs/examples/Projects/create-webhook.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## CreateWebhook
|
||||
|
||||
```go
|
||||
package appwrite-createwebhook
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateWebhook method and handle results
|
||||
var res, err := srv.CreateWebhook("[PROJECT_ID]", "[NAME]", [], "[URL]", 0)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/delete-key.md
Normal file
35
app/sdks/go/docs/examples/Projects/delete-key.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## DeleteKey
|
||||
|
||||
```go
|
||||
package appwrite-deletekey
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteKey method and handle results
|
||||
var res, err := srv.DeleteKey("[PROJECT_ID]", "[KEY_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/delete-platform.md
Normal file
35
app/sdks/go/docs/examples/Projects/delete-platform.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## DeletePlatform
|
||||
|
||||
```go
|
||||
package appwrite-deleteplatform
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeletePlatform method and handle results
|
||||
var res, err := srv.DeletePlatform("[PROJECT_ID]", "[PLATFORM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/delete-project.md
Normal file
35
app/sdks/go/docs/examples/Projects/delete-project.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## DeleteProject
|
||||
|
||||
```go
|
||||
package appwrite-deleteproject
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteProject method and handle results
|
||||
var res, err := srv.DeleteProject("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/delete-task.md
Normal file
35
app/sdks/go/docs/examples/Projects/delete-task.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## DeleteTask
|
||||
|
||||
```go
|
||||
package appwrite-deletetask
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteTask method and handle results
|
||||
var res, err := srv.DeleteTask("[PROJECT_ID]", "[TASK_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/delete-webhook.md
Normal file
35
app/sdks/go/docs/examples/Projects/delete-webhook.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## DeleteWebhook
|
||||
|
||||
```go
|
||||
package appwrite-deletewebhook
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteWebhook method and handle results
|
||||
var res, err := srv.DeleteWebhook("[PROJECT_ID]", "[WEBHOOK_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-key.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-key.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetKey
|
||||
|
||||
```go
|
||||
package appwrite-getkey
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetKey method and handle results
|
||||
var res, err := srv.GetKey("[PROJECT_ID]", "[KEY_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-platform.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-platform.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetPlatform
|
||||
|
||||
```go
|
||||
package appwrite-getplatform
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetPlatform method and handle results
|
||||
var res, err := srv.GetPlatform("[PROJECT_ID]", "[PLATFORM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-project-usage.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-project-usage.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetProjectUsage
|
||||
|
||||
```go
|
||||
package appwrite-getprojectusage
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetProjectUsage method and handle results
|
||||
var res, err := srv.GetProjectUsage("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-project.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-project.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetProject
|
||||
|
||||
```go
|
||||
package appwrite-getproject
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetProject method and handle results
|
||||
var res, err := srv.GetProject("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-task.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-task.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetTask
|
||||
|
||||
```go
|
||||
package appwrite-gettask
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetTask method and handle results
|
||||
var res, err := srv.GetTask("[PROJECT_ID]", "[TASK_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/get-webhook.md
Normal file
35
app/sdks/go/docs/examples/Projects/get-webhook.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## GetWebhook
|
||||
|
||||
```go
|
||||
package appwrite-getwebhook
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetWebhook method and handle results
|
||||
var res, err := srv.GetWebhook("[PROJECT_ID]", "[WEBHOOK_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/list-keys.md
Normal file
35
app/sdks/go/docs/examples/Projects/list-keys.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## ListKeys
|
||||
|
||||
```go
|
||||
package appwrite-listkeys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListKeys method and handle results
|
||||
var res, err := srv.ListKeys("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/list-platforms.md
Normal file
35
app/sdks/go/docs/examples/Projects/list-platforms.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## ListPlatforms
|
||||
|
||||
```go
|
||||
package appwrite-listplatforms
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListPlatforms method and handle results
|
||||
var res, err := srv.ListPlatforms("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/list-projects.md
Normal file
35
app/sdks/go/docs/examples/Projects/list-projects.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## ListProjects
|
||||
|
||||
```go
|
||||
package appwrite-listprojects
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListProjects method and handle results
|
||||
var res, err := srv.ListProjects()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/list-tasks.md
Normal file
35
app/sdks/go/docs/examples/Projects/list-tasks.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## ListTasks
|
||||
|
||||
```go
|
||||
package appwrite-listtasks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListTasks method and handle results
|
||||
var res, err := srv.ListTasks("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/list-webhooks.md
Normal file
35
app/sdks/go/docs/examples/Projects/list-webhooks.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## ListWebhooks
|
||||
|
||||
```go
|
||||
package appwrite-listwebhooks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListWebhooks method and handle results
|
||||
var res, err := srv.ListWebhooks("[PROJECT_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-key.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-key.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdateKey
|
||||
|
||||
```go
|
||||
package appwrite-updatekey
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateKey method and handle results
|
||||
var res, err := srv.UpdateKey("[PROJECT_ID]", "[KEY_ID]", "[NAME]", [])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-platform.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-platform.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdatePlatform
|
||||
|
||||
```go
|
||||
package appwrite-updateplatform
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdatePlatform method and handle results
|
||||
var res, err := srv.UpdatePlatform("[PROJECT_ID]", "[PLATFORM_ID]", "[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-project-o-auth.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-project-o-auth.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdateProjectOAuth
|
||||
|
||||
```go
|
||||
package appwrite-updateprojectoauth
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateProjectOAuth method and handle results
|
||||
var res, err := srv.UpdateProjectOAuth("[PROJECT_ID]", "bitbucket")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-project.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-project.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdateProject
|
||||
|
||||
```go
|
||||
package appwrite-updateproject
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateProject method and handle results
|
||||
var res, err := srv.UpdateProject("[PROJECT_ID]", "[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-task.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-task.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdateTask
|
||||
|
||||
```go
|
||||
package appwrite-updatetask
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateTask method and handle results
|
||||
var res, err := srv.UpdateTask("[PROJECT_ID]", "[TASK_ID]", "[NAME]", "play", "", 0, "GET", "https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Projects/update-webhook.md
Normal file
35
app/sdks/go/docs/examples/Projects/update-webhook.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Projects Examples
|
||||
|
||||
## UpdateWebhook
|
||||
|
||||
```go
|
||||
package appwrite-updatewebhook
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Projects service passing Client
|
||||
var srv := appwrite.Projects{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateWebhook method and handle results
|
||||
var res, err := srv.UpdateWebhook("[PROJECT_ID]", "[WEBHOOK_ID]", "[NAME]", [], "[URL]", 0)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/create-file.md
Normal file
35
app/sdks/go/docs/examples/Storage/create-file.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## CreateFile
|
||||
|
||||
```go
|
||||
package appwrite-createfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateFile method and handle results
|
||||
var res, err := srv.CreateFile(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/delete-file.md
Normal file
35
app/sdks/go/docs/examples/Storage/delete-file.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## DeleteFile
|
||||
|
||||
```go
|
||||
package appwrite-deletefile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteFile method and handle results
|
||||
var res, err := srv.DeleteFile("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/get-file-download.md
Normal file
35
app/sdks/go/docs/examples/Storage/get-file-download.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## GetFileDownload
|
||||
|
||||
```go
|
||||
package appwrite-getfiledownload
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFileDownload method and handle results
|
||||
var res, err := srv.GetFileDownload("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/get-file-preview.md
Normal file
35
app/sdks/go/docs/examples/Storage/get-file-preview.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## GetFilePreview
|
||||
|
||||
```go
|
||||
package appwrite-getfilepreview
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFilePreview method and handle results
|
||||
var res, err := srv.GetFilePreview("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/get-file-view.md
Normal file
35
app/sdks/go/docs/examples/Storage/get-file-view.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## GetFileView
|
||||
|
||||
```go
|
||||
package appwrite-getfileview
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFileView method and handle results
|
||||
var res, err := srv.GetFileView("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/get-file.md
Normal file
35
app/sdks/go/docs/examples/Storage/get-file.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## GetFile
|
||||
|
||||
```go
|
||||
package appwrite-getfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetFile method and handle results
|
||||
var res, err := srv.GetFile("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/list-files.md
Normal file
35
app/sdks/go/docs/examples/Storage/list-files.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## ListFiles
|
||||
|
||||
```go
|
||||
package appwrite-listfiles
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListFiles method and handle results
|
||||
var res, err := srv.ListFiles()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Storage/update-file.md
Normal file
35
app/sdks/go/docs/examples/Storage/update-file.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Storage Examples
|
||||
|
||||
## UpdateFile
|
||||
|
||||
```go
|
||||
package appwrite-updatefile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Storage service passing Client
|
||||
var srv := appwrite.Storage{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateFile method and handle results
|
||||
var res, err := srv.UpdateFile("[FILE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## CreateTeamMembershipResend
|
||||
|
||||
```go
|
||||
package appwrite-createteammembershipresend
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateTeamMembershipResend method and handle results
|
||||
var res, err := srv.CreateTeamMembershipResend("[TEAM_ID]", "[INVITE_ID]", "https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/create-team-membership.md
Normal file
35
app/sdks/go/docs/examples/Teams/create-team-membership.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## CreateTeamMembership
|
||||
|
||||
```go
|
||||
package appwrite-createteammembership
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateTeamMembership method and handle results
|
||||
var res, err := srv.CreateTeamMembership("[TEAM_ID]", "email@example.com", [], "https://example.com")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/create-team.md
Normal file
35
app/sdks/go/docs/examples/Teams/create-team.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## CreateTeam
|
||||
|
||||
```go
|
||||
package appwrite-createteam
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateTeam method and handle results
|
||||
var res, err := srv.CreateTeam("[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/delete-team-membership.md
Normal file
35
app/sdks/go/docs/examples/Teams/delete-team-membership.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## DeleteTeamMembership
|
||||
|
||||
```go
|
||||
package appwrite-deleteteammembership
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteTeamMembership method and handle results
|
||||
var res, err := srv.DeleteTeamMembership("[TEAM_ID]", "[INVITE_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/delete-team.md
Normal file
35
app/sdks/go/docs/examples/Teams/delete-team.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## DeleteTeam
|
||||
|
||||
```go
|
||||
package appwrite-deleteteam
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteTeam method and handle results
|
||||
var res, err := srv.DeleteTeam("[TEAM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/get-team-members.md
Normal file
35
app/sdks/go/docs/examples/Teams/get-team-members.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## GetTeamMembers
|
||||
|
||||
```go
|
||||
package appwrite-getteammembers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetTeamMembers method and handle results
|
||||
var res, err := srv.GetTeamMembers("[TEAM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/get-team.md
Normal file
35
app/sdks/go/docs/examples/Teams/get-team.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## GetTeam
|
||||
|
||||
```go
|
||||
package appwrite-getteam
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetTeam method and handle results
|
||||
var res, err := srv.GetTeam("[TEAM_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/list-teams.md
Normal file
35
app/sdks/go/docs/examples/Teams/list-teams.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## ListTeams
|
||||
|
||||
```go
|
||||
package appwrite-listteams
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListTeams method and handle results
|
||||
var res, err := srv.ListTeams()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## UpdateTeamMembershipStatus
|
||||
|
||||
```go
|
||||
package appwrite-updateteammembershipstatus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateTeamMembershipStatus method and handle results
|
||||
var res, err := srv.UpdateTeamMembershipStatus("[TEAM_ID]", "[INVITE_ID]", "[USER_ID]", "[SECRET]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Teams/update-team.md
Normal file
35
app/sdks/go/docs/examples/Teams/update-team.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Teams Examples
|
||||
|
||||
## UpdateTeam
|
||||
|
||||
```go
|
||||
package appwrite-updateteam
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Teams service passing Client
|
||||
var srv := appwrite.Teams{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateTeam method and handle results
|
||||
var res, err := srv.UpdateTeam("[TEAM_ID]", "[NAME]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/create-user.md
Normal file
35
app/sdks/go/docs/examples/Users/create-user.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## CreateUser
|
||||
|
||||
```go
|
||||
package appwrite-createuser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call CreateUser method and handle results
|
||||
var res, err := srv.CreateUser("email@example.com", "password")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/delete-user-session.md
Normal file
35
app/sdks/go/docs/examples/Users/delete-user-session.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## DeleteUserSession
|
||||
|
||||
```go
|
||||
package appwrite-deleteusersession
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteUserSession method and handle results
|
||||
var res, err := srv.DeleteUserSession("[USER_ID]", "[SESSION_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/delete-user-sessions.md
Normal file
35
app/sdks/go/docs/examples/Users/delete-user-sessions.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## DeleteUserSessions
|
||||
|
||||
```go
|
||||
package appwrite-deleteusersessions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call DeleteUserSessions method and handle results
|
||||
var res, err := srv.DeleteUserSessions("[USER_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/get-user-logs.md
Normal file
35
app/sdks/go/docs/examples/Users/get-user-logs.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## GetUserLogs
|
||||
|
||||
```go
|
||||
package appwrite-getuserlogs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetUserLogs method and handle results
|
||||
var res, err := srv.GetUserLogs("[USER_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/get-user-prefs.md
Normal file
35
app/sdks/go/docs/examples/Users/get-user-prefs.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## GetUserPrefs
|
||||
|
||||
```go
|
||||
package appwrite-getuserprefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetUserPrefs method and handle results
|
||||
var res, err := srv.GetUserPrefs("[USER_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/get-user-sessions.md
Normal file
35
app/sdks/go/docs/examples/Users/get-user-sessions.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## GetUserSessions
|
||||
|
||||
```go
|
||||
package appwrite-getusersessions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetUserSessions method and handle results
|
||||
var res, err := srv.GetUserSessions("[USER_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/get-user.md
Normal file
35
app/sdks/go/docs/examples/Users/get-user.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## GetUser
|
||||
|
||||
```go
|
||||
package appwrite-getuser
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call GetUser method and handle results
|
||||
var res, err := srv.GetUser("[USER_ID]")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/list-users.md
Normal file
35
app/sdks/go/docs/examples/Users/list-users.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## ListUsers
|
||||
|
||||
```go
|
||||
package appwrite-listusers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call ListUsers method and handle results
|
||||
var res, err := srv.ListUsers()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/update-user-prefs.md
Normal file
35
app/sdks/go/docs/examples/Users/update-user-prefs.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## UpdateUserPrefs
|
||||
|
||||
```go
|
||||
package appwrite-updateuserprefs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateUserPrefs method and handle results
|
||||
var res, err := srv.UpdateUserPrefs("[USER_ID]", "{}")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
35
app/sdks/go/docs/examples/Users/update-user-status.md
Normal file
35
app/sdks/go/docs/examples/Users/update-user-status.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Users Examples
|
||||
|
||||
## UpdateUserStatus
|
||||
|
||||
```go
|
||||
package appwrite-updateuserstatus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"github.com/appwrite/sdk-for-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create a Client
|
||||
var clt := appwrite.Client{}
|
||||
|
||||
// Set Client required headers
|
||||
clt.SetProject("")
|
||||
clt.SetKey("")
|
||||
|
||||
// Create a new Users service passing Client
|
||||
var srv := appwrite.Users{
|
||||
client: &clt
|
||||
}
|
||||
|
||||
// Call UpdateUserStatus method and handle results
|
||||
var res, err := srv.UpdateUserStatus("[USER_ID]", "1")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println(res)
|
||||
}
|
||||
```
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.auth.oauth('bitbucket');
|
||||
let promise = sdk.auth.oauth('bitbucket', 'https://example.com', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -4,7 +4,7 @@ sdk
|
|||
.setProject('')
|
||||
;
|
||||
|
||||
let promise = sdk.database.createCollection('[NAME]');
|
||||
let promise = sdk.database.createCollection('[NAME]', [], [], []);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -628,11 +628,19 @@
|
|||
* @throws {Error}
|
||||
* @return {null}
|
||||
*/
|
||||
oauth: function(provider, success = '', failure = '') {
|
||||
oauth: function(provider, success, failure) {
|
||||
if(provider === undefined) {
|
||||
throw new Error('Missing required parameter: "provider"');
|
||||
}
|
||||
|
||||
if(success === undefined) {
|
||||
throw new Error('Missing required parameter: "success"');
|
||||
}
|
||||
|
||||
if(failure === undefined) {
|
||||
throw new Error('Missing required parameter: "failure"');
|
||||
}
|
||||
|
||||
let path = '/auth/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider);
|
||||
|
||||
let payload = {};
|
||||
|
@ -1186,11 +1194,23 @@
|
|||
* @throws {Error}
|
||||
* @return {Promise}
|
||||
*/
|
||||
createCollection: function(name, read = [], write = [], rules = []) {
|
||||
createCollection: function(name, read, write, rules) {
|
||||
if(name === undefined) {
|
||||
throw new Error('Missing required parameter: "name"');
|
||||
}
|
||||
|
||||
if(read === undefined) {
|
||||
throw new Error('Missing required parameter: "read"');
|
||||
}
|
||||
|
||||
if(write === undefined) {
|
||||
throw new Error('Missing required parameter: "write"');
|
||||
}
|
||||
|
||||
if(rules === undefined) {
|
||||
throw new Error('Missing required parameter: "rules"');
|
||||
}
|
||||
|
||||
let path = '/database';
|
||||
|
||||
let payload = {};
|
||||
|
|
9
app/sdks/js/src/sdk.min.js
vendored
9
app/sdks/js/src/sdk.min.js
vendored
|
@ -30,7 +30,9 @@ if(password){payload.password=password}
|
|||
if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
payload.project=config.project;return iframe('post',path,payload)},logout:function(){let path='/auth/logout';let payload={};return http.delete(path,{'content-type':'application/json'},payload)},logoutBySession:function(id){if(id===undefined){throw new Error('Missing required parameter: "id"')}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},oauth:function(provider,success='',failure=''){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
||||
let path='/auth/logout/{id}'.replace(new RegExp('{id}','g'),id);let payload={};return http.delete(path,{'content-type':'application/json'},payload)},oauth:function(provider,success,failure){if(provider===undefined){throw new Error('Missing required parameter: "provider"')}
|
||||
if(success===undefined){throw new Error('Missing required parameter: "success"')}
|
||||
if(failure===undefined){throw new Error('Missing required parameter: "failure"')}
|
||||
let path='/auth/oauth/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload.success=success}
|
||||
if(failure){payload.failure=failure}
|
||||
payload.project=config.project;return iframe('get',path,payload)},recovery:function(email,reset){if(email===undefined){throw new Error('Missing required parameter: "email"')}
|
||||
|
@ -87,7 +89,10 @@ return http.get(path,{'content-type':'application/json'},payload)}};let database
|
|||
if(limit){payload.limit=limit}
|
||||
if(offset){payload.offset=offset}
|
||||
if(orderType){payload.orderType=orderType}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createCollection:function(name,read=[],write=[],rules=[]){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
return http.get(path,{'content-type':'application/json'},payload)},createCollection:function(name,read,write,rules){if(name===undefined){throw new Error('Missing required parameter: "name"')}
|
||||
if(read===undefined){throw new Error('Missing required parameter: "read"')}
|
||||
if(write===undefined){throw new Error('Missing required parameter: "write"')}
|
||||
if(rules===undefined){throw new Error('Missing required parameter: "rules"')}
|
||||
let path='/database';let payload={};if(name){payload.name=name}
|
||||
if(read){payload.read=read}
|
||||
if(write){payload.write=write}
|
||||
|
|
|
@ -10,7 +10,7 @@ client
|
|||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = auth.oauth('bitbucket');
|
||||
let promise = auth.oauth('bitbucket', 'https://example.com', 'https://example.com');
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -10,7 +10,7 @@ client
|
|||
.setKey('')
|
||||
;
|
||||
|
||||
let promise = database.createCollection('[NAME]');
|
||||
let promise = database.createCollection('[NAME]', [], [], []);
|
||||
|
||||
promise.then(function (response) {
|
||||
console.log(response);
|
||||
|
|
|
@ -85,7 +85,7 @@ class Auth extends Service {
|
|||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async oauth(provider, success = '', failure = '') {
|
||||
async oauth(provider, success, failure) {
|
||||
let path = '/auth/oauth/{provider}'.replace(new RegExp('{provider}', 'g'), provider);
|
||||
|
||||
return await this.client.call('get', path, {'content-type': 'application/json'},
|
||||
|
|
|
@ -41,7 +41,7 @@ class Database extends Service {
|
|||
* @throws Exception
|
||||
* @return {}
|
||||
*/
|
||||
async createCollection(name, read = [], write = [], rules = []) {
|
||||
async createCollection(name, read, write, rules) {
|
||||
let path = '/database';
|
||||
|
||||
return await this.client.call('post', path, {'content-type': 'application/json'},
|
||||
|
|
|
@ -54,8 +54,8 @@ GET https://appwrite.io/v1/auth/oauth/{provider}
|
|||
| Field Name | Type | Description | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| provider | string | **Required** OAuth Provider | |
|
||||
| success | string | URL to redirect back to your app after a successful login attempt. | |
|
||||
| failure | string | URL to redirect back to your app after a failed login attempt. | |
|
||||
| success | string | **Required** URL to redirect back to your app after a successful login attempt. | |
|
||||
| failure | string | **Required** URL to redirect back to your app after a failed login attempt. | |
|
||||
|
||||
## Password Recovery
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue