diff --git a/app/sdks/go/LICENSE b/app/sdks/go/LICENSE deleted file mode 100644 index fc7c051a91..0000000000 --- a/app/sdks/go/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2019 Appwrite (https://appwrite.io) and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/app/sdks/go/README.md b/app/sdks/go/README.md deleted file mode 100644 index 35fd446507..0000000000 --- a/app/sdks/go/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Appwrite SDK for Go - -![License](https://img.shields.io/github/license/appwrite/sdk-for-go.svg?v=1) -![Version](https://img.shields.io/badge/api%20version-0.4.0-blue.svg?v=1) - -**This SDK is compatible with Appwrite server version . For older versions, please check previous releases.** - -Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) - - - -![Appwrite](https://appwrite.io/images/github.png) - -## Installation - -To install using `go get`: - -```bash -go get github.com/appwrite/sdk-for-go -``` - -## License - -Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information. \ No newline at end of file diff --git a/app/sdks/go/avatars.go b/app/sdks/go/avatars.go deleted file mode 100644 index 286f644f8d..0000000000 --- a/app/sdks/go/avatars.go +++ /dev/null @@ -1,103 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Avatars service -type Avatars struct { - client *Client -} - -// GetBrowser you can use this endpoint to show different browser icons to -// your users. The code argument receives the browser code as it appears in -// your user /account/sessions endpoint. Use width, height and quality -// arguments to change the output settings. -func (srv *Avatars) GetBrowser(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/browsers/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCreditCard need to display your users with your billing method or their -// payment methods? The credit card endpoint will return you the icon of the -// credit card provider you need. Use width, height and quality arguments to -// change the output settings. -func (srv *Avatars) GetCreditCard(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/credit-cards/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFavicon use this endpoint to fetch the favorite icon (AKA favicon) of a -// any remote website URL. -func (srv *Avatars) GetFavicon(Url string) (map[string]interface{}, error) { - path := "/avatars/favicon" - - params := map[string]interface{}{ - "url": Url, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFlag you can use this endpoint to show different country flags icons to -// your users. The code argument receives the 2 letter country code. Use -// width, height and quality arguments to change the output settings. -func (srv *Avatars) GetFlag(Code string, Width int, Height int, Quality int) (map[string]interface{}, error) { - r := strings.NewReplacer("{code}", Code) - path := r.Replace("/avatars/flags/{code}") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetImage use this endpoint to fetch a remote image URL and crop it to any -// image size you want. This endpoint is very useful if you need to crop and -// display remote images in your app or in case you want to make sure a 3rd -// party image is properly served using a TLS protocol. -func (srv *Avatars) GetImage(Url string, Width int, Height int) (map[string]interface{}, error) { - path := "/avatars/image" - - params := map[string]interface{}{ - "url": Url, - "width": Width, - "height": Height, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetQR converts a given plain text to a QR code image. You can use the query -// parameters to change the size and style of the resulting image. -func (srv *Avatars) GetQR(Text string, Size int, Margin int, Download int) (map[string]interface{}, error) { - path := "/avatars/qr" - - params := map[string]interface{}{ - "text": Text, - "size": Size, - "margin": Margin, - "download": Download, - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/go/client.go b/app/sdks/go/client.go deleted file mode 100644 index 94f2546cff..0000000000 --- a/app/sdks/go/client.go +++ /dev/null @@ -1,119 +0,0 @@ -package appwrite - -import ( - "encoding/json" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - -// Client is the client struct to access Appwrite services -type Client struct { - client *http.Client - endpoint string - headers map[string]string - selfSigned bool -} - -// SetEndpoint sets the default endpoint to which the Client connects to -func (clt *Client) SetEndpoint(endpoint string) { - clt.endpoint = endpoint -} - -// SetSelfSigned sets the condition that specify if the Client should allow connections to a server using a self-signed certificate -func (clt *Client) SetSelfSigned(status bool) { - clt.selfSigned = status -} - -// AddHeader add a new custom header that the Client should send on each request -func (clt *Client) AddHeader(key string, value string) { - clt.headers[key] = value -} - -// SetProjectHeader add the 'X-Appwrite-Project' header for the Client. Your Appwrite project ID -func (clt *Client) SetProjectHeader(value string) { - clt.headers["X-Appwrite-Project"] = value -} - -// SetKeyHeader add the 'X-Appwrite-Key' header for the Client. Your Appwrite project secret key -func (clt *Client) SetKeyHeader(value string) { - clt.headers["X-Appwrite-Key"] = value -} - -// SetLocaleHeader add the 'X-Appwrite-Locale' header for the Client. -func (clt *Client) SetLocaleHeader(value string) { - clt.headers["X-Appwrite-Locale"] = value -} - -// SetModeHeader add the 'X-Appwrite-Mode' header for the Client. -func (clt *Client) SetModeHeader(value string) { - clt.headers["X-Appwrite-Mode"] = value -} - -// Call an API using Client -func (clt *Client) Call(method string, path string, headers map[string]interface{}, params map[string]interface{}) (map[string]interface{}, error) { - if clt.client == nil { - // Create HTTP client - clt.client = &http.Client{} - } - - if clt.selfSigned { - // Allow self signed requests - } - - urlPath := clt.endpoint + path - isGet := strings.ToUpper(method) == "GET" - - var reqBody *strings.Reader - if !isGet { - frm := url.Values{} - for key, val := range params { - frm.Add(key, ToString(val)) - } - reqBody = strings.NewReader(frm.Encode()) - } - - // Create and modify HTTP request before sending - req, err := http.NewRequest(method, urlPath, reqBody) - if err != nil { - return nil, err - } - - // Set Client headers - for key, val := range clt.headers { - req.Header.Set(key, ToString(val)) - } - - // Set Custom headers - for key, val := range headers { - req.Header.Set(key, ToString(val)) - } - - if isGet { - q := req.URL.Query() - for key, val := range params { - q.Add(key, ToString(val)) - } - req.URL.RawQuery = q.Encode() - } - - // Make request - response, err := clt.client.Do(req) - if err != nil { - return nil, err - } - - // Handle response - defer response.Body.Close() - - responseData, err := ioutil.ReadAll(response.Body) - if err != nil { - return nil, err - } - - var jsonResponse map[string]interface{} - json.Unmarshal(responseData, &jsonResponse) - - return jsonResponse, nil -} diff --git a/app/sdks/go/database.go b/app/sdks/go/database.go deleted file mode 100644 index b1e58e746b..0000000000 --- a/app/sdks/go/database.go +++ /dev/null @@ -1,159 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Database service -type Database struct { - client *Client -} - -// ListCollections get a list of all the user collections. You can use the -// query params to filter your results. On admin mode, this endpoint will -// return a list of all of the project collections. [Learn more about -// different API modes](/docs/admin). -func (srv *Database) ListCollections(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/database" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateCollection create a new Collection. -func (srv *Database) CreateCollection(Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error) { - path := "/database" - - params := map[string]interface{}{ - "name": Name, - "read": Read, - "write": Write, - "rules": Rules, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetCollection get collection by its unique ID. This endpoint response -// returns a JSON object with the collection metadata. -func (srv *Database) GetCollection(CollectionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/{collectionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateCollection update collection by its unique ID. -func (srv *Database) UpdateCollection(CollectionId string, Name string, Read []interface{}, Write []interface{}, Rules []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/{collectionId}") - - params := map[string]interface{}{ - "name": Name, - "read": Read, - "write": Write, - "rules": Rules, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteCollection delete a collection by its unique ID. Only users with -// write permissions have access to delete this resource. -func (srv *Database) DeleteCollection(CollectionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/{collectionId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// ListDocuments get a list of all the user documents. You can use the query -// params to filter your results. On admin mode, this endpoint will return a -// list of all of the project documents. [Learn more about different API -// modes](/docs/admin). -func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, Offset int, Limit int, OrderField string, OrderType string, OrderCast string, Search string, First int, Last int) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/{collectionId}/documents") - - params := map[string]interface{}{ - "filters": Filters, - "offset": Offset, - "limit": Limit, - "order-field": OrderField, - "order-type": OrderType, - "order-cast": OrderCast, - "search": Search, - "first": First, - "last": Last, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateDocument create a new Document. -func (srv *Database) CreateDocument(CollectionId string, Data string, Read []interface{}, Write []interface{}, ParentDocument string, ParentProperty string, ParentPropertyType string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId) - path := r.Replace("/database/{collectionId}/documents") - - params := map[string]interface{}{ - "data": Data, - "read": Read, - "write": Write, - "parentDocument": ParentDocument, - "parentProperty": ParentProperty, - "parentPropertyType": ParentPropertyType, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetDocument get document by its unique ID. This endpoint response returns a -// JSON object with the document data. -func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateDocument -func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - "data": Data, - "read": Read, - "write": Write, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// DeleteDocument delete document by its unique ID. This endpoint deletes only -// the parent documents, his attributes and relations to other documents. -// Child documents **will not** be deleted. -func (srv *Database) DeleteDocument(CollectionId string, DocumentId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{collectionId}", CollectionId, "{documentId}", DocumentId) - path := r.Replace("/database/{collectionId}/documents/{documentId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} diff --git a/app/sdks/go/docs/examples/Avatars/get-browser.md b/app/sdks/go/docs/examples/Avatars/get-browser.md deleted file mode 100644 index 4e1f0b13c3..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-browser.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetBrowser method and handle results - var res, err := srv.GetBrowser("aa") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-credit-card.md b/app/sdks/go/docs/examples/Avatars/get-credit-card.md deleted file mode 100644 index 1ef37d9fe3..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-credit-card.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetCreditCard method and handle results - var res, err := srv.GetCreditCard("amex") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-favicon.md b/app/sdks/go/docs/examples/Avatars/get-favicon.md deleted file mode 100644 index f375a7bc6c..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-favicon.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetFavicon method and handle results - var res, err := srv.GetFavicon("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-flag.md b/app/sdks/go/docs/examples/Avatars/get-flag.md deleted file mode 100644 index 5658f5e1cc..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-flag.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetFlag method and handle results - var res, err := srv.GetFlag("af") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-image.md b/app/sdks/go/docs/examples/Avatars/get-image.md deleted file mode 100644 index 1ab511eecf..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-image.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetImage method and handle results - var res, err := srv.GetImage("https://example.com") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Avatars/get-q-r.md b/app/sdks/go/docs/examples/Avatars/get-q-r.md deleted file mode 100644 index 14c54b494c..0000000000 --- a/app/sdks/go/docs/examples/Avatars/get-q-r.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Avatars service passing Client - var srv := appwrite.Avatars{ - client: &client - } - - // Call GetQR method and handle results - var res, err := srv.GetQR("[TEXT]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/create-collection.md b/app/sdks/go/docs/examples/Database/create-collection.md deleted file mode 100644 index 57bd03cfd1..0000000000 --- a/app/sdks/go/docs/examples/Database/create-collection.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call CreateCollection method and handle results - var res, err := srv.CreateCollection("[NAME]", [], [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/create-document.md b/app/sdks/go/docs/examples/Database/create-document.md deleted file mode 100644 index b3c7818222..0000000000 --- a/app/sdks/go/docs/examples/Database/create-document.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call CreateDocument method and handle results - var res, err := srv.CreateDocument("[COLLECTION_ID]", "{}", [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/delete-collection.md b/app/sdks/go/docs/examples/Database/delete-collection.md deleted file mode 100644 index a2c4056ce8..0000000000 --- a/app/sdks/go/docs/examples/Database/delete-collection.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call DeleteCollection method and handle results - var res, err := srv.DeleteCollection("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/delete-document.md b/app/sdks/go/docs/examples/Database/delete-document.md deleted file mode 100644 index 69cde9fb0f..0000000000 --- a/app/sdks/go/docs/examples/Database/delete-document.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call DeleteDocument method and handle results - var res, err := srv.DeleteDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/get-collection.md b/app/sdks/go/docs/examples/Database/get-collection.md deleted file mode 100644 index e60e590c14..0000000000 --- a/app/sdks/go/docs/examples/Database/get-collection.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call GetCollection method and handle results - var res, err := srv.GetCollection("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/get-document.md b/app/sdks/go/docs/examples/Database/get-document.md deleted file mode 100644 index 90fd6a2b76..0000000000 --- a/app/sdks/go/docs/examples/Database/get-document.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call GetDocument method and handle results - var res, err := srv.GetDocument("[COLLECTION_ID]", "[DOCUMENT_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/list-collections.md b/app/sdks/go/docs/examples/Database/list-collections.md deleted file mode 100644 index b6cc1830aa..0000000000 --- a/app/sdks/go/docs/examples/Database/list-collections.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call ListCollections method and handle results - var res, err := srv.ListCollections() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/list-documents.md b/app/sdks/go/docs/examples/Database/list-documents.md deleted file mode 100644 index 5f7aec3672..0000000000 --- a/app/sdks/go/docs/examples/Database/list-documents.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call ListDocuments method and handle results - var res, err := srv.ListDocuments("[COLLECTION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/update-collection.md b/app/sdks/go/docs/examples/Database/update-collection.md deleted file mode 100644 index 79b1ab25b6..0000000000 --- a/app/sdks/go/docs/examples/Database/update-collection.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call UpdateCollection method and handle results - var res, err := srv.UpdateCollection("[COLLECTION_ID]", "[NAME]", [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Database/update-document.md b/app/sdks/go/docs/examples/Database/update-document.md deleted file mode 100644 index 3ed43c454b..0000000000 --- a/app/sdks/go/docs/examples/Database/update-document.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Database service passing Client - var srv := appwrite.Database{ - client: &client - } - - // Call UpdateDocument method and handle results - var res, err := srv.UpdateDocument("[COLLECTION_ID]", "[DOCUMENT_ID]", "{}", [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-continents.md b/app/sdks/go/docs/examples/Locale/get-continents.md deleted file mode 100644 index d707b900c2..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-continents.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetContinents method and handle results - var res, err := srv.GetContinents() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-countries-e-u.md b/app/sdks/go/docs/examples/Locale/get-countries-e-u.md deleted file mode 100644 index f3f2146bee..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-countries-e-u.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetCountriesEU method and handle results - var res, err := srv.GetCountriesEU() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-countries-phones.md b/app/sdks/go/docs/examples/Locale/get-countries-phones.md deleted file mode 100644 index 21a2d163b5..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-countries-phones.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetCountriesPhones method and handle results - var res, err := srv.GetCountriesPhones() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-countries.md b/app/sdks/go/docs/examples/Locale/get-countries.md deleted file mode 100644 index 9f81721e70..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-countries.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetCountries method and handle results - var res, err := srv.GetCountries() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-currencies.md b/app/sdks/go/docs/examples/Locale/get-currencies.md deleted file mode 100644 index 752a99de3c..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-currencies.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetCurrencies method and handle results - var res, err := srv.GetCurrencies() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Locale/get-locale.md b/app/sdks/go/docs/examples/Locale/get-locale.md deleted file mode 100644 index d8e8ed1127..0000000000 --- a/app/sdks/go/docs/examples/Locale/get-locale.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Locale service passing Client - var srv := appwrite.Locale{ - client: &client - } - - // Call GetLocale method and handle results - var res, err := srv.GetLocale() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/create-file.md b/app/sdks/go/docs/examples/Storage/create-file.md deleted file mode 100644 index bb55c63d3d..0000000000 --- a/app/sdks/go/docs/examples/Storage/create-file.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call CreateFile method and handle results - var res, err := srv.CreateFile(file, [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/delete-file.md b/app/sdks/go/docs/examples/Storage/delete-file.md deleted file mode 100644 index e2eea09d9a..0000000000 --- a/app/sdks/go/docs/examples/Storage/delete-file.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call DeleteFile method and handle results - var res, err := srv.DeleteFile("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/get-file-download.md b/app/sdks/go/docs/examples/Storage/get-file-download.md deleted file mode 100644 index e8c6343391..0000000000 --- a/app/sdks/go/docs/examples/Storage/get-file-download.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call GetFileDownload method and handle results - var res, err := srv.GetFileDownload("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/get-file-preview.md b/app/sdks/go/docs/examples/Storage/get-file-preview.md deleted file mode 100644 index 6fa084376b..0000000000 --- a/app/sdks/go/docs/examples/Storage/get-file-preview.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call GetFilePreview method and handle results - var res, err := srv.GetFilePreview("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/get-file-view.md b/app/sdks/go/docs/examples/Storage/get-file-view.md deleted file mode 100644 index 6c664bcb24..0000000000 --- a/app/sdks/go/docs/examples/Storage/get-file-view.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call GetFileView method and handle results - var res, err := srv.GetFileView("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/get-file.md b/app/sdks/go/docs/examples/Storage/get-file.md deleted file mode 100644 index 766b3dc8da..0000000000 --- a/app/sdks/go/docs/examples/Storage/get-file.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call GetFile method and handle results - var res, err := srv.GetFile("[FILE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/list-files.md b/app/sdks/go/docs/examples/Storage/list-files.md deleted file mode 100644 index 654aba9a8b..0000000000 --- a/app/sdks/go/docs/examples/Storage/list-files.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call ListFiles method and handle results - var res, err := srv.ListFiles() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Storage/update-file.md b/app/sdks/go/docs/examples/Storage/update-file.md deleted file mode 100644 index b9d6b981de..0000000000 --- a/app/sdks/go/docs/examples/Storage/update-file.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Storage service passing Client - var srv := appwrite.Storage{ - client: &client - } - - // Call UpdateFile method and handle results - var res, err := srv.UpdateFile("[FILE_ID]", [], []) - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/create-team-membership.md b/app/sdks/go/docs/examples/Teams/create-team-membership.md deleted file mode 100644 index 894c4aef5b..0000000000 --- a/app/sdks/go/docs/examples/Teams/create-team-membership.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // 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) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/create-team.md b/app/sdks/go/docs/examples/Teams/create-team.md deleted file mode 100644 index c8b4ee95e6..0000000000 --- a/app/sdks/go/docs/examples/Teams/create-team.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call CreateTeam method and handle results - var res, err := srv.CreateTeam("[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/delete-team-membership.md b/app/sdks/go/docs/examples/Teams/delete-team-membership.md deleted file mode 100644 index 1f35436bbc..0000000000 --- a/app/sdks/go/docs/examples/Teams/delete-team-membership.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call DeleteTeamMembership method and handle results - var res, err := srv.DeleteTeamMembership("[TEAM_ID]", "[INVITE_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/delete-team.md b/app/sdks/go/docs/examples/Teams/delete-team.md deleted file mode 100644 index 91a52df484..0000000000 --- a/app/sdks/go/docs/examples/Teams/delete-team.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call DeleteTeam method and handle results - var res, err := srv.DeleteTeam("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/get-team-memberships.md b/app/sdks/go/docs/examples/Teams/get-team-memberships.md deleted file mode 100644 index 3f5decbc90..0000000000 --- a/app/sdks/go/docs/examples/Teams/get-team-memberships.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call GetTeamMemberships method and handle results - var res, err := srv.GetTeamMemberships("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/get-team.md b/app/sdks/go/docs/examples/Teams/get-team.md deleted file mode 100644 index 117dcbf94c..0000000000 --- a/app/sdks/go/docs/examples/Teams/get-team.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call GetTeam method and handle results - var res, err := srv.GetTeam("[TEAM_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/list-teams.md b/app/sdks/go/docs/examples/Teams/list-teams.md deleted file mode 100644 index 71b5fb04ea..0000000000 --- a/app/sdks/go/docs/examples/Teams/list-teams.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call ListTeams method and handle results - var res, err := srv.ListTeams() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Teams/update-team.md b/app/sdks/go/docs/examples/Teams/update-team.md deleted file mode 100644 index 33de23cdd6..0000000000 --- a/app/sdks/go/docs/examples/Teams/update-team.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Teams service passing Client - var srv := appwrite.Teams{ - client: &client - } - - // Call UpdateTeam method and handle results - var res, err := srv.UpdateTeam("[TEAM_ID]", "[NAME]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/create-user.md b/app/sdks/go/docs/examples/Users/create-user.md deleted file mode 100644 index 0ad8fcfbb3..0000000000 --- a/app/sdks/go/docs/examples/Users/create-user.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call CreateUser method and handle results - var res, err := srv.CreateUser("email@example.com", "password") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/delete-user-session.md b/app/sdks/go/docs/examples/Users/delete-user-session.md deleted file mode 100644 index 2e63b205e3..0000000000 --- a/app/sdks/go/docs/examples/Users/delete-user-session.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call DeleteUserSession method and handle results - var res, err := srv.DeleteUserSession("[USER_ID]", "[SESSION_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/delete-user-sessions.md b/app/sdks/go/docs/examples/Users/delete-user-sessions.md deleted file mode 100644 index eb08458c9f..0000000000 --- a/app/sdks/go/docs/examples/Users/delete-user-sessions.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call DeleteUserSessions method and handle results - var res, err := srv.DeleteUserSessions("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/get-user-logs.md b/app/sdks/go/docs/examples/Users/get-user-logs.md deleted file mode 100644 index a17455f86a..0000000000 --- a/app/sdks/go/docs/examples/Users/get-user-logs.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call GetUserLogs method and handle results - var res, err := srv.GetUserLogs("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/get-user-prefs.md b/app/sdks/go/docs/examples/Users/get-user-prefs.md deleted file mode 100644 index e161a3694c..0000000000 --- a/app/sdks/go/docs/examples/Users/get-user-prefs.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call GetUserPrefs method and handle results - var res, err := srv.GetUserPrefs("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/get-user-sessions.md b/app/sdks/go/docs/examples/Users/get-user-sessions.md deleted file mode 100644 index d88d75e39f..0000000000 --- a/app/sdks/go/docs/examples/Users/get-user-sessions.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call GetUserSessions method and handle results - var res, err := srv.GetUserSessions("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/get-user.md b/app/sdks/go/docs/examples/Users/get-user.md deleted file mode 100644 index 9072765f96..0000000000 --- a/app/sdks/go/docs/examples/Users/get-user.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call GetUser method and handle results - var res, err := srv.GetUser("[USER_ID]") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/list-users.md b/app/sdks/go/docs/examples/Users/list-users.md deleted file mode 100644 index 0c85dafd3b..0000000000 --- a/app/sdks/go/docs/examples/Users/list-users.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call ListUsers method and handle results - var res, err := srv.ListUsers() - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/update-user-prefs.md b/app/sdks/go/docs/examples/Users/update-user-prefs.md deleted file mode 100644 index 333c19a4e6..0000000000 --- a/app/sdks/go/docs/examples/Users/update-user-prefs.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call UpdateUserPrefs method and handle results - var res, err := srv.UpdateUserPrefs("[USER_ID]", "") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/docs/examples/Users/update-user-status.md b/app/sdks/go/docs/examples/Users/update-user-status.md deleted file mode 100644 index 914f62dc25..0000000000 --- a/app/sdks/go/docs/examples/Users/update-user-status.md +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "fmt" - "os" - "github.com/appwrite/sdk-for-go" -) - -func main() { - // Create a Client - var client := appwrite.Client{} - - // Set Client required headers - client.SetProject("") - client.SetKey("") - - // Create a new Users service passing Client - var srv := appwrite.Users{ - client: &client - } - - // Call UpdateUserStatus method and handle results - var res, err := srv.UpdateUserStatus("[USER_ID]", "1") - if err != nil { - panic(err) - } - - fmt.Println(res) -} \ No newline at end of file diff --git a/app/sdks/go/locale.go b/app/sdks/go/locale.go deleted file mode 100644 index cf6a0cfdd3..0000000000 --- a/app/sdks/go/locale.go +++ /dev/null @@ -1,80 +0,0 @@ -package appwrite - -import ( -) - -// Locale service -type Locale struct { - client *Client -} - -// GetLocale get the current user location based on IP. Returns an object with -// user country code, country name, continent name, continent code, ip address -// and suggested currency. You can use the locale header to get the data in a -// supported language. -// -// ([IP Geolocation by DB-IP](https://db-ip.com)) -func (srv *Locale) GetLocale() (map[string]interface{}, error) { - path := "/locale" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetContinents list of all continents. You can use the locale header to get -// the data in a supported language. -func (srv *Locale) GetContinents() (map[string]interface{}, error) { - path := "/locale/continents" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountries list of all countries. You can use the locale header to get -// the data in a supported language. -func (srv *Locale) GetCountries() (map[string]interface{}, error) { - path := "/locale/countries" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountriesEU list of all countries that are currently members of the EU. -// You can use the locale header to get the data in a supported language. -func (srv *Locale) GetCountriesEU() (map[string]interface{}, error) { - path := "/locale/countries/eu" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCountriesPhones list of all countries phone codes. You can use the -// locale header to get the data in a supported language. -func (srv *Locale) GetCountriesPhones() (map[string]interface{}, error) { - path := "/locale/countries/phones" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetCurrencies list of all currencies, including currency symol, name, -// plural, and decimal digits for all major and minor currencies. You can use -// the locale header to get the data in a supported language. -func (srv *Locale) GetCurrencies() (map[string]interface{}, error) { - path := "/locale/currencies" - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/go/main.go b/app/sdks/go/main.go deleted file mode 100644 index 13df7fc1b5..0000000000 --- a/app/sdks/go/main.go +++ /dev/null @@ -1,6 +0,0 @@ -package appwrite - -// NewClient initializes a new Appwrite client -func NewClient() Client { - return Client{} -} diff --git a/app/sdks/go/storage.go b/app/sdks/go/storage.go deleted file mode 100644 index e4edd23bf4..0000000000 --- a/app/sdks/go/storage.go +++ /dev/null @@ -1,126 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Storage service -type Storage struct { - client *Client -} - -// ListFiles get a list of all the user files. You can use the query params to -// filter your results. On admin mode, this endpoint will return a list of all -// of the project files. [Learn more about different API modes](/docs/admin). -func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/storage/files" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateFile create a new file. The user who creates the file will -// automatically be assigned to read and write access unless he has passed -// custom values for read and write arguments. -func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - path := "/storage/files" - - params := map[string]interface{}{ - "file": File, - "read": Read, - "write": Write, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetFile get file by its unique ID. This endpoint response returns a JSON -// object with the file metadata. -func (srv *Storage) GetFile(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateFile update file by its unique ID. Only users with write permissions -// have access to update this resource. -func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interface{}) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - "read": Read, - "write": Write, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteFile delete a file by its unique ID. Only users with write -// permissions have access to delete this resource. -func (srv *Storage) DeleteFile(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetFileDownload get file content by its unique ID. The endpoint response -// return with a 'Content-Disposition: attachment' header that tells the -// browser to start downloading the file to user downloads directory. -func (srv *Storage) GetFileDownload(FileId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/download") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFilePreview get a file preview image. Currently, this method supports -// preview for image files (jpg, png, and gif), other supported formats, like -// pdf, docs, slides, and spreadsheets, will return the file icon image. You -// can also pass query string arguments for cutting and resizing your preview -// image. -func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality int, Background string, Output string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/preview") - - params := map[string]interface{}{ - "width": Width, - "height": Height, - "quality": Quality, - "background": Background, - "output": Output, - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetFileView get file content by its unique ID. This endpoint is similar to -// the download method but returns with no 'Content-Disposition: attachment' -// header. -func (srv *Storage) GetFileView(FileId string, As string) (map[string]interface{}, error) { - r := strings.NewReplacer("{fileId}", FileId) - path := r.Replace("/storage/files/{fileId}/view") - - params := map[string]interface{}{ - "as": As, - } - - return srv.client.Call("GET", path, nil, params) -} diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go deleted file mode 100644 index 925275f733..0000000000 --- a/app/sdks/go/teams.go +++ /dev/null @@ -1,132 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Teams service -type Teams struct { - client *Client -} - -// ListTeams get a list of all the current user teams. You can use the query -// params to filter your results. On admin mode, this endpoint will return a -// list of all of the project teams. [Learn more about different API -// modes](/docs/admin). -func (srv *Teams) ListTeams(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/teams" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateTeam create a new team. The user who creates the team will -// automatically be assigned as the owner of the team. The team owner can -// invite new members, who will be able add new owners and update or delete -// the team from your project. -func (srv *Teams) CreateTeam(Name string, Roles []interface{}) (map[string]interface{}, error) { - path := "/teams" - - params := map[string]interface{}{ - "name": Name, - "roles": Roles, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetTeam get team by its unique ID. All team members have read access for -// this resource. -func (srv *Teams) GetTeam(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateTeam update team by its unique ID. Only team owners have write access -// for this resource. -func (srv *Teams) UpdateTeam(TeamId string, Name string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - "name": Name, - } - - return srv.client.Call("PUT", path, nil, params) -} - -// DeleteTeam delete team by its unique ID. Only team owners have write access -// for this resource. -func (srv *Teams) DeleteTeam(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// GetTeamMemberships get team members by the team unique ID. All team members -// have read access for this list of resources. -func (srv *Teams) GetTeamMemberships(TeamId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}/memberships") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateTeamMembership use this endpoint to invite a new member to your team. -// An email with a link to join the team will be sent to the new member email -// address. If member doesn't exists in the project it will be automatically -// created. -// -// Use the 'url' parameter to redirect the user from the invitation email back -// to your app. When the user is redirected, use the [Update Team Membership -// Status](/docs/teams#updateTeamMembershipStatus) endpoint to finally join -// the user to the team. -// -// Please note that in order to avoid a [Redirect -// Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) -// the only valid redirect URL's are the once from domains you have set when -// added your platforms in the console interface. -func (srv *Teams) CreateTeamMembership(TeamId string, Email string, Roles []interface{}, Url string, Name string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId) - path := r.Replace("/teams/{teamId}/memberships") - - params := map[string]interface{}{ - "email": Email, - "name": Name, - "roles": Roles, - "url": Url, - } - - return srv.client.Call("POST", path, nil, params) -} - -// DeleteTeamMembership this endpoint allows a user to leave a team or for a -// team owner to delete the membership of any other team member. You can also -// use this endpoint to delete a user membership even if he didn't accept it. -func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId) - path := r.Replace("/teams/{teamId}/memberships/{inviteId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} diff --git a/app/sdks/go/users.go b/app/sdks/go/users.go deleted file mode 100644 index 6ef84d510a..0000000000 --- a/app/sdks/go/users.go +++ /dev/null @@ -1,130 +0,0 @@ -package appwrite - -import ( - "strings" -) - -// Users service -type Users struct { - client *Client -} - -// ListUsers get a list of all the project users. You can use the query params -// to filter your results. -func (srv *Users) ListUsers(Search string, Limit int, Offset int, OrderType string) (map[string]interface{}, error) { - path := "/users" - - params := map[string]interface{}{ - "search": Search, - "limit": Limit, - "offset": Offset, - "orderType": OrderType, - } - - return srv.client.Call("GET", path, nil, params) -} - -// CreateUser create a new user. -func (srv *Users) CreateUser(Email string, Password string, Name string) (map[string]interface{}, error) { - path := "/users" - - params := map[string]interface{}{ - "email": Email, - "password": Password, - "name": Name, - } - - return srv.client.Call("POST", path, nil, params) -} - -// GetUser get user by its unique ID. -func (srv *Users) GetUser(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetUserLogs get user activity logs list by its unique ID. -func (srv *Users) GetUserLogs(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/logs") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// GetUserPrefs get user preferences by its unique ID. -func (srv *Users) GetUserPrefs(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/prefs") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// UpdateUserPrefs update user preferences by its unique ID. You can pass only -// the specific settings you wish to update. -func (srv *Users) UpdateUserPrefs(UserId string, Prefs string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/prefs") - - params := map[string]interface{}{ - "prefs": Prefs, - } - - return srv.client.Call("PATCH", path, nil, params) -} - -// GetUserSessions get user sessions list by its unique ID. -func (srv *Users) GetUserSessions(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/sessions") - - params := map[string]interface{}{ - } - - return srv.client.Call("GET", path, nil, params) -} - -// DeleteUserSessions delete all user sessions by its unique ID. -func (srv *Users) DeleteUserSessions(UserId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/sessions") - - params := map[string]interface{}{ - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// DeleteUserSession delete user sessions by its unique ID. -func (srv *Users) DeleteUserSession(UserId string, SessionId string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/sessions/:session") - - params := map[string]interface{}{ - "sessionId": SessionId, - } - - return srv.client.Call("DELETE", path, nil, params) -} - -// UpdateUserStatus update user status by its unique ID. -func (srv *Users) UpdateUserStatus(UserId string, Status string) (map[string]interface{}, error) { - r := strings.NewReplacer("{userId}", UserId) - path := r.Replace("/users/{userId}/status") - - params := map[string]interface{}{ - "status": Status, - } - - return srv.client.Call("PATCH", path, nil, params) -} diff --git a/app/sdks/go/utils.go b/app/sdks/go/utils.go deleted file mode 100644 index ca36149cf1..0000000000 --- a/app/sdks/go/utils.go +++ /dev/null @@ -1,36 +0,0 @@ -package appwrite - -import ( - "fmt" - "reflect" - "strconv" -) - -// ToString changes arg to string -func ToString(arg interface{}) string { - var tmp = reflect.Indirect(reflect.ValueOf(arg)).Interface() - switch v := tmp.(type) { - case int: - return strconv.Itoa(v) - case int8: - return strconv.FormatInt(int64(v), 10) - case int16: - return strconv.FormatInt(int64(v), 10) - case int32: - return strconv.FormatInt(int64(v), 10) - case int64: - return strconv.FormatInt(v, 10) - case string: - return v - case float32: - return strconv.FormatFloat(float64(v), 'f', -1, 32) - case float64: - return strconv.FormatFloat(v, 'f', -1, 64) - case fmt.Stringer: - return v.String() - case reflect.Value: - return ToString(v.Interface()) - default: - return "" - } -}