appwrite 15.0.0 → 15.1.0.pre.rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7b89a3506ea51e2761fa9de591a2cc73f77f3f87511f0772bb8d1ce0ad3774b
4
- data.tar.gz: 0f2b41ded1bf8d51fbec7d94535f77ed4f1548106c7ad2eafb30de808463fd0a
3
+ metadata.gz: 22ac14a149342eb6eff26e7ddb8a9393408f4ad59f507869ce6c3e63e9341706
4
+ data.tar.gz: 3d71263b960797f1c6a9aca1c7c088eddc2d271a0820b66761bf7dcafefc18c8
5
5
  SHA512:
6
- metadata.gz: d05d58c55669041fb5d5cda9a0e14c670f6bfdb5d93610b64e08f8dbaae413cbb400b39fa3bcbef26e00c74f2421728707259ee642c55e1e3cf1437231219a8c
7
- data.tar.gz: 6078fed9e1b861f0da0625660593ab098e7b8c74bb98f672b178853f6fa46f6d3ca35cf57c9487837ea22e463614cbc99b4d31fd3e76caa9a98f41734de7c637
6
+ metadata.gz: ced3159ac2f55558555e60c3dcbf324e8d5ca230b863fdcbf02f72a9bb3e8b3c95afbade6313aebca6b54ee7cc20d5eac488aec726627809e7540a64ff1e0d4d
7
+ data.tar.gz: ef1c92cfc2362818c79a95ccd60a8c7f1045a5324e1a877fb977569230b88ba45b30b7ed4f02a9b11c05a7c01fd0efef0e8786d5a4832f9b108c9c74d8e53643
@@ -15,7 +15,7 @@ module Appwrite
15
15
  'x-sdk-name'=> 'Ruby',
16
16
  'x-sdk-platform'=> 'server',
17
17
  'x-sdk-language'=> 'ruby',
18
- 'x-sdk-version'=> '15.0.0',
18
+ 'x-sdk-version'=> '15.1.0-rc.1',
19
19
  'X-Appwrite-Response-Format' => '1.6.0'
20
20
  }
21
21
  @endpoint = 'https://cloud.appwrite.io/v1'
@@ -1680,7 +1680,6 @@ module Appwrite
1680
1680
  # collection resource using either a [server
1681
1681
  # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1682
1682
  # API or directly from your database console.
1683
- #
1684
1683
  #
1685
1684
  # @param [String] database_id Database ID.
1686
1685
  # @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.
@@ -1730,6 +1729,175 @@ module Appwrite
1730
1729
  end
1731
1730
 
1732
1731
 
1732
+ # Create new Documents. Before using this route, you should create a new
1733
+ # collection resource using either a [server
1734
+ # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1735
+ # API or directly from your database console.
1736
+ #
1737
+ #
1738
+ # @param [String] database_id Database ID.
1739
+ # @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.
1740
+ # @param [Array] documents Array of documents data as JSON objects.
1741
+ #
1742
+ # @return [DocumentList]
1743
+ def create_documents(database_id:, collection_id:, documents:)
1744
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1745
+ .gsub('{databaseId}', database_id)
1746
+ .gsub('{collectionId}', collection_id)
1747
+
1748
+ if database_id.nil?
1749
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1750
+ end
1751
+
1752
+ if collection_id.nil?
1753
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1754
+ end
1755
+
1756
+ if documents.nil?
1757
+ raise Appwrite::Exception.new('Missing required parameter: "documents"')
1758
+ end
1759
+
1760
+ api_params = {
1761
+ documents: documents,
1762
+ }
1763
+
1764
+ api_headers = {
1765
+ "content-type": 'application/json',
1766
+ }
1767
+
1768
+ @client.call(
1769
+ method: 'POST',
1770
+ path: api_path,
1771
+ headers: api_headers,
1772
+ params: api_params,
1773
+ response_type: Models::DocumentList
1774
+ )
1775
+ end
1776
+
1777
+
1778
+ # Create or update Documents. Before using this route, you should create a
1779
+ # new collection resource using either a [server
1780
+ # integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1781
+ # API or directly from your database console.
1782
+ #
1783
+ #
1784
+ # @param [String] database_id Database ID.
1785
+ # @param [String] collection_id Collection ID.
1786
+ # @param [Array] documents Array of document data as JSON objects. May contain partial documents.
1787
+ #
1788
+ # @return [DocumentList]
1789
+ def upsert_documents(database_id:, collection_id:, documents: nil)
1790
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1791
+ .gsub('{databaseId}', database_id)
1792
+ .gsub('{collectionId}', collection_id)
1793
+
1794
+ if database_id.nil?
1795
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1796
+ end
1797
+
1798
+ if collection_id.nil?
1799
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1800
+ end
1801
+
1802
+ api_params = {
1803
+ documents: documents,
1804
+ }
1805
+
1806
+ api_headers = {
1807
+ "content-type": 'application/json',
1808
+ }
1809
+
1810
+ @client.call(
1811
+ method: 'PUT',
1812
+ path: api_path,
1813
+ headers: api_headers,
1814
+ params: api_params,
1815
+ response_type: Models::DocumentList
1816
+ )
1817
+ end
1818
+
1819
+
1820
+ # Update all documents that match your queries, if no queries are submitted
1821
+ # then all documents are updated. You can pass only specific fields to be
1822
+ # updated.
1823
+ #
1824
+ # @param [String] database_id Database ID.
1825
+ # @param [String] collection_id Collection ID.
1826
+ # @param [Hash] data Document data as JSON object. Include only attribute and value pairs to be updated.
1827
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1828
+ #
1829
+ # @return [DocumentList]
1830
+ def update_documents(database_id:, collection_id:, data: nil, queries: nil)
1831
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1832
+ .gsub('{databaseId}', database_id)
1833
+ .gsub('{collectionId}', collection_id)
1834
+
1835
+ if database_id.nil?
1836
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1837
+ end
1838
+
1839
+ if collection_id.nil?
1840
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1841
+ end
1842
+
1843
+ api_params = {
1844
+ data: data,
1845
+ queries: queries,
1846
+ }
1847
+
1848
+ api_headers = {
1849
+ "content-type": 'application/json',
1850
+ }
1851
+
1852
+ @client.call(
1853
+ method: 'PATCH',
1854
+ path: api_path,
1855
+ headers: api_headers,
1856
+ params: api_params,
1857
+ response_type: Models::DocumentList
1858
+ )
1859
+ end
1860
+
1861
+
1862
+ # Bulk delete documents using queries, if no queries are passed then all
1863
+ # documents are deleted.
1864
+ #
1865
+ # @param [String] database_id Database ID.
1866
+ # @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).
1867
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1868
+ #
1869
+ # @return [DocumentList]
1870
+ def delete_documents(database_id:, collection_id:, queries: nil)
1871
+ api_path = '/databases/{databaseId}/collections/{collectionId}/documents'
1872
+ .gsub('{databaseId}', database_id)
1873
+ .gsub('{collectionId}', collection_id)
1874
+
1875
+ if database_id.nil?
1876
+ raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
1877
+ end
1878
+
1879
+ if collection_id.nil?
1880
+ raise Appwrite::Exception.new('Missing required parameter: "collectionId"')
1881
+ end
1882
+
1883
+ api_params = {
1884
+ queries: queries,
1885
+ }
1886
+
1887
+ api_headers = {
1888
+ "content-type": 'application/json',
1889
+ }
1890
+
1891
+ @client.call(
1892
+ method: 'DELETE',
1893
+ path: api_path,
1894
+ headers: api_headers,
1895
+ params: api_params,
1896
+ response_type: Models::DocumentList
1897
+ )
1898
+ end
1899
+
1900
+
1733
1901
  # Get a document by its unique ID. This endpoint response returns a JSON
1734
1902
  # object with the document data.
1735
1903
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appwrite
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.0
4
+ version: 15.1.0.pre.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Appwrite Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-17 00:00:00.000000000 Z
11
+ date: 2025-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -175,9 +175,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - ">"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: 1.3.1
181
181
  requirements: []
182
182
  rubygems_version: 3.1.6
183
183
  signing_key: