From d25a1f4f7804f4669e56ed01ec29741bf2c6149e Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Wed, 29 Jan 2020 00:56:24 +0200 Subject: [PATCH] Update for Go --- app/sdks/go/avatars.go | 12 ++++++------ app/sdks/go/database.go | 20 ++++++++++---------- app/sdks/go/locale.go | 12 ++++++------ app/sdks/go/storage.go | 16 ++++++++-------- app/sdks/go/teams.go | 16 ++++++++-------- app/sdks/go/users.go | 20 ++++++++++---------- composer.lock | 4 ++-- 7 files changed, 50 insertions(+), 50 deletions(-) diff --git a/app/sdks/go/avatars.go b/app/sdks/go/avatars.go index bf2d39410..0fde92372 100644 --- a/app/sdks/go/avatars.go +++ b/app/sdks/go/avatars.go @@ -28,7 +28,7 @@ func (srv *Avatars) GetBrowser(Code string, Width int, Height int, Quality int) "quality": Quality, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetCreditCard need to display your users with your billing method or their @@ -45,7 +45,7 @@ func (srv *Avatars) GetCreditCard(Code string, Width int, Height int, Quality in "quality": Quality, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetFavicon use this endpoint to fetch the favorite icon (AKA favicon) of a @@ -57,7 +57,7 @@ func (srv *Avatars) GetFavicon(Url string) (map[string]interface{}, error) { "url": Url, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetFlag you can use this endpoint to show different country flags icons to @@ -73,7 +73,7 @@ func (srv *Avatars) GetFlag(Code string, Width int, Height int, Quality int) (ma "quality": Quality, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetImage use this endpoint to fetch a remote image URL and crop it to any @@ -89,7 +89,7 @@ func (srv *Avatars) GetImage(Url string, Width int, Height int) (map[string]inte "height": Height, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetQR converts a given plain text to a QR code image. You can use the query @@ -104,5 +104,5 @@ func (srv *Avatars) GetQR(Text string, Size int, Margin int, Download int) (map[ "download": Download, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } diff --git a/app/sdks/go/database.go b/app/sdks/go/database.go index f10a520d5..e21b4810c 100644 --- a/app/sdks/go/database.go +++ b/app/sdks/go/database.go @@ -28,7 +28,7 @@ func (srv *Database) ListCollections(Search string, Limit int, Offset int, Order "orderType": OrderType, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateCollection create a new Collection. @@ -42,7 +42,7 @@ func (srv *Database) CreateCollection(Name string, Read []interface{}, Write []i "rules": Rules, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // GetCollection get collection by its unique ID. This endpoint response @@ -54,7 +54,7 @@ func (srv *Database) GetCollection(CollectionId string) (map[string]interface{}, params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // UpdateCollection update collection by its unique ID. @@ -69,7 +69,7 @@ func (srv *Database) UpdateCollection(CollectionId string, Name string, Read []i "rules": Rules, } - return srv.Client.Call("PUT", path, nil, params) + return srv.client.Call("PUT", path, nil, params) } // DeleteCollection delete a collection by its unique ID. Only users with @@ -81,7 +81,7 @@ func (srv *Database) DeleteCollection(CollectionId string) (map[string]interface params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } // ListDocuments get a list of all the user documents. You can use the query @@ -104,7 +104,7 @@ func (srv *Database) ListDocuments(CollectionId string, Filters []interface{}, O "last": Last, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateDocument create a new Document. @@ -121,7 +121,7 @@ func (srv *Database) CreateDocument(CollectionId string, Data string, Read []int "parentPropertyType": ParentPropertyType, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // GetDocument get document by its unique ID. This endpoint response returns a @@ -133,7 +133,7 @@ func (srv *Database) GetDocument(CollectionId string, DocumentId string) (map[st params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // UpdateDocument @@ -147,7 +147,7 @@ func (srv *Database) UpdateDocument(CollectionId string, DocumentId string, Data "write": Write, } - return srv.Client.Call("PATCH", path, nil, params) + return srv.client.Call("PATCH", path, nil, params) } // DeleteDocument delete document by its unique ID. This endpoint deletes only @@ -160,5 +160,5 @@ func (srv *Database) DeleteDocument(CollectionId string, DocumentId string) (map params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } diff --git a/app/sdks/go/locale.go b/app/sdks/go/locale.go index 2b4813bbd..704f749d4 100644 --- a/app/sdks/go/locale.go +++ b/app/sdks/go/locale.go @@ -25,7 +25,7 @@ func (srv *Locale) GetLocale() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetContinents list of all continents. You can use the locale header to get @@ -36,7 +36,7 @@ func (srv *Locale) GetContinents() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetCountries list of all countries. You can use the locale header to get @@ -47,7 +47,7 @@ func (srv *Locale) GetCountries() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetCountriesEU list of all countries that are currently members of the EU. @@ -58,7 +58,7 @@ func (srv *Locale) GetCountriesEU() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetCountriesPhones list of all countries phone codes. You can use the @@ -69,7 +69,7 @@ func (srv *Locale) GetCountriesPhones() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetCurrencies list of all currencies, including currency symol, name, @@ -81,5 +81,5 @@ func (srv *Locale) GetCurrencies() (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } diff --git a/app/sdks/go/storage.go b/app/sdks/go/storage.go index b1fe2192f..693fc3853 100644 --- a/app/sdks/go/storage.go +++ b/app/sdks/go/storage.go @@ -27,7 +27,7 @@ func (srv *Storage) ListFiles(Search string, Limit int, Offset int, OrderType st "orderType": OrderType, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateFile create a new file. The user who creates the file will @@ -42,7 +42,7 @@ func (srv *Storage) CreateFile(File string, Read []interface{}, Write []interfac "write": Write, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // GetFile get file by its unique ID. This endpoint response returns a JSON @@ -54,7 +54,7 @@ func (srv *Storage) GetFile(FileId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // UpdateFile update file by its unique ID. Only users with write permissions @@ -68,7 +68,7 @@ func (srv *Storage) UpdateFile(FileId string, Read []interface{}, Write []interf "write": Write, } - return srv.Client.Call("PUT", path, nil, params) + return srv.client.Call("PUT", path, nil, params) } // DeleteFile delete a file by its unique ID. Only users with write @@ -80,7 +80,7 @@ func (srv *Storage) DeleteFile(FileId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } // GetFileDownload get file content by its unique ID. The endpoint response @@ -93,7 +93,7 @@ func (srv *Storage) GetFileDownload(FileId string) (map[string]interface{}, erro params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetFilePreview get a file preview image. Currently, this method supports @@ -113,7 +113,7 @@ func (srv *Storage) GetFilePreview(FileId string, Width int, Height int, Quality "output": Output, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetFileView get file content by its unique ID. This endpoint is similar to @@ -127,5 +127,5 @@ func (srv *Storage) GetFileView(FileId string, As string) (map[string]interface{ "as": As, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } diff --git a/app/sdks/go/teams.go b/app/sdks/go/teams.go index 97b73d198..e744e6a96 100644 --- a/app/sdks/go/teams.go +++ b/app/sdks/go/teams.go @@ -28,7 +28,7 @@ func (srv *Teams) ListTeams(Search string, Limit int, Offset int, OrderType stri "orderType": OrderType, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateTeam create a new team. The user who creates the team will @@ -43,7 +43,7 @@ func (srv *Teams) CreateTeam(Name string, Roles []interface{}) (map[string]inter "roles": Roles, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // GetTeam get team by its unique ID. All team members have read access for @@ -55,7 +55,7 @@ func (srv *Teams) GetTeam(TeamId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // UpdateTeam update team by its unique ID. Only team owners have write access @@ -68,7 +68,7 @@ func (srv *Teams) UpdateTeam(TeamId string, Name string) (map[string]interface{} "name": Name, } - return srv.Client.Call("PUT", path, nil, params) + return srv.client.Call("PUT", path, nil, params) } // DeleteTeam delete team by its unique ID. Only team owners have write access @@ -80,7 +80,7 @@ func (srv *Teams) DeleteTeam(TeamId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } // GetTeamMemberships get team members by the team unique ID. All team members @@ -92,7 +92,7 @@ func (srv *Teams) GetTeamMemberships(TeamId string) (map[string]interface{}, err params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateTeamMembership use this endpoint to invite a new member to your team. @@ -120,7 +120,7 @@ func (srv *Teams) CreateTeamMembership(TeamId string, Email string, Roles []inte "url": Url, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // DeleteTeamMembership this endpoint allows a user to leave a team or for a @@ -133,5 +133,5 @@ func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[stri params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } diff --git a/app/sdks/go/users.go b/app/sdks/go/users.go index 671f1ed7f..49f60effe 100644 --- a/app/sdks/go/users.go +++ b/app/sdks/go/users.go @@ -26,7 +26,7 @@ func (srv *Users) ListUsers(Search string, Limit int, Offset int, OrderType stri "orderType": OrderType, } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // CreateUser create a new user. @@ -39,7 +39,7 @@ func (srv *Users) CreateUser(Email string, Password string, Name string) (map[st "name": Name, } - return srv.Client.Call("POST", path, nil, params) + return srv.client.Call("POST", path, nil, params) } // GetUser get user by its unique ID. @@ -50,7 +50,7 @@ func (srv *Users) GetUser(UserId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetUserLogs get user activity logs list by its unique ID. @@ -61,7 +61,7 @@ func (srv *Users) GetUserLogs(UserId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // GetUserPrefs get user preferences by its unique ID. @@ -72,7 +72,7 @@ func (srv *Users) GetUserPrefs(UserId string) (map[string]interface{}, error) { params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // UpdateUserPrefs update user preferences by its unique ID. You can pass only @@ -85,7 +85,7 @@ func (srv *Users) UpdateUserPrefs(UserId string, Prefs string) (map[string]inter "prefs": Prefs, } - return srv.Client.Call("PATCH", path, nil, params) + return srv.client.Call("PATCH", path, nil, params) } // GetUserSessions get user sessions list by its unique ID. @@ -96,7 +96,7 @@ func (srv *Users) GetUserSessions(UserId string) (map[string]interface{}, error) params := map[string]interface{}{ } - return srv.Client.Call("GET", path, nil, params) + return srv.client.Call("GET", path, nil, params) } // DeleteUserSessions delete all user sessions by its unique ID. @@ -107,7 +107,7 @@ func (srv *Users) DeleteUserSessions(UserId string) (map[string]interface{}, err params := map[string]interface{}{ } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } // DeleteUserSession delete user sessions by its unique ID. @@ -119,7 +119,7 @@ func (srv *Users) DeleteUserSession(UserId string, SessionId string) (map[string "sessionId": SessionId, } - return srv.Client.Call("DELETE", path, nil, params) + return srv.client.Call("DELETE", path, nil, params) } // UpdateUserStatus update user status by its unique ID. @@ -131,5 +131,5 @@ func (srv *Users) UpdateUserStatus(UserId string, Status string) (map[string]int "status": Status, } - return srv.Client.Call("PATCH", path, nil, params) + return srv.client.Call("PATCH", path, nil, params) } diff --git a/composer.lock b/composer.lock index 2ece8e9ed..e0ebc2a80 100644 --- a/composer.lock +++ b/composer.lock @@ -1526,7 +1526,7 @@ "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator", - "reference": "590cd29f649869dcbe431c5784bd1483f195e2ec" + "reference": "4d6189abf1fa793556f4f9177c83058b35750fe1" }, "require": { "ext-curl": "*", @@ -1556,7 +1556,7 @@ } ], "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", - "time": "2020-01-28T20:57:54+00:00" + "time": "2020-01-28T22:54:26+00:00" }, { "name": "doctrine/instantiator",