Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 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 = '17.0.0'
spec.version = '17.1.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
18 changes: 18 additions & 0 deletions docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_line_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '' # optional
)
18 changes: 18 additions & 0 deletions docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_point_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '' # optional
)
18 changes: 18 additions & 0 deletions docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_polygon_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/databases/update-line-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.update_line_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/databases/update-point-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.update_point_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/databases/update-polygon-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.update_polygon_attribute(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
18 changes: 18 additions & 0 deletions docs/examples/tablesdb/create-line-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.create_line_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '' # optional
)
18 changes: 18 additions & 0 deletions docs/examples/tablesdb/create-point-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.create_point_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '' # optional
)
18 changes: 18 additions & 0 deletions docs/examples/tablesdb/create-polygon-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.create_polygon_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/update-line-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.update_line_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/update-point-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.update_point_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
19 changes: 19 additions & 0 deletions docs/examples/tablesdb/update-polygon-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.update_polygon_column(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
key: '',
required: false,
default: '', # optional
new_key: '' # optional
)
6 changes: 6 additions & 0 deletions lib/appwrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
require_relative 'appwrite/models/attribute_url'
require_relative 'appwrite/models/attribute_datetime'
require_relative 'appwrite/models/attribute_relationship'
require_relative 'appwrite/models/attribute_point'
require_relative 'appwrite/models/attribute_line'
require_relative 'appwrite/models/attribute_polygon'
require_relative 'appwrite/models/table'
require_relative 'appwrite/models/column_list'
require_relative 'appwrite/models/column_string'
Expand All @@ -72,6 +75,9 @@
require_relative 'appwrite/models/column_url'
require_relative 'appwrite/models/column_datetime'
require_relative 'appwrite/models/column_relationship'
require_relative 'appwrite/models/column_point'
require_relative 'appwrite/models/column_line'
require_relative 'appwrite/models/column_polygon'
require_relative 'appwrite/models/index'
require_relative 'appwrite/models/column_index'
require_relative 'appwrite/models/row'
Expand Down
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'=> '17.0.0',
'x-sdk-version'=> '17.1.0',
'X-Appwrite-Response-Format' => '1.8.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
Expand Down
2 changes: 1 addition & 1 deletion lib/appwrite/enums/credit_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module CreditCard
MASTERCARD = 'mastercard'
NARANJA = 'naranja'
TARJETA_SHOPPING = 'targeta-shopping'
UNION_CHINA_PAY = 'union-china-pay'
UNION_PAY = 'unionpay'
VISA = 'visa'
MIR = 'mir'
MAESTRO = 'maestro'
Expand Down
1 change: 1 addition & 0 deletions lib/appwrite/enums/execution_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module ExecutionMethod
PATCH = 'PATCH'
DELETE = 'DELETE'
OPTIONS = 'OPTIONS'
HEAD = 'HEAD'
end
end
end
1 change: 1 addition & 0 deletions lib/appwrite/enums/index_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module IndexType
KEY = 'key'
FULLTEXT = 'fulltext'
UNIQUE = 'unique'
SPATIAL = 'spatial'
end
end
end
67 changes: 67 additions & 0 deletions lib/appwrite/models/attribute_line.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#frozen_string_literal: true

module Appwrite
module Models
class AttributeLine
attr_reader :key
attr_reader :type
attr_reader :status
attr_reader :error
attr_reader :required
attr_reader :array
attr_reader :created_at
attr_reader :updated_at
attr_reader :default

def initialize(
key:,
type:,
status:,
error:,
required:,
array: ,
created_at:,
updated_at:,
default:
)
@key = key
@type = type
@status = status
@error = error
@required = required
@array = array
@created_at = created_at
@updated_at = updated_at
@default = default
end

def self.from(map:)
AttributeLine.new(
key: map["key"],
type: map["type"],
status: map["status"],
error: map["error"],
required: map["required"],
array: map["array"],
created_at: map["$createdAt"],
updated_at: map["$updatedAt"],
default: map["default"]
)
end

def to_map
{
"key": @key,
"type": @type,
"status": @status,
"error": @error,
"required": @required,
"array": @array,
"$createdAt": @created_at,
"$updatedAt": @updated_at,
"default": @default
}
end
end
end
end
Loading