notion-sdk-ruby 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 006e8ac9f857ad0644041bd3ba45608730e72095c021e19034254ed0d75372ad
4
- data.tar.gz: 8ba2f237a80ca3aebb2532d52f3d5ffa58337181278062dd0f31c01d66d8a5a5
3
+ metadata.gz: 2b8f9260f352a244eaf86cd39b5724c874929548ebf289f795755d2e63aa09b8
4
+ data.tar.gz: f7c63168582a3f7d7c0b898fb0bcd85338c26c816782cd8d222fde67c1418d80
5
5
  SHA512:
6
- metadata.gz: e2bf9572dd3947686b40b734a642b782fd0ef0efb94f6714b66d7d4815e9625453febb5ae1f5c44588289266c1ca43fa7c24c15aba9bd0bc12f6bceebff1334d
7
- data.tar.gz: 2d850b377b632e59c533fcdac1a52b1989f72c7fd64c340332b9c0a7cb752b5e7fb4459b30b43a1b4047dd948b1a86d58cbb7ff5774a734dfdf872df081eb2d8
6
+ metadata.gz: f9e01092c18da58fb6d9e813cfdea77f96deb71295c525f7942cf7e125fd70106d4a33e414513fa2e6282849ea84787552397e6d009272480b11801c93509925
7
+ data.tar.gz: fcec5ce30ef130a1c54582cef9bd792729acb134c3b81a860a9b939f198fd115c79ef5d8ea4481723a6ee345b116cf9fb81b5aedf03d373cfab33853700e1543
@@ -1,34 +1,34 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: ci
9
-
10
- on:
11
- push:
12
- branches: [main]
13
- pull_request:
14
- branches: [main]
15
-
16
- jobs:
17
- test:
18
- runs-on: ubuntu-latest
19
- strategy:
20
- matrix:
21
- ruby-version: ["2.6", "2.7", "3.0"]
22
-
23
- steps:
24
- - uses: actions/checkout@v2
25
- - name: Set up Ruby
26
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
- # uses: ruby/setup-ruby@v1
29
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
30
- with:
31
- ruby-version: ${{ matrix.ruby-version }}
32
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
- - name: Run tests
34
- run: bundle exec rake
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: ci
9
+
10
+ on:
11
+ push:
12
+ branches: [main]
13
+ pull_request:
14
+ branches: [main]
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ strategy:
20
+ matrix:
21
+ ruby-version: ["2.6", "2.7", "3.0"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v2
25
+ - name: Set up Ruby
26
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
+ # uses: ruby/setup-ruby@v1
29
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
30
+ with:
31
+ ruby-version: ${{ matrix.ruby-version }}
32
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
33
+ - name: Run tests
34
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -1,13 +1,13 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- .env
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ .env
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.5
6
- before_install: gem install bundler -v 2.1.4
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.5
6
+ before_install: gem install bundler -v 2.1.4
@@ -1,4 +1,4 @@
1
- {
2
- "editor.formatOnSave": true,
3
- "editor.tabSize": 2
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.tabSize": 2
4
4
  }
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in notion-sdk-ruby.gemspec
4
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in notion-sdk-ruby.gemspec
4
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notion-sdk-ruby (0.3.1)
4
+ notion-sdk-ruby (0.4.0)
5
5
  httparty (~> 0.18.1)
6
6
 
7
7
  GEM
@@ -22,7 +22,7 @@ GEM
22
22
  method_source (1.0.0)
23
23
  mime-types (3.3.1)
24
24
  mime-types-data (~> 3.2015)
25
- mime-types-data (3.2021.0225)
25
+ mime-types-data (3.2021.0704)
26
26
  multi_xml (0.6.0)
27
27
  parallel (1.20.1)
28
28
  parser (3.0.1.1)
@@ -88,4 +88,4 @@ DEPENDENCIES
88
88
  webmock (~> 3.12)
89
89
 
90
90
  BUNDLED WITH
91
- 2.1.4
91
+ 2.2.3
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Graham Marlow
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Graham Marlow
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,263 +1,263 @@
1
- # Notion Ruby SDK
2
-
3
- [![ci](https://github.com/mgmarlow/notion-sdk-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/mgmarlow/notion-sdk-ruby/actions/workflows/ci.yml)
4
- [![Gem Version](https://badge.fury.io/rb/notion-sdk-ruby.svg)](https://badge.fury.io/rb/notion-sdk-ruby)
5
-
6
- Unofficial Ruby client for the [Notion APIs](https://developers.notion.com/).
7
-
8
- - [Notion Ruby SDK](#notion-ruby-sdk)
9
- - [Installation](#installation)
10
- - [Usage](#usage)
11
- - [API reference](#api-reference)
12
- - [Databases](#databases)
13
- - [databases#retrieve](#databasesretrieve)
14
- - [databases#list](#databaseslist)
15
- - [databases#query](#databasesquery)
16
- - [Pages](#pages)
17
- - [pages#retrieve](#pagesretrieve)
18
- - [pages#create](#pagescreate)
19
- - [pages#update](#pagesupdate)
20
- - [Blocks](#blocks)
21
- - [blocks#children#list](#blockschildrenlist)
22
- - [blocks#children#append](#blockschildrenappend)
23
- - [Users](#users)
24
- - [users#retrieve](#usersretrieve)
25
- - [users#list](#userslist)
26
- - [Search](#search)
27
- - [#search](#search-1)
28
- - [Development](#development)
29
- - [Contributing](#contributing)
30
- - [License](#license)
31
-
32
- ## Installation
33
-
34
- Add this line to your application's Gemfile:
35
-
36
- ```ruby
37
- gem 'notion-sdk-ruby'
38
- ```
39
-
40
- And then execute:
41
-
42
- $ bundle install
43
-
44
- ## Usage
45
-
46
- Initialize `Notion::Client` with your app's [integration secret](https://developers.notion.com/docs/getting-started#create-a-new-integration).
47
-
48
- ```rb
49
- require "notion-sdk-ruby"
50
- client = Notion::Client.new(token: ENV["NOTION_API_SECRET"])
51
- ```
52
-
53
- ## API reference
54
-
55
- ### Databases
56
-
57
- #### databases#retrieve
58
-
59
- [API reference](https://developers.notion.com/reference/get-database)
60
-
61
- ```rb
62
- client.databases.retrieve("668d797c-76fa-4934-9b05-ad288df2d136")
63
- ```
64
-
65
- #### databases#list
66
-
67
- [API reference](https://developers.notion.com/reference/get-databases)
68
-
69
- ```rb
70
- client.databases.list
71
- ```
72
-
73
- #### databases#query
74
-
75
- [API reference](https://developers.notion.com/reference/post-database-query)
76
-
77
- ```rb
78
- client.databases.query("668d797c-76fa-4934-9b05-ad288df2d136", {
79
- "filter": {
80
- "or": [
81
- {
82
- "property": "In stock",
83
- "checkbox": {
84
- "equals": true
85
- }
86
- },
87
- {
88
- "property": "Cost of next trip",
89
- "number": {
90
- "greater_than_or_equal_to": 2
91
- }
92
- }
93
- ]
94
- },
95
- "sorts": [
96
- {
97
- "property": "Last ordered",
98
- "direction": "ascending"
99
- }
100
- ]
101
- })
102
- ```
103
-
104
- ### Pages
105
-
106
- #### pages#retrieve
107
-
108
- [API reference](https://developers.notion.com/reference/get-page)
109
-
110
- ```rb
111
- client.pages.retrieve("b55c9c91-384d-452b-81db-d1ef79372b75")
112
- ```
113
-
114
- #### pages#create
115
-
116
- [API reference](https://developers.notion.com/reference/post-page)
117
-
118
- ```rb
119
- client.pages.create({
120
- "parent": { "database_id": "48f8fee9cd794180bc2fec0398253067" },
121
- "properties": {
122
- "Name": {
123
- "title": [
124
- {
125
- "text": {
126
- "content": "Tuscan Kale"
127
- }
128
- }
129
- ]
130
- },
131
- "Description": {
132
- "rich_text": [
133
- {
134
- "text": {
135
- "content": "A dark green leafy vegetable"
136
- }
137
- }
138
- ]
139
- },
140
- "Food group": {
141
- "select": {
142
- "name": "Vegetable"
143
- }
144
- },
145
- "Price": { "number": 2.5 }
146
- },
147
- "children": []
148
- })
149
- ```
150
-
151
- #### pages#update
152
-
153
- [API reference](https://developers.notion.com/reference/patch-page)
154
-
155
- ```rb
156
- client.pages.update("b55c9c91-384d-452b-81db-d1ef79372b75", {
157
- "properties": {
158
- "In stock": { "checkbox": true }
159
- }
160
- })
161
- ```
162
-
163
- ### Blocks
164
-
165
- #### blocks#children#list
166
-
167
- [API reference](https://developers.notion.com/reference/get-block-children)
168
-
169
- ```rb
170
- client.blocks.children.list("b55c9c91-384d-452b-81db-d1ef79372b75", {
171
- page_size: 100
172
- })
173
- ```
174
-
175
- #### blocks#children#append
176
-
177
- [API reference](https://developers.notion.com/reference/patch-block-children)
178
-
179
- ```rb
180
- client.blocks.children.append("b54c9c91-384d-452b-81db-d1ef79372b75", {
181
- "children": [
182
- {
183
- "object": "block",
184
- "type": "heading_1",
185
- "heading_1": {
186
- "text": [{ "type": "text", "text": { "content": "Lacinato kale" } }]
187
- }
188
- },
189
- {
190
- "object": "block",
191
- "type": "paragraph",
192
- "paragraph": {
193
- "text": [
194
- {
195
- "type": "text",
196
- "text": {
197
- "content": "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.",
198
- "link": { "url": "https://en.wikipedia.org/wiki/Lacinato_kale" }
199
- }
200
- }
201
- ]
202
- }
203
- }
204
- ]
205
- })
206
- ```
207
-
208
- ### Users
209
-
210
- #### users#retrieve
211
-
212
- [API reference](https://developers.notion.com/reference/get-user)
213
-
214
- ```rb
215
- client.users.retrieve("d40e767c-d7af-4b18-a86d-55c61f1e39a4")
216
- ```
217
-
218
- #### users#list
219
-
220
- [API reference](https://developers.notion.com/reference/get-users)
221
-
222
- ```rb
223
- client.users.list
224
- ```
225
-
226
- ### Search
227
-
228
- [API reference](https://developers.notion.com/reference/post-search)
229
-
230
- #### #search
231
-
232
- ```rb
233
- client.search({
234
- "query":"External tasks",
235
- "sort":{
236
- "direction":"ascending",
237
- "timestamp":"last_edited_time"
238
- }
239
- }
240
- )
241
- ```
242
-
243
- ## Development
244
-
245
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
246
-
247
- Before using `bin/console` you need to create a new file, `.env`, at the root project directory. This will enable you to run commands directly against your [Notion integration](https://developers.notion.com/docs/getting-started).
248
-
249
- ```
250
- cat > .env <<EOF
251
- API_SECRET=<YOUR NOTION API SECRET HERE>
252
- EOF
253
- ```
254
-
255
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
256
-
257
- ## Contributing
258
-
259
- Bug reports and pull requests are welcome on GitHub at https://github.com/mgmarlow/notion-sdk-ruby.
260
-
261
- ## License
262
-
263
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1
+ # Notion Ruby SDK
2
+
3
+ [![ci](https://github.com/mgmarlow/notion-sdk-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/mgmarlow/notion-sdk-ruby/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/notion-sdk-ruby.svg)](https://badge.fury.io/rb/notion-sdk-ruby)
5
+
6
+ Unofficial Ruby client for the [Notion APIs](https://developers.notion.com/).
7
+
8
+ - [Notion Ruby SDK](#notion-ruby-sdk)
9
+ - [Installation](#installation)
10
+ - [Usage](#usage)
11
+ - [API reference](#api-reference)
12
+ - [Databases](#databases)
13
+ - [databases#retrieve](#databasesretrieve)
14
+ - [databases#list](#databaseslist)
15
+ - [databases#query](#databasesquery)
16
+ - [Pages](#pages)
17
+ - [pages#retrieve](#pagesretrieve)
18
+ - [pages#create](#pagescreate)
19
+ - [pages#update](#pagesupdate)
20
+ - [Blocks](#blocks)
21
+ - [blocks#children#list](#blockschildrenlist)
22
+ - [blocks#children#append](#blockschildrenappend)
23
+ - [Users](#users)
24
+ - [users#retrieve](#usersretrieve)
25
+ - [users#list](#userslist)
26
+ - [Search](#search)
27
+ - [#search](#search-1)
28
+ - [Development](#development)
29
+ - [Contributing](#contributing)
30
+ - [License](#license)
31
+
32
+ ## Installation
33
+
34
+ Add this line to your application's Gemfile:
35
+
36
+ ```ruby
37
+ gem 'notion-sdk-ruby'
38
+ ```
39
+
40
+ And then execute:
41
+
42
+ $ bundle install
43
+
44
+ ## Usage
45
+
46
+ Initialize `Notion::Client` with your app's [integration secret](https://developers.notion.com/docs/getting-started#create-a-new-integration).
47
+
48
+ ```rb
49
+ require "notion-sdk-ruby"
50
+ client = Notion::Client.new(token: ENV["NOTION_API_SECRET"])
51
+ ```
52
+
53
+ ## API reference
54
+
55
+ ### Databases
56
+
57
+ #### databases#retrieve
58
+
59
+ [API reference](https://developers.notion.com/reference/get-database)
60
+
61
+ ```rb
62
+ client.databases.retrieve("668d797c-76fa-4934-9b05-ad288df2d136")
63
+ ```
64
+
65
+ #### databases#list
66
+
67
+ [API reference](https://developers.notion.com/reference/get-databases)
68
+
69
+ ```rb
70
+ client.databases.list
71
+ ```
72
+
73
+ #### databases#query
74
+
75
+ [API reference](https://developers.notion.com/reference/post-database-query)
76
+
77
+ ```rb
78
+ client.databases.query("668d797c-76fa-4934-9b05-ad288df2d136", {
79
+ "filter": {
80
+ "or": [
81
+ {
82
+ "property": "In stock",
83
+ "checkbox": {
84
+ "equals": true
85
+ }
86
+ },
87
+ {
88
+ "property": "Cost of next trip",
89
+ "number": {
90
+ "greater_than_or_equal_to": 2
91
+ }
92
+ }
93
+ ]
94
+ },
95
+ "sorts": [
96
+ {
97
+ "property": "Last ordered",
98
+ "direction": "ascending"
99
+ }
100
+ ]
101
+ })
102
+ ```
103
+
104
+ ### Pages
105
+
106
+ #### pages#retrieve
107
+
108
+ [API reference](https://developers.notion.com/reference/get-page)
109
+
110
+ ```rb
111
+ client.pages.retrieve("b55c9c91-384d-452b-81db-d1ef79372b75")
112
+ ```
113
+
114
+ #### pages#create
115
+
116
+ [API reference](https://developers.notion.com/reference/post-page)
117
+
118
+ ```rb
119
+ client.pages.create({
120
+ "parent": { "database_id": "48f8fee9cd794180bc2fec0398253067" },
121
+ "properties": {
122
+ "Name": {
123
+ "title": [
124
+ {
125
+ "text": {
126
+ "content": "Tuscan Kale"
127
+ }
128
+ }
129
+ ]
130
+ },
131
+ "Description": {
132
+ "rich_text": [
133
+ {
134
+ "text": {
135
+ "content": "A dark green leafy vegetable"
136
+ }
137
+ }
138
+ ]
139
+ },
140
+ "Food group": {
141
+ "select": {
142
+ "name": "Vegetable"
143
+ }
144
+ },
145
+ "Price": { "number": 2.5 }
146
+ },
147
+ "children": []
148
+ })
149
+ ```
150
+
151
+ #### pages#update
152
+
153
+ [API reference](https://developers.notion.com/reference/patch-page)
154
+
155
+ ```rb
156
+ client.pages.update("b55c9c91-384d-452b-81db-d1ef79372b75", {
157
+ "properties": {
158
+ "In stock": { "checkbox": true }
159
+ }
160
+ })
161
+ ```
162
+
163
+ ### Blocks
164
+
165
+ #### blocks#children#list
166
+
167
+ [API reference](https://developers.notion.com/reference/get-block-children)
168
+
169
+ ```rb
170
+ client.blocks.children.list("b55c9c91-384d-452b-81db-d1ef79372b75", {
171
+ page_size: 100
172
+ })
173
+ ```
174
+
175
+ #### blocks#children#append
176
+
177
+ [API reference](https://developers.notion.com/reference/patch-block-children)
178
+
179
+ ```rb
180
+ client.blocks.children.append("b54c9c91-384d-452b-81db-d1ef79372b75", {
181
+ "children": [
182
+ {
183
+ "object": "block",
184
+ "type": "heading_1",
185
+ "heading_1": {
186
+ "text": [{ "type": "text", "text": { "content": "Lacinato kale" } }]
187
+ }
188
+ },
189
+ {
190
+ "object": "block",
191
+ "type": "paragraph",
192
+ "paragraph": {
193
+ "text": [
194
+ {
195
+ "type": "text",
196
+ "text": {
197
+ "content": "Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.",
198
+ "link": { "url": "https://en.wikipedia.org/wiki/Lacinato_kale" }
199
+ }
200
+ }
201
+ ]
202
+ }
203
+ }
204
+ ]
205
+ })
206
+ ```
207
+
208
+ ### Users
209
+
210
+ #### users#retrieve
211
+
212
+ [API reference](https://developers.notion.com/reference/get-user)
213
+
214
+ ```rb
215
+ client.users.retrieve("d40e767c-d7af-4b18-a86d-55c61f1e39a4")
216
+ ```
217
+
218
+ #### users#list
219
+
220
+ [API reference](https://developers.notion.com/reference/get-users)
221
+
222
+ ```rb
223
+ client.users.list
224
+ ```
225
+
226
+ ### Search
227
+
228
+ [API reference](https://developers.notion.com/reference/post-search)
229
+
230
+ #### #search
231
+
232
+ ```rb
233
+ client.search({
234
+ "query":"External tasks",
235
+ "sort":{
236
+ "direction":"ascending",
237
+ "timestamp":"last_edited_time"
238
+ }
239
+ }
240
+ )
241
+ ```
242
+
243
+ ## Development
244
+
245
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
246
+
247
+ Before using `bin/console` you need to create a new file, `.env`, at the root project directory. This will enable you to run commands directly against your [Notion integration](https://developers.notion.com/docs/getting-started).
248
+
249
+ ```
250
+ cat > .env <<EOF
251
+ API_SECRET=<YOUR NOTION API SECRET HERE>
252
+ EOF
253
+ ```
254
+
255
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
256
+
257
+ ## Contributing
258
+
259
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mgmarlow/notion-sdk-ruby.
260
+
261
+ ## License
262
+
263
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).