Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #17

Merged
merged 4 commits into from
Sep 7, 2023
Merged

Dev #17

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.4.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.4.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)
Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '9.0.1'
spec.version = '10.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'
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ client = Client.new

functions = Functions.new(client)

response = functions.create(function_id: '[FUNCTION_ID]', name: '[NAME]', runtime: 'node-14.5')
response = functions.create(function_id: '[FUNCTION_ID]', name: '[NAME]', runtime: 'node-18.0')

puts response.inspect
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ client = Client.new

functions = Functions.new(client)

response = functions.update(function_id: '[FUNCTION_ID]', name: '[NAME]', runtime: 'node-14.5')
response = functions.update(function_id: '[FUNCTION_ID]', name: '[NAME]')

puts response.inspect
2 changes: 1 addition & 1 deletion docs/examples/teams/create-membership.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ client = Client.new

teams = Teams.new(client)

response = teams.create_membership(team_id: '[TEAM_ID]', roles: [], url: 'https://example.com')
response = teams.create_membership(team_id: '[TEAM_ID]', roles: [])

puts response.inspect
2 changes: 1 addition & 1 deletion lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize
'x-sdk-name'=> 'Ruby',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'ruby',
'x-sdk-version'=> '9.0.1',
'x-sdk-version'=> '10.0.0',
'X-Appwrite-Response-Format' => '1.4.0'
}
@endpoint = 'https://HOSTNAME/v1'
Expand Down
6 changes: 1 addition & 5 deletions lib/appwrite/services/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def get(function_id:)
# @param [String] provider_root_directory Path to function code in the linked repo.
#
# @return [Function]
def update(function_id:, name:, runtime:, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil)
def update(function_id:, name:, runtime: nil, execute: nil, events: nil, schedule: nil, timeout: nil, enabled: nil, logging: nil, entrypoint: nil, commands: nil, installation_id: nil, provider_repository_id: nil, provider_branch: nil, provider_silent_mode: nil, provider_root_directory: nil)
api_path = '/functions/{functionId}'
.gsub('{functionId}', function_id)

Expand All @@ -200,10 +200,6 @@ def update(function_id:, name:, runtime:, execute: nil, events: nil, schedule: n
raise Appwrite::Exception.new('Missing required parameter: "name"')
end

if runtime.nil?
raise Appwrite::Exception.new('Missing required parameter: "runtime"')
end

api_params = {
name: name,
runtime: runtime,
Expand Down
8 changes: 2 additions & 6 deletions lib/appwrite/services/teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ def list_memberships(team_id:, queries: nil, search: nil)
#
# @param [String] team_id Team ID.
# @param [Array] roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
# @param [String] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project 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] email Email of the new team member.
# @param [String] user_id ID of the user to be added to a team.
# @param [String] phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
# @param [String] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project 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] name Name of the new team member. Max length: 128 chars.
#
# @return [Membership]
def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: nil, name: nil)
def create_membership(team_id:, roles:, email: nil, user_id: nil, phone: nil, url: nil, name: nil)
api_path = '/teams/{teamId}/memberships'
.gsub('{teamId}', team_id)

Expand All @@ -250,10 +250,6 @@ def create_membership(team_id:, roles:, url:, email: nil, user_id: nil, phone: n
raise Appwrite::Exception.new('Missing required parameter: "roles"')
end

if url.nil?
raise Appwrite::Exception.new('Missing required parameter: "url"')
end

api_params = {
email: email,
userId: user_id,
Expand Down
2 changes: 1 addition & 1 deletion lib/appwrite/services/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def update_email(user_id:, email:)
# docs](/docs/permissions) for more info.
#
# @param [String] user_id User ID.
# @param [Array] labels Array of user labels. Replaces the previous labels. Maximum of 5 labels are allowed, each up to 36 alphanumeric characters long.
# @param [Array] labels Array of user labels. Replaces the previous labels. Maximum of 100 labels are allowed, each up to 36 alphanumeric characters long.
#
# @return [User]
def update_labels(user_id:, labels:)
Expand Down