From 2efdc8060737411db7f798e692df8506e9f13cf0 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Thu, 31 Aug 2023 22:05:03 +0000 Subject: [PATCH] fix: patch updates for appwrite 1.4.1 --- appwrite.gemspec | 2 +- lib/appwrite/client.rb | 6 +- lib/appwrite/role.rb | 56 +++++ lib/appwrite/services/account.rb | 176 +++++++-------- lib/appwrite/services/avatars.rb | 56 ++--- lib/appwrite/services/databases.rb | 336 ++++++++++++++--------------- lib/appwrite/services/functions.rb | 168 +++++++-------- lib/appwrite/services/graphql.rb | 16 +- lib/appwrite/services/health.rb | 96 ++++----- lib/appwrite/services/locale.rb | 64 +++--- lib/appwrite/services/storage.rb | 104 ++++----- lib/appwrite/services/teams.rb | 104 ++++----- lib/appwrite/services/users.rb | 224 +++++++++---------- 13 files changed, 732 insertions(+), 676 deletions(-) diff --git a/appwrite.gemspec b/appwrite.gemspec index 2945265..480bebc 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '9.0.0' + spec.version = '9.0.1' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index bc8659e..77bea22 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -15,7 +15,7 @@ def initialize 'x-sdk-name'=> 'Ruby', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'ruby', - 'x-sdk-version'=> '9.0.0', + 'x-sdk-version'=> '9.0.1', 'X-Appwrite-Response-Format' => '1.4.0' } @endpoint = 'https://HOSTNAME/v1' @@ -170,7 +170,7 @@ def chunked_upload( params: {} ) chunks_uploaded = current['chunksUploaded'].to_i - offset = [size, (chunks_uploaded * @chunk_size)].min + offset = chunks_uploaded * @chunk_size end while offset < size @@ -187,7 +187,7 @@ def chunked_upload( mime_type: input_file.mime_type ) - headers['content-range'] = "bytes #{offset}-#{[offset + @chunk_size - 1, size].min}/#{size}" + headers['content-range'] = "bytes #{offset}-#{[offset + @chunk_size - 1, size - 1].min}/#{size}" result = call( method: 'POST', diff --git a/lib/appwrite/role.rb b/lib/appwrite/role.rb index 353410c..ec17154 100644 --- a/lib/appwrite/role.rb +++ b/lib/appwrite/role.rb @@ -1,9 +1,26 @@ module Appwrite + + # Helper class to generate role strings for `Permission`. class Role + + # Grants access to anyone. + # + # This includes authenticated and unauthenticated users. + # + # @return [String] def self.any 'any' end + # Grants access to a specific user by user ID. + # + # You can optionally pass verified or unverified for + # `status` to target specific types of users. + # + # @param [String] id + # @param [String] status + # + # @return [String] def self.user(id, status = "") if(status.empty?) "user:#{id}" @@ -12,6 +29,14 @@ def self.user(id, status = "") end end + # Grants access to any authenticated or anonymous user. + # + # You can optionally pass verified or unverified for + # `status` to target specific types of users. + # + # @param [String] status + # + # @return [String] def self.users(status = "") if(status.empty?) 'users' @@ -20,10 +45,24 @@ def self.users(status = "") end end + # Grants access to any guest user without a session. + # + # Authenticated users don't have access to this role. + # + # @return [String] def self.guests 'guests' end + # Grants access to a team by team ID. + # + # You can optionally pass a role for `role` to target + # team members with the specified role. + # + # @param [String] id + # @param [String] role + # + # @return [String] def self.team(id, role = "") if(role.empty?) "team:#{id}" @@ -32,8 +71,25 @@ def self.team(id, role = "") end end + # Grants access to a specific member of a team. + # + # When the member is removed from the team, they will + # no longer have access. + # + # @param [String] id + # + # @return [String] def self.member(id) "member:#{id}" end + + # Grants access to a user with the specified label. + # + # @param [String] name + # + # @return [String] + def self.label(name) + "label:#{name}" + end end end \ No newline at end of file diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index 1d0aae6..466842a 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -14,18 +14,18 @@ def initialize(client) def get() api_path = '/account' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -55,20 +55,20 @@ def update_email(email:, password:) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { email: email, password: password, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -82,19 +82,19 @@ def update_email(email:, password:) def list_identities(queries: nil) api_path = '/account/identities' - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::IdentityList ) end @@ -113,18 +113,18 @@ def delete_identity(identity_id:) raise Appwrite::Exception.new('Missing required parameter: "identityId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -138,19 +138,19 @@ def delete_identity(identity_id:) def list_logs(queries: nil) api_path = '/account/logs' - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::LogList ) end @@ -168,19 +168,19 @@ def update_name(name:) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -201,20 +201,20 @@ def update_password(password:, old_password: nil) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { password: password, oldPassword: old_password, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -241,20 +241,20 @@ def update_phone(phone:, password:) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { phone: phone, password: password, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -267,18 +267,18 @@ def update_phone(phone:, password:) def get_prefs() api_path = '/account/prefs' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Preferences ) end @@ -298,19 +298,19 @@ def update_prefs(prefs:) raise Appwrite::Exception.new('Missing required parameter: "prefs"') end - params = { + api_params = { prefs: prefs, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -340,20 +340,20 @@ def create_recovery(email:, url:) raise Appwrite::Exception.new('Missing required parameter: "url"') end - params = { + api_params = { email: email, url: url, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end @@ -394,22 +394,22 @@ def update_recovery(user_id:, secret:, password:, password_again:) raise Appwrite::Exception.new('Missing required parameter: "passwordAgain"') end - params = { + api_params = { userId: user_id, secret: secret, password: password, passwordAgain: password_again, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end @@ -423,18 +423,18 @@ def update_recovery(user_id:, secret:, password:, password_again:) def list_sessions() api_path = '/account/sessions' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::SessionList ) end @@ -448,18 +448,18 @@ def list_sessions() def delete_sessions() api_path = '/account/sessions' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -478,18 +478,18 @@ def get_session(session_id:) raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Session ) end @@ -510,18 +510,18 @@ def update_session(session_id:) raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Session ) end @@ -543,18 +543,18 @@ def delete_session(session_id:) raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -568,18 +568,18 @@ def delete_session(session_id:) def update_status() api_path = '/account/status' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -611,19 +611,19 @@ def create_verification(url:) raise Appwrite::Exception.new('Missing required parameter: "url"') end - params = { + api_params = { url: url, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end @@ -649,20 +649,20 @@ def update_verification(user_id:, secret:) raise Appwrite::Exception.new('Missing required parameter: "secret"') end - params = { + api_params = { userId: user_id, secret: secret, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end @@ -680,18 +680,18 @@ def update_verification(user_id:, secret:) def create_phone_verification() api_path = '/account/verification/phone' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end @@ -717,20 +717,20 @@ def update_phone_verification(user_id:, secret:) raise Appwrite::Exception.new('Missing required parameter: "secret"') end - params = { + api_params = { userId: user_id, secret: secret, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Token ) end diff --git a/lib/appwrite/services/avatars.rb b/lib/appwrite/services/avatars.rb index 5407546..266c84f 100644 --- a/lib/appwrite/services/avatars.rb +++ b/lib/appwrite/services/avatars.rb @@ -31,21 +31,21 @@ def get_browser(code:, width: nil, height: nil, quality: nil) raise Appwrite::Exception.new('Missing required parameter: "code"') end - params = { + api_params = { width: width, height: height, quality: quality, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -74,21 +74,21 @@ def get_credit_card(code:, width: nil, height: nil, quality: nil) raise Appwrite::Exception.new('Missing required parameter: "code"') end - params = { + api_params = { width: width, height: height, quality: quality, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -107,19 +107,19 @@ def get_favicon(url:) raise Appwrite::Exception.new('Missing required parameter: "url"') end - params = { + api_params = { url: url, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -149,21 +149,21 @@ def get_flag(code:, width: nil, height: nil, quality: nil) raise Appwrite::Exception.new('Missing required parameter: "code"') end - params = { + api_params = { width: width, height: height, quality: quality, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -191,21 +191,21 @@ def get_image(url:, width: nil, height: nil) raise Appwrite::Exception.new('Missing required parameter: "url"') end - params = { + api_params = { url: url, width: width, height: height, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -236,22 +236,22 @@ def get_image(url:, width: nil, height: nil) def get_initials(name: nil, width: nil, height: nil, background: nil) api_path = '/avatars/initials' - params = { + api_params = { name: name, width: width, height: height, background: background, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -273,22 +273,22 @@ def get_qr(text:, size: nil, margin: nil, download: nil) raise Appwrite::Exception.new('Missing required parameter: "text"') end - params = { + api_params = { text: text, size: size, margin: margin, download: download, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end diff --git a/lib/appwrite/services/databases.rb b/lib/appwrite/services/databases.rb index 6824531..289b1cf 100644 --- a/lib/appwrite/services/databases.rb +++ b/lib/appwrite/services/databases.rb @@ -17,20 +17,20 @@ def initialize(client) def list(queries: nil, search: nil) api_path = '/databases' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::DatabaseList ) end @@ -55,21 +55,21 @@ def create(database_id:, name:, enabled: nil) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { databaseId: database_id, name: name, enabled: enabled, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Database ) end @@ -89,18 +89,18 @@ def get(database_id:) raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Database ) end @@ -125,20 +125,20 @@ def update(database_id:, name:, enabled: nil) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, enabled: enabled, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Database ) end @@ -158,18 +158,18 @@ def delete(database_id:) raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -190,20 +190,20 @@ def list_collections(database_id:, queries: nil, search: nil) raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::CollectionList ) end @@ -238,7 +238,7 @@ def create_collection(database_id:, collection_id:, name:, permissions: nil, doc raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { collectionId: collection_id, name: name, permissions: permissions, @@ -246,15 +246,15 @@ def create_collection(database_id:, collection_id:, name:, permissions: nil, doc enabled: enabled, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Collection ) end @@ -280,18 +280,18 @@ def get_collection(database_id:, collection_id:) raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Collection ) end @@ -324,22 +324,22 @@ def update_collection(database_id:, collection_id:, name:, permissions: nil, doc raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, permissions: permissions, documentSecurity: document_security, enabled: enabled, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Collection ) end @@ -365,18 +365,18 @@ def delete_collection(database_id:, collection_id:) raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -401,19 +401,19 @@ def list_attributes(database_id:, collection_id:, queries: nil) raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeList ) end @@ -451,22 +451,22 @@ def create_boolean_attribute(database_id:, collection_id:, key:, required:, defa raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, default: default, array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeBoolean ) end @@ -507,20 +507,20 @@ def update_boolean_attribute(database_id:, collection_id:, key:, required:, defa raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeBoolean ) end @@ -557,22 +557,22 @@ def create_datetime_attribute(database_id:, collection_id:, key:, required:, def raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, default: default, array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeDatetime ) end @@ -613,20 +613,20 @@ def update_datetime_attribute(database_id:, collection_id:, key:, required:, def raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeDatetime ) end @@ -664,22 +664,22 @@ def create_email_attribute(database_id:, collection_id:, key:, required:, defaul raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, default: default, array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeEmail ) end @@ -722,20 +722,20 @@ def update_email_attribute(database_id:, collection_id:, key:, required:, defaul raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeEmail ) end @@ -777,7 +777,7 @@ def create_enum_attribute(database_id:, collection_id:, key:, elements:, require raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, elements: elements, required: required, @@ -785,15 +785,15 @@ def create_enum_attribute(database_id:, collection_id:, key:, elements:, require array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeEnum ) end @@ -841,21 +841,21 @@ def update_enum_attribute(database_id:, collection_id:, key:, elements:, require raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { elements: elements, required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeEnum ) end @@ -896,7 +896,7 @@ def create_float_attribute(database_id:, collection_id:, key:, required:, min: n raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, min: min, @@ -905,15 +905,15 @@ def create_float_attribute(database_id:, collection_id:, key:, required:, min: n array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeFloat ) end @@ -966,22 +966,22 @@ def update_float_attribute(database_id:, collection_id:, key:, required:, min:, raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, min: min, max: max, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeFloat ) end @@ -1022,7 +1022,7 @@ def create_integer_attribute(database_id:, collection_id:, key:, required:, min: raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, min: min, @@ -1031,15 +1031,15 @@ def create_integer_attribute(database_id:, collection_id:, key:, required:, min: array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeInteger ) end @@ -1092,22 +1092,22 @@ def update_integer_attribute(database_id:, collection_id:, key:, required:, min: raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, min: min, max: max, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeInteger ) end @@ -1145,22 +1145,22 @@ def create_ip_attribute(database_id:, collection_id:, key:, required:, default: raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, default: default, array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeIp ) end @@ -1203,20 +1203,20 @@ def update_ip_attribute(database_id:, collection_id:, key:, required:, default:) raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeIp ) end @@ -1257,7 +1257,7 @@ def create_relationship_attribute(database_id:, collection_id:, related_collecti raise Appwrite::Exception.new('Missing required parameter: "type"') end - params = { + api_params = { relatedCollectionId: related_collection_id, type: type, twoWay: two_way, @@ -1266,15 +1266,15 @@ def create_relationship_attribute(database_id:, collection_id:, related_collecti onDelete: on_delete, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeRelationship ) end @@ -1318,7 +1318,7 @@ def create_string_attribute(database_id:, collection_id:, key:, size:, required: raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, size: size, required: required, @@ -1327,15 +1327,15 @@ def create_string_attribute(database_id:, collection_id:, key:, size:, required: encrypt: encrypt, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeString ) end @@ -1378,20 +1378,20 @@ def update_string_attribute(database_id:, collection_id:, key:, required:, defau raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeString ) end @@ -1429,22 +1429,22 @@ def create_url_attribute(database_id:, collection_id:, key:, required:, default: raise Appwrite::Exception.new('Missing required parameter: "required"') end - params = { + api_params = { key: key, required: required, default: default, array: array, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeUrl ) end @@ -1487,20 +1487,20 @@ def update_url_attribute(database_id:, collection_id:, key:, required:, default: raise Appwrite::Exception.new('Missing required parameter: "default"') end - params = { + api_params = { required: required, default: default, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeUrl ) end @@ -1531,18 +1531,18 @@ def get_attribute(database_id:, collection_id:, key:) raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -1572,18 +1572,18 @@ def delete_attribute(database_id:, collection_id:, key:) raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -1616,19 +1616,19 @@ def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { onDelete: on_delete, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::AttributeRelationship ) end @@ -1655,19 +1655,19 @@ def list_documents(database_id:, collection_id:, queries: nil) raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::DocumentList ) end @@ -1706,21 +1706,21 @@ def create_document(database_id:, collection_id:, document_id:, data:, permissio raise Appwrite::Exception.new('Missing required parameter: "data"') end - params = { + api_params = { documentId: document_id, data: data, permissions: permissions, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Document ) end @@ -1753,19 +1753,19 @@ def get_document(database_id:, collection_id:, document_id:, queries: nil) raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Document ) end @@ -1799,20 +1799,20 @@ def update_document(database_id:, collection_id:, document_id:, data: nil, permi raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - params = { + api_params = { data: data, permissions: permissions, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Document ) end @@ -1843,18 +1843,18 @@ def delete_document(database_id:, collection_id:, document_id:) raise Appwrite::Exception.new('Missing required parameter: "documentId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -1879,19 +1879,19 @@ def list_indexes(database_id:, collection_id:, queries: nil) raise Appwrite::Exception.new('Missing required parameter: "collectionId"') end - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::IndexList ) end @@ -1932,22 +1932,22 @@ def create_index(database_id:, collection_id:, key:, type:, attributes:, orders: raise Appwrite::Exception.new('Missing required parameter: "attributes"') end - params = { + api_params = { key: key, type: type, attributes: attributes, orders: orders, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Index ) end @@ -1978,18 +1978,18 @@ def get_index(database_id:, collection_id:, key:) raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Index ) end @@ -2020,18 +2020,18 @@ def delete_index(database_id:, collection_id:, key:) raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index d0a17b0..0c87c67 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -17,20 +17,20 @@ def initialize(client) def list(queries: nil, search: nil) api_path = '/functions' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::FunctionList ) end @@ -77,7 +77,7 @@ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n raise Appwrite::Exception.new('Missing required parameter: "runtime"') end - params = { + api_params = { functionId: function_id, name: name, runtime: runtime, @@ -100,15 +100,15 @@ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n templateBranch: template_branch, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Function ) end @@ -121,18 +121,18 @@ def create(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n def list_runtimes() api_path = '/functions/runtimes' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::RuntimeList ) end @@ -151,18 +151,18 @@ def get(function_id:) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Function ) end @@ -204,7 +204,7 @@ def update(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n raise Appwrite::Exception.new('Missing required parameter: "runtime"') end - params = { + api_params = { name: name, runtime: runtime, execute: execute, @@ -222,15 +222,15 @@ def update(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n providerRootDirectory: provider_root_directory, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Function ) end @@ -249,18 +249,18 @@ def delete(function_id:) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -281,20 +281,20 @@ def list_deployments(function_id:, queries: nil, search: nil) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::DeploymentList ) end @@ -334,14 +334,14 @@ def create_deployment(function_id:, code:, activate:, entrypoint: nil, commands: raise Appwrite::Exception.new('Missing required parameter: "activate"') end - params = { + api_params = { entrypoint: entrypoint, commands: commands, code: code, activate: activate, } - headers = { + api_headers = { "content-type": 'multipart/form-data', } @@ -350,8 +350,8 @@ def create_deployment(function_id:, code:, activate:, entrypoint: nil, commands: @client.chunked_upload( path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, param_name: param_name, id_param_name: id_param_name, on_progress: on_progress, @@ -379,18 +379,18 @@ def get_deployment(function_id:, deployment_id:) raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Deployment ) end @@ -417,18 +417,18 @@ def update_deployment(function_id:, deployment_id:) raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Function ) end @@ -453,18 +453,18 @@ def delete_deployment(function_id:, deployment_id:) raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -495,18 +495,18 @@ def create_build(function_id:, deployment_id:, build_id:) raise Appwrite::Exception.new('Missing required parameter: "buildId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -530,18 +530,18 @@ def download_deployment(function_id:, deployment_id:) raise Appwrite::Exception.new('Missing required parameter: "deploymentId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -562,20 +562,20 @@ def list_executions(function_id:, queries: nil, search: nil) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::ExecutionList ) end @@ -602,7 +602,7 @@ def create_execution(function_id:, body: nil, async: nil, xpath: nil, method: ni raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { body: body, async: async, path: xpath, @@ -610,15 +610,15 @@ def create_execution(function_id:, body: nil, async: nil, xpath: nil, method: ni headers: headers, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Execution ) end @@ -643,18 +643,18 @@ def get_execution(function_id:, execution_id:) raise Appwrite::Exception.new('Missing required parameter: "executionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Execution ) end @@ -673,18 +673,18 @@ def list_variables(function_id:) raise Appwrite::Exception.new('Missing required parameter: "functionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::VariableList ) end @@ -714,20 +714,20 @@ def create_variable(function_id:, key:, value:) raise Appwrite::Exception.new('Missing required parameter: "value"') end - params = { + api_params = { key: key, value: value, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Variable ) end @@ -752,18 +752,18 @@ def get_variable(function_id:, variable_id:) raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Variable ) end @@ -794,20 +794,20 @@ def update_variable(function_id:, variable_id:, key:, value: nil) raise Appwrite::Exception.new('Missing required parameter: "key"') end - params = { + api_params = { key: key, value: value, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Variable ) end @@ -832,18 +832,18 @@ def delete_variable(function_id:, variable_id:) raise Appwrite::Exception.new('Missing required parameter: "variableId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end diff --git a/lib/appwrite/services/graphql.rb b/lib/appwrite/services/graphql.rb index c770cbd..b9db9a0 100644 --- a/lib/appwrite/services/graphql.rb +++ b/lib/appwrite/services/graphql.rb @@ -19,11 +19,11 @@ def query(query:) raise Appwrite::Exception.new('Missing required parameter: "query"') end - params = { + api_params = { query: query, } - headers = { + api_headers = { "x-sdk-graphql": 'true', "content-type": 'application/json', } @@ -31,8 +31,8 @@ def query(query:) @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -49,11 +49,11 @@ def mutation(query:) raise Appwrite::Exception.new('Missing required parameter: "query"') end - params = { + api_params = { query: query, } - headers = { + api_headers = { "x-sdk-graphql": 'true', "content-type": 'application/json', } @@ -61,8 +61,8 @@ def mutation(query:) @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end diff --git a/lib/appwrite/services/health.rb b/lib/appwrite/services/health.rb index 9793426..9d8d66a 100644 --- a/lib/appwrite/services/health.rb +++ b/lib/appwrite/services/health.rb @@ -14,18 +14,18 @@ def initialize(client) def get() api_path = '/health' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -38,18 +38,18 @@ def get() def get_antivirus() api_path = '/health/anti-virus' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthAntivirus ) end @@ -63,18 +63,18 @@ def get_antivirus() def get_cache() api_path = '/health/cache' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -87,18 +87,18 @@ def get_cache() def get_db() api_path = '/health/db' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -111,18 +111,18 @@ def get_db() def get_pub_sub() api_path = '/health/pubsub' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -136,18 +136,18 @@ def get_pub_sub() def get_queue() api_path = '/health/queue' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -162,18 +162,18 @@ def get_queue() def get_queue_certificates() api_path = '/health/queue/certificates' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthQueue ) end @@ -186,18 +186,18 @@ def get_queue_certificates() def get_queue_functions() api_path = '/health/queue/functions' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthQueue ) end @@ -211,18 +211,18 @@ def get_queue_functions() def get_queue_logs() api_path = '/health/queue/logs' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthQueue ) end @@ -236,18 +236,18 @@ def get_queue_logs() def get_queue_webhooks() api_path = '/health/queue/webhooks' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthQueue ) end @@ -260,18 +260,18 @@ def get_queue_webhooks() def get_storage_local() api_path = '/health/storage/local' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthStatus ) end @@ -290,18 +290,18 @@ def get_storage_local() def get_time() api_path = '/health/time' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::HealthTime ) end diff --git a/lib/appwrite/services/locale.rb b/lib/appwrite/services/locale.rb index 2ea4d34..0d181a9 100644 --- a/lib/appwrite/services/locale.rb +++ b/lib/appwrite/services/locale.rb @@ -19,18 +19,18 @@ def initialize(client) def get() api_path = '/locale' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Locale ) end @@ -44,18 +44,18 @@ def get() def list_codes() api_path = '/locale/codes' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::LocaleCodeList ) end @@ -69,18 +69,18 @@ def list_codes() def list_continents() api_path = '/locale/continents' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::ContinentList ) end @@ -94,18 +94,18 @@ def list_continents() def list_countries() api_path = '/locale/countries' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::CountryList ) end @@ -119,18 +119,18 @@ def list_countries() def list_countries_eu() api_path = '/locale/countries/eu' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::CountryList ) end @@ -144,18 +144,18 @@ def list_countries_eu() def list_countries_phones() api_path = '/locale/countries/phones' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::PhoneList ) end @@ -170,18 +170,18 @@ def list_countries_phones() def list_currencies() api_path = '/locale/currencies' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::CurrencyList ) end @@ -195,18 +195,18 @@ def list_currencies() def list_languages() api_path = '/locale/languages' - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::LanguageList ) end diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index c298a8e..34d828d 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -17,20 +17,20 @@ def initialize(client) def list_buckets(queries: nil, search: nil) api_path = '/storage/buckets' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::BucketList ) end @@ -61,7 +61,7 @@ def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { bucketId: bucket_id, name: name, permissions: permissions, @@ -74,15 +74,15 @@ def create_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl antivirus: antivirus, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Bucket ) end @@ -102,18 +102,18 @@ def get_bucket(bucket_id:) raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Bucket ) end @@ -145,7 +145,7 @@ def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, permissions: permissions, fileSecurity: file_security, @@ -157,15 +157,15 @@ def update_bucket(bucket_id:, name:, permissions: nil, file_security: nil, enabl antivirus: antivirus, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Bucket ) end @@ -184,18 +184,18 @@ def delete_bucket(bucket_id:) raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -216,20 +216,20 @@ def list_files(bucket_id:, queries: nil, search: nil) raise Appwrite::Exception.new('Missing required parameter: "bucketId"') end - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::FileList ) end @@ -276,13 +276,13 @@ def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil) raise Appwrite::Exception.new('Missing required parameter: "file"') end - params = { + api_params = { fileId: file_id, file: file, permissions: permissions, } - headers = { + api_headers = { "content-type": 'multipart/form-data', } @@ -291,8 +291,8 @@ def create_file(bucket_id:, file_id:, file:, permissions: nil, on_progress: nil) @client.chunked_upload( path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, param_name: param_name, id_param_name: id_param_name, on_progress: on_progress, @@ -321,18 +321,18 @@ def get_file(bucket_id:, file_id:) raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::File ) end @@ -360,20 +360,20 @@ def update_file(bucket_id:, file_id:, name: nil, permissions: nil) raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { name: name, permissions: permissions, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::File ) end @@ -399,18 +399,18 @@ def delete_file(bucket_id:, file_id:) raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -436,18 +436,18 @@ def get_file_download(bucket_id:, file_id:) raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -486,7 +486,7 @@ def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { width: width, height: height, gravity: gravity, @@ -500,15 +500,15 @@ def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil output: output, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -534,18 +534,18 @@ def get_file_view(bucket_id:, file_id:) raise Appwrite::Exception.new('Missing required parameter: "fileId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end diff --git a/lib/appwrite/services/teams.rb b/lib/appwrite/services/teams.rb index 46c6455..31c1cc8 100644 --- a/lib/appwrite/services/teams.rb +++ b/lib/appwrite/services/teams.rb @@ -17,20 +17,20 @@ def initialize(client) def list(queries: nil, search: nil) api_path = '/teams' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::TeamList ) end @@ -56,21 +56,21 @@ def create(team_id:, name:, roles: nil) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { teamId: team_id, name: name, roles: roles, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Team ) end @@ -89,18 +89,18 @@ def get(team_id:) raise Appwrite::Exception.new('Missing required parameter: "teamId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Team ) end @@ -124,19 +124,19 @@ def update_name(team_id:, name:) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Team ) end @@ -156,18 +156,18 @@ def delete(team_id:) raise Appwrite::Exception.new('Missing required parameter: "teamId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -188,20 +188,20 @@ def list_memberships(team_id:, queries: nil, search: nil) raise Appwrite::Exception.new('Missing required parameter: "teamId"') end - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::MembershipList ) end @@ -254,7 +254,7 @@ def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: n raise Appwrite::Exception.new('Missing required parameter: "url"') end - params = { + api_params = { email: email, userId: user_id, phone: phone, @@ -263,15 +263,15 @@ def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: n name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Membership ) end @@ -297,18 +297,18 @@ def get_membership(team_id:, membership_id:) raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Membership ) end @@ -341,19 +341,19 @@ def update_membership(team_id:, membership_id:, roles:) raise Appwrite::Exception.new('Missing required parameter: "roles"') end - params = { + api_params = { roles: roles, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Membership ) end @@ -380,18 +380,18 @@ def delete_membership(team_id:, membership_id:) raise Appwrite::Exception.new('Missing required parameter: "membershipId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -431,20 +431,20 @@ def update_membership_status(team_id:, membership_id:, user_id:, secret:) raise Appwrite::Exception.new('Missing required parameter: "secret"') end - params = { + api_params = { userId: user_id, secret: secret, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Membership ) end @@ -465,18 +465,18 @@ def get_prefs(team_id:) raise Appwrite::Exception.new('Missing required parameter: "teamId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Preferences ) end @@ -502,19 +502,19 @@ def update_prefs(team_id:, prefs:) raise Appwrite::Exception.new('Missing required parameter: "prefs"') end - params = { + api_params = { prefs: prefs, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Preferences ) end diff --git a/lib/appwrite/services/users.rb b/lib/appwrite/services/users.rb index 433bd59..e5d00b0 100644 --- a/lib/appwrite/services/users.rb +++ b/lib/appwrite/services/users.rb @@ -17,20 +17,20 @@ def initialize(client) def list(queries: nil, search: nil) api_path = '/users' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::UserList ) end @@ -52,7 +52,7 @@ def create(user_id:, email: nil, phone: nil, password: nil, name: nil) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { userId: user_id, email: email, phone: phone, @@ -60,15 +60,15 @@ def create(user_id:, email: nil, phone: nil, password: nil, name: nil) name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -100,22 +100,22 @@ def create_argon2_user(user_id:, email:, password:, name: nil) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { userId: user_id, email: email, password: password, name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -147,22 +147,22 @@ def create_bcrypt_user(user_id:, email:, password:, name: nil) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { userId: user_id, email: email, password: password, name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -177,20 +177,20 @@ def create_bcrypt_user(user_id:, email:, password:, name: nil) def list_identities(queries: nil, search: nil) api_path = '/users/identities' - params = { + api_params = { queries: queries, search: search, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::IdentityList ) end @@ -209,18 +209,18 @@ def delete_identity(identity_id:) raise Appwrite::Exception.new('Missing required parameter: "identityId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -251,22 +251,22 @@ def create_md5_user(user_id:, email:, password:, name: nil) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { userId: user_id, email: email, password: password, name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -298,22 +298,22 @@ def create_ph_pass_user(user_id:, email:, password:, name: nil) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { userId: user_id, email: email, password: password, name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -370,7 +370,7 @@ def create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu raise Appwrite::Exception.new('Missing required parameter: "passwordLength"') end - params = { + api_params = { userId: user_id, email: email, password: password, @@ -382,15 +382,15 @@ def create_scrypt_user(user_id:, email:, password:, password_salt:, password_cpu name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -437,7 +437,7 @@ def create_scrypt_modified_user(user_id:, email:, password:, password_salt:, pas raise Appwrite::Exception.new('Missing required parameter: "passwordSignerKey"') end - params = { + api_params = { userId: user_id, email: email, password: password, @@ -447,15 +447,15 @@ def create_scrypt_modified_user(user_id:, email:, password:, password_salt:, pas name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -488,7 +488,7 @@ def create_sha_user(user_id:, email:, password:, password_version: nil, name: ni raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { userId: user_id, email: email, password: password, @@ -496,15 +496,15 @@ def create_sha_user(user_id:, email:, password:, password_version: nil, name: ni name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'POST', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -523,18 +523,18 @@ def get(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -557,18 +557,18 @@ def delete(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -591,19 +591,19 @@ def update_email(user_id:, email:) raise Appwrite::Exception.new('Missing required parameter: "email"') end - params = { + api_params = { email: email, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -632,19 +632,19 @@ def update_labels(user_id:, labels:) raise Appwrite::Exception.new('Missing required parameter: "labels"') end - params = { + api_params = { labels: labels, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PUT', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -664,19 +664,19 @@ def list_logs(user_id:, queries: nil) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { queries: queries, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::LogList ) end @@ -695,18 +695,18 @@ def list_memberships(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::MembershipList ) end @@ -730,19 +730,19 @@ def update_name(user_id:, name:) raise Appwrite::Exception.new('Missing required parameter: "name"') end - params = { + api_params = { name: name, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -766,19 +766,19 @@ def update_password(user_id:, password:) raise Appwrite::Exception.new('Missing required parameter: "password"') end - params = { + api_params = { password: password, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -802,19 +802,19 @@ def update_phone(user_id:, number:) raise Appwrite::Exception.new('Missing required parameter: "number"') end - params = { + api_params = { number: number, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -833,18 +833,18 @@ def get_prefs(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Preferences ) end @@ -870,19 +870,19 @@ def update_prefs(user_id:, prefs:) raise Appwrite::Exception.new('Missing required parameter: "prefs"') end - params = { + api_params = { prefs: prefs, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::Preferences ) end @@ -901,18 +901,18 @@ def list_sessions(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'GET', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::SessionList ) end @@ -931,18 +931,18 @@ def delete_sessions(user_id:) raise Appwrite::Exception.new('Missing required parameter: "userId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -966,18 +966,18 @@ def delete_session(user_id:, session_id:) raise Appwrite::Exception.new('Missing required parameter: "sessionId"') end - params = { + api_params = { } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'DELETE', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, ) end @@ -1001,19 +1001,19 @@ def update_status(user_id:, status:) raise Appwrite::Exception.new('Missing required parameter: "status"') end - params = { + api_params = { status: status, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -1037,19 +1037,19 @@ def update_email_verification(user_id:, email_verification:) raise Appwrite::Exception.new('Missing required parameter: "emailVerification"') end - params = { + api_params = { emailVerification: email_verification, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end @@ -1073,19 +1073,19 @@ def update_phone_verification(user_id:, phone_verification:) raise Appwrite::Exception.new('Missing required parameter: "phoneVerification"') end - params = { + api_params = { phoneVerification: phone_verification, } - headers = { + api_headers = { "content-type": 'application/json', } @client.call( method: 'PATCH', path: api_path, - headers: headers, - params: params, + headers: api_headers, + params: api_params, response_type: Models::User ) end