diff --git a/README.md b/README.md index 70281c0..485cc7b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Ruby SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/appwrite.gemspec b/appwrite.gemspec index d1a8218..d5f6abc 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '14.0.0' + spec.version = '15.0.0' 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/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 4116d49..241a639 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -14,8 +14,8 @@ result = databases.update_float_attribute( collection_id: '', key: '', required: false, - min: null, - max: null, default: null, + min: null, # optional + max: null, # optional new_key: '' # optional ) diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 7bb8a19..15e3960 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -14,8 +14,8 @@ result = databases.update_integer_attribute( collection_id: '', key: '', required: false, - min: null, - max: null, default: null, + min: null, # optional + max: null, # optional new_key: '' # optional ) diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-stats-resources.md similarity index 87% rename from docs/examples/health/get-queue-usage-dump.md rename to docs/examples/health/get-queue-stats-resources.md index f8bf30b..9796195 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -9,6 +9,6 @@ client = Client.new health = Health.new(client) -result = health.get_queue_usage_dump( +result = health.get_queue_stats_resources( threshold: null # optional ) diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md deleted file mode 100644 index 936082a..0000000 --- a/docs/examples/health/get-queue.md +++ /dev/null @@ -1,12 +0,0 @@ -require 'appwrite' - -include Appwrite - -client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('') # Your project ID - .set_key('') # Your secret API key - -health = Health.new(client) - -result = health.get_queue() diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 5d33e01..1d2d567 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'=> '14.0.0', + 'x-sdk-version'=> '15.0.0', 'X-Appwrite-Response-Format' => '1.6.0' } @endpoint = 'https://cloud.appwrite.io/v1' @@ -103,6 +103,10 @@ def set_forwarded_user_agent(value) # # @return [self] def set_endpoint(endpoint) + if not endpoint.start_with?('http://') and not endpoint.start_with?('https://') + raise Appwrite::Exception.new('Invalid endpoint URL: ' + endpoint) + end + @endpoint = endpoint self @@ -303,11 +307,11 @@ def fetch( begin result = JSON.parse(response.body) rescue JSON::ParserError => e - raise Appwrite::Exception.new(response.body, response.code, nil, response) + raise Appwrite::Exception.new(response.body, response.code, nil, response.body) end if response.code.to_i >= 400 - raise Appwrite::Exception.new(result['message'], result['status'], result['type'], result) + raise Appwrite::Exception.new(result['message'], result['status'], result['type'], response.body) end unless response_type.respond_to?("from") @@ -318,7 +322,7 @@ def fetch( end if response.code.to_i >= 400 - raise Appwrite::Exception.new(response.body, response.code, response) + raise Appwrite::Exception.new(response.body, response.code, response, response.body) end if response.respond_to?("body_permitted?") diff --git a/lib/appwrite/enums/credit_card.rb b/lib/appwrite/enums/credit_card.rb index 931ae9c..f820982 100644 --- a/lib/appwrite/enums/credit_card.rb +++ b/lib/appwrite/enums/credit_card.rb @@ -17,6 +17,7 @@ module CreditCard VISA = 'visa' MIR = 'mir' MAESTRO = 'maestro' + RUPAY = 'rupay' end end end \ No newline at end of file diff --git a/lib/appwrite/enums/name.rb b/lib/appwrite/enums/name.rb index 94cf701..0e18cbb 100644 --- a/lib/appwrite/enums/name.rb +++ b/lib/appwrite/enums/name.rb @@ -6,8 +6,8 @@ module Name V1_AUDITS = 'v1-audits' V1_MAILS = 'v1-mails' V1_FUNCTIONS = 'v1-functions' - V1_USAGE = 'v1-usage' - V1_USAGE_DUMP = 'v1-usage-dump' + V1_STATS_RESOURCES = 'v1-stats-resources' + V1_STATS_USAGE = 'v1-stats-usage' V1_WEBHOOKS = 'v1-webhooks' V1_CERTIFICATES = 'v1-certificates' V1_BUILDS = 'v1-builds' diff --git a/lib/appwrite/enums/o_auth_provider.rb b/lib/appwrite/enums/o_auth_provider.rb index b23864e..8621b65 100644 --- a/lib/appwrite/enums/o_auth_provider.rb +++ b/lib/appwrite/enums/o_auth_provider.rb @@ -15,6 +15,7 @@ module OAuthProvider DROPBOX = 'dropbox' ETSY = 'etsy' FACEBOOK = 'facebook' + FIGMA = 'figma' GITHUB = 'github' GITLAB = 'gitlab' GOOGLE = 'google' diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index a8bd816..2446c08 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -18,7 +18,6 @@ def get() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -137,7 +136,6 @@ def list_identities(queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -221,7 +219,6 @@ def list_logs(queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -447,7 +444,6 @@ def list_mfa_factors() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -474,7 +470,6 @@ def get_mfa_recovery_codes() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -657,7 +652,6 @@ def get_prefs() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -808,7 +802,6 @@ def list_sessions() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1048,7 +1041,6 @@ def get_session(session_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1267,7 +1259,7 @@ def create_magic_url_token(user_id:, email:, url: nil, phrase: nil) # about session # limits](https://appwrite.io/docs/authentication-security#limits). # - # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + # @param [OAuthProvider] provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. # @param [String] success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [String] failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. # @param [Array] scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -1288,7 +1280,6 @@ def create_o_auth2_token(provider:, success: nil, failure: nil, scopes: nil) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/avatars.rb b/lib/appwrite/services/avatars.rb index 60c3f68..404eebc 100644 --- a/lib/appwrite/services/avatars.rb +++ b/lib/appwrite/services/avatars.rb @@ -39,7 +39,6 @@ def get_browser(code:, width: nil, height: nil, quality: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -61,7 +60,7 @@ def get_browser(code:, width: nil, height: nil, quality: nil) # of image returned is 100x100px. # # - # @param [CreditCard] code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro. + # @param [CreditCard] code Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay. # @param [Integer] width Image width. Pass an integer between 0 to 2000. Defaults to 100. # @param [Integer] height Image height. Pass an integer between 0 to 2000. Defaults to 100. # @param [Integer] quality Image quality. Pass an integer between 0 to 100. Defaults to 100. @@ -82,7 +81,6 @@ def get_credit_card(code:, width: nil, height: nil, quality: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -114,7 +112,6 @@ def get_favicon(url:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -158,7 +155,6 @@ def get_flag(code:, width: nil, height: nil, quality: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -201,7 +197,6 @@ def get_image(url:, width: nil, height: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -247,7 +242,6 @@ def get_initials(name: nil, width: nil, height: nil, background: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -284,7 +278,6 @@ def get_qr(text:, size: nil, margin: nil, download: nil) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/databases.rb b/lib/appwrite/services/databases.rb index 27e0f13..d36db4a 100644 --- a/lib/appwrite/services/databases.rb +++ b/lib/appwrite/services/databases.rb @@ -23,7 +23,6 @@ def list(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -93,7 +92,6 @@ def get(database_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -196,7 +194,6 @@ def list_collections(database_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -284,7 +281,6 @@ def get_collection(database_id:, collection_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -406,7 +402,6 @@ def list_attributes(database_id:, collection_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -939,13 +934,13 @@ def create_float_attribute(database_id:, collection_id:, key:, required:, min: n # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). # @param [String] key Attribute Key. # @param [] required Is attribute required? + # @param [Float] default Default value for attribute when not provided. Cannot be set when attribute is required. # @param [Float] min Minimum value to enforce on new documents # @param [Float] max Maximum value to enforce on new documents - # @param [Float] default Default value for attribute when not provided. Cannot be set when attribute is required. # @param [String] new_key New attribute key. # # @return [AttributeFloat] - def update_float_attribute(database_id:, collection_id:, key:, required:, min:, max:, default:, new_key: nil) + def update_float_attribute(database_id:, collection_id:, key:, required:, default:, min: nil, max: nil, new_key: nil) api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}' .gsub('{databaseId}', database_id) .gsub('{collectionId}', collection_id) @@ -967,14 +962,6 @@ def update_float_attribute(database_id:, collection_id:, key:, required:, min:, raise Appwrite::Exception.new('Missing required parameter: "required"') end - if min.nil? - raise Appwrite::Exception.new('Missing required parameter: "min"') - end - - if max.nil? - raise Appwrite::Exception.new('Missing required parameter: "max"') - end - if default.nil? raise Appwrite::Exception.new('Missing required parameter: "default"') end @@ -1067,13 +1054,13 @@ def create_integer_attribute(database_id:, collection_id:, key:, required:, min: # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). # @param [String] key Attribute Key. # @param [] required Is attribute required? + # @param [Integer] default Default value for attribute when not provided. Cannot be set when attribute is required. # @param [Integer] min Minimum value to enforce on new documents # @param [Integer] max Maximum value to enforce on new documents - # @param [Integer] default Default value for attribute when not provided. Cannot be set when attribute is required. # @param [String] new_key New attribute key. # # @return [AttributeInteger] - def update_integer_attribute(database_id:, collection_id:, key:, required:, min:, max:, default:, new_key: nil) + def update_integer_attribute(database_id:, collection_id:, key:, required:, default:, min: nil, max: nil, new_key: nil) api_path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}' .gsub('{databaseId}', database_id) .gsub('{collectionId}', collection_id) @@ -1095,14 +1082,6 @@ def update_integer_attribute(database_id:, collection_id:, key:, required:, min: raise Appwrite::Exception.new('Missing required parameter: "required"') end - if min.nil? - raise Appwrite::Exception.new('Missing required parameter: "min"') - end - - if max.nil? - raise Appwrite::Exception.new('Missing required parameter: "max"') - end - if default.nil? raise Appwrite::Exception.new('Missing required parameter: "default"') end @@ -1559,7 +1538,6 @@ def get_attribute(database_id:, collection_id:, key:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1686,7 +1664,6 @@ def list_documents(database_id:, collection_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1703,6 +1680,7 @@ def list_documents(database_id:, collection_id:, queries: nil) # collection resource using either a [server # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) # API or directly from your database console. + # # # @param [String] database_id Database ID. # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. @@ -1784,7 +1762,6 @@ def get_document(database_id:, collection_id:, document_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1910,7 +1887,6 @@ def list_indexes(database_id:, collection_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -2010,7 +1986,6 @@ def get_index(database_id:, collection_id:, key:) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index 98c962a..69e17e0 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -23,7 +23,6 @@ def list(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -130,7 +129,6 @@ def list_runtimes() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -155,7 +153,6 @@ def list_specifications() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -185,7 +182,6 @@ def get(function_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -317,7 +313,6 @@ def list_deployments(function_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -413,7 +408,6 @@ def get_deployment(function_id:, deployment_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -604,7 +598,6 @@ def get_deployment_download(function_id:, deployment_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -638,7 +631,6 @@ def list_executions(function_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -719,7 +711,6 @@ def get_execution(function_id:, execution_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -785,7 +776,6 @@ def list_variables(function_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -864,7 +854,6 @@ def get_variable(function_id:, variable_id:) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/health.rb b/lib/appwrite/services/health.rb index 4415a13..b92717d 100644 --- a/lib/appwrite/services/health.rb +++ b/lib/appwrite/services/health.rb @@ -18,7 +18,6 @@ def get() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -42,7 +41,6 @@ def get_antivirus() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -67,7 +65,6 @@ def get_cache() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -93,7 +90,6 @@ def get_certificate(domain: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -117,7 +113,6 @@ def get_db() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -141,32 +136,6 @@ def get_pub_sub() } api_headers = { - "content-type": 'application/json', - } - - @client.call( - method: 'GET', - path: api_path, - headers: api_headers, - params: api_params, - response_type: Models::HealthStatus - ) - end - - - # Check the Appwrite queue messaging servers are up and connection is - # successful. - # - # - # @return [HealthStatus] - def get_queue() - api_path = '/health/queue' - - api_params = { - } - - api_headers = { - "content-type": 'application/json', } @client.call( @@ -193,7 +162,6 @@ def get_queue_builds(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -221,7 +189,6 @@ def get_queue_certificates(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -250,7 +217,6 @@ def get_queue_databases(name: nil, threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -277,7 +243,6 @@ def get_queue_deletes(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -310,7 +275,6 @@ def get_failed_jobs(name:, threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -337,7 +301,6 @@ def get_queue_functions(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -364,7 +327,6 @@ def get_queue_logs(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -391,7 +353,6 @@ def get_queue_mails(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -418,7 +379,6 @@ def get_queue_messaging(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -445,7 +405,6 @@ def get_queue_migrations(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -459,20 +418,19 @@ def get_queue_migrations(threshold: nil) # Get the number of metrics that are waiting to be processed in the Appwrite - # internal queue server. + # stats resources queue. # # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. # # @return [HealthQueue] - def get_queue_usage(threshold: nil) - api_path = '/health/queue/usage' + def get_queue_stats_resources(threshold: nil) + api_path = '/health/queue/stats-resources' api_params = { threshold: threshold, } api_headers = { - "content-type": 'application/json', } @client.call( @@ -485,21 +443,20 @@ def get_queue_usage(threshold: nil) end - # Get the number of projects containing metrics that are waiting to be - # processed in the Appwrite internal queue server. + # Get the number of metrics that are waiting to be processed in the Appwrite + # internal queue server. # # @param [Integer] threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. # # @return [HealthQueue] - def get_queue_usage_dump(threshold: nil) - api_path = '/health/queue/usage-dump' + def get_queue_usage(threshold: nil) + api_path = '/health/queue/stats-usage' api_params = { threshold: threshold, } api_headers = { - "content-type": 'application/json', } @client.call( @@ -526,7 +483,6 @@ def get_queue_webhooks(threshold: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -550,7 +506,6 @@ def get_storage() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -574,7 +529,6 @@ def get_storage_local() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -604,7 +558,6 @@ def get_time() } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/locale.rb b/lib/appwrite/services/locale.rb index 0d181a9..8cb443e 100644 --- a/lib/appwrite/services/locale.rb +++ b/lib/appwrite/services/locale.rb @@ -23,7 +23,6 @@ def get() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -48,7 +47,6 @@ def list_codes() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -73,7 +71,6 @@ def list_continents() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -98,7 +95,6 @@ def list_countries() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -123,7 +119,6 @@ def list_countries_eu() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -148,7 +143,6 @@ def list_countries_phones() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -174,7 +168,6 @@ def list_currencies() } api_headers = { - "content-type": 'application/json', } @client.call( @@ -199,7 +192,6 @@ def list_languages() } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/messaging.rb b/lib/appwrite/services/messaging.rb index 97ef48a..8a760de 100644 --- a/lib/appwrite/services/messaging.rb +++ b/lib/appwrite/services/messaging.rb @@ -22,7 +22,6 @@ def list_messages(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -95,7 +94,9 @@ def create_email(message_id:, subject:, content:, topics: nil, users: nil, targe end - # Update an email message by its unique ID. + # Update an email message by its unique ID. This endpoint only works on + # messages that are in draft status. Messages that are already processing, + # sent, or failed cannot be updated. # # # @param [String] message_id Message ID. @@ -214,7 +215,9 @@ def create_push(message_id:, title: nil, body: nil, topics: nil, users: nil, tar end - # Update a push notification by its unique ID. + # Update a push notification by its unique ID. This endpoint only works on + # messages that are in draft status. Messages that are already processing, + # sent, or failed cannot be updated. # # # @param [String] message_id Message ID. @@ -327,7 +330,9 @@ def create_sms(message_id:, content:, topics: nil, users: nil, targets: nil, dra end - # Update an SMS message by its unique ID. + # Update an SMS message by its unique ID. This endpoint only works on + # messages that are in draft status. Messages that are already processing, + # sent, or failed cannot be updated. # # # @param [String] message_id Message ID. @@ -388,7 +393,6 @@ def get_message(message_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -450,7 +454,6 @@ def list_message_logs(message_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -482,7 +485,6 @@ def list_targets(message_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -510,7 +512,6 @@ def list_providers(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1441,7 +1442,6 @@ def get_provider(provider_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1502,7 +1502,6 @@ def list_provider_logs(provider_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1534,7 +1533,6 @@ def list_subscriber_logs(subscriber_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1562,7 +1560,6 @@ def list_topics(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1631,7 +1628,6 @@ def get_topic(topic_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1727,7 +1723,6 @@ def list_topic_logs(topic_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1761,7 +1756,6 @@ def list_subscribers(topic_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1840,7 +1834,6 @@ def get_subscriber(topic_id:, subscriber_id:) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index 9fd8add..84f0199 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -23,7 +23,6 @@ def list_buckets(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -106,7 +105,6 @@ def get_bucket(bucket_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -222,7 +220,6 @@ def list_files(bucket_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -325,7 +322,6 @@ def get_file(bucket_id:, file_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -440,7 +436,6 @@ def get_file_download(bucket_id:, file_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -501,7 +496,6 @@ def get_file_preview(bucket_id:, file_id:, width: nil, height: nil, gravity: nil } api_headers = { - "content-type": 'application/json', } @client.call( @@ -538,7 +532,6 @@ def get_file_view(bucket_id:, file_id:) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/teams.rb b/lib/appwrite/services/teams.rb index 487440e..ad1f66e 100644 --- a/lib/appwrite/services/teams.rb +++ b/lib/appwrite/services/teams.rb @@ -23,7 +23,6 @@ def list(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -93,7 +92,6 @@ def get(team_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -195,7 +193,6 @@ def list_memberships(team_id:, queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -299,7 +296,6 @@ def get_membership(team_id:, membership_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -467,7 +463,6 @@ def get_prefs(team_id:) } api_headers = { - "content-type": 'application/json', } @client.call( diff --git a/lib/appwrite/services/users.rb b/lib/appwrite/services/users.rb index 2a3af73..9c1d85b 100644 --- a/lib/appwrite/services/users.rb +++ b/lib/appwrite/services/users.rb @@ -23,7 +23,6 @@ def list(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -183,7 +182,6 @@ def list_identities(queries: nil, search: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -528,7 +526,6 @@ def get(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -707,7 +704,6 @@ def list_logs(user_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -737,7 +733,6 @@ def list_memberships(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -838,7 +833,6 @@ def list_mfa_factors(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -871,7 +865,6 @@ def get_mfa_recovery_codes(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1075,7 +1068,6 @@ def get_prefs(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1143,7 +1135,6 @@ def list_sessions(user_id:) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1311,7 +1302,6 @@ def list_targets(user_id:, queries: nil) } api_headers = { - "content-type": 'application/json', } @client.call( @@ -1399,7 +1389,6 @@ def get_target(user_id:, target_id:) } api_headers = { - "content-type": 'application/json', } @client.call(