ribose 0.3.1 → 0.5.0

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.
data/README.md DELETED
@@ -1,745 +0,0 @@
1
- # Ribose
2
-
3
- [![Build
4
- Status](https://travis-ci.org/riboseinc/ribose-ruby.svg?branch=master)](https://travis-ci.org/riboseinc/ribose-ruby)
5
- [![Code
6
- Climate](https://codeclimate.com/github/riboseinc/ribose-ruby/badges/gpa.svg)](https://codeclimate.com/github/riboseinc/ribose-ruby)
7
- [![Gem Version](https://badge.fury.io/rb/ribose.svg)](https://badge.fury.io/rb/ribose)
8
-
9
- The Ruby Interface to the Ribose API.
10
-
11
- ## Installation
12
-
13
- Add this line to your application's Gemfile:
14
-
15
- ```ruby
16
- gem "ribose"
17
- ```
18
-
19
- And then execute:
20
-
21
- ```sh
22
- $ bundle install
23
- ```
24
-
25
- Or install it yourself as:
26
-
27
- ```sh
28
- $ gem install ribose
29
- ```
30
-
31
- ## Configure
32
-
33
- We need to setup Ribose API configuration before we can perform any request
34
- throughout this client
35
-
36
- First, obtain an API token [as per this Github wiki](https://github.com/riboseinc/ribose-api/wiki/Obtaining-the-API-Token).
37
- Using the token, configure the client by adding an initializer with the
38
- following code:
39
-
40
- ```ruby
41
- Ribose.configure do |config|
42
- config.api_token = "SECRET_API_TOKEN"
43
- config.user_email = "your-email@example.com"
44
-
45
- # There are also some default configurations. Normally you do not need to
46
- # change those unless you have some very specific use cases.
47
- #
48
- # config.debug_mode = false
49
- # config.api_host = "www.ribose.com"
50
- end
51
- ```
52
-
53
- Or:
54
-
55
- ```ruby
56
- Ribose.configuration.api_token = "SECRET_API_TOKEN"
57
- Ribose.configuration.user_email = "your-email@example.com"
58
- ```
59
-
60
- ## Usage
61
-
62
- ### App Data
63
-
64
- #### List app data
65
-
66
- App data can be retrieved using the `AppData.all` interface.
67
-
68
- ```ruby
69
- Ribose::AppData.all
70
- ```
71
-
72
- ### App Relation
73
-
74
- #### List app relations
75
-
76
- To retrieve the list of app relations, we can use the `AppRelation.all`
77
- interface.
78
-
79
- ```ruby
80
- Ribose::AppRelation.all
81
- ```
82
-
83
- #### Fetch an app relation
84
-
85
- To retrieve the details for a specific app relation, we can use the following
86
- interface.
87
-
88
- ```ruby
89
- Ribose::AppRelation.fetch(app_relation_id)
90
- ```
91
-
92
- ### Profile
93
-
94
- #### Fetch user profile
95
-
96
- ```ruby
97
- Ribose::Profile.fetch
98
- ```
99
-
100
- #### Update user profile
101
-
102
- ```ruby
103
- Ribose::Profile.update(first_name: "John", last_name: "Doe")
104
- ```
105
-
106
- #### Set user login
107
-
108
- ```ruby
109
- Ribose::Profile.set_login(login_name)
110
- ```
111
-
112
- ### Settings
113
-
114
- #### List user's settings
115
-
116
- To list user's settings we can use the `Setting.all` interface, and it will
117
- return all of the user's settings.
118
-
119
- ```ruby
120
- Ribose::Setting.all
121
- ```
122
-
123
- #### Fetch a setting
124
-
125
- To fetch the details for any specific settings we can use the `Setting.fetch`
126
- interface with the specific Setting ID, and it will return the details for that
127
- setting.
128
-
129
- ```ruby
130
- Ribose::Setting.fetch(setting_id)
131
- ```
132
-
133
- #### Update a setting
134
-
135
- ```ruby
136
- Ribose::Setting.update(setting_id, **new_updated_attributes_hash)
137
- ```
138
-
139
- ### Spaces
140
-
141
- #### List user's Spaces
142
-
143
- To list a user's Spaces we can use the `Space.all` interface, and it will
144
- retrieve all of the Spaces for the currently configured user.
145
-
146
- ```ruby
147
- Ribose::Space.all
148
- ```
149
-
150
- #### Fetch a user Space
151
-
152
- To retrieve the details for a Space we can use the `Space.fetch(space_id)`.
153
-
154
- ```ruby
155
- Ribose::Space.fetch(space_id)
156
- ```
157
-
158
- #### Create a user Space
159
-
160
- To create a new user Space,
161
-
162
- ```ruby
163
- Ribose::Space.create(
164
- access: "private",
165
- space_category_id: 12,
166
- name: "The amazing Ribose Space",
167
- description: "Description about your Space"
168
- )
169
- ```
170
-
171
- #### Update a user Space
172
-
173
- ```ruby
174
- Ribose::Space.update("space_uuid", name: "New updated name", **other_attributes)
175
- ```
176
-
177
- #### Remove a user Space
178
-
179
- To remove an existing Space,
180
-
181
- ```ruby
182
- Ribose::Space.remove(space_uuid, confirmation: true)
183
- ```
184
-
185
- ### Members
186
-
187
- The members endpoint are Space-specific.
188
-
189
- To retrieve the member details under any specific Space, we can use this
190
- interface.
191
-
192
- #### List space members
193
-
194
- To retrieve the list of members,
195
-
196
- ```ruby
197
- Ribose::Member.all(space_id, options)
198
- ```
199
-
200
- #### Delete a space member
201
-
202
- ```ruby
203
- Ribose::Member.delete(space_id, member_id, options)
204
- ```
205
-
206
- #### Fetch Member Role
207
-
208
- ```ruby
209
- Ribose::MemberRole.fetch(space_id, member_id, options)
210
- ```
211
-
212
- #### Assign a role to member
213
-
214
- ```ruby
215
- Ribose::MemberRole.assign(space_id, member_id, role_id)
216
- ```
217
-
218
- ### Files
219
-
220
- #### List of Files
221
-
222
- To retrieve the list of files for any specific Space,
223
-
224
- ```ruby
225
- Ribose::SpaceFile.all(space_id, options)
226
- ```
227
-
228
- #### Fetch a file details
229
-
230
- ```ruby
231
- Ribose::SpaceFile.fetch(space_id, file_id, options = {})
232
- ```
233
-
234
- #### Fetch a file icon
235
-
236
- ```ruby
237
- Ribose::SpaceFile.fetch_icon(space_id, file_id, options = {})
238
- ```
239
-
240
- #### Create a file upload
241
-
242
- ```ruby
243
- Ribose::SpaceFile.create(space_id, file: "The complete file path", **attributes)
244
- ```
245
-
246
- #### Update a space file
247
-
248
- ```ruby
249
- Ribose::SpaceFile.update(space_id, file_id, new_file_attributes = {})
250
- ```
251
-
252
- #### Remove a space file
253
-
254
- ```ruby
255
- Ribose::SpaceFile.delete(space_id, file_id)
256
- ```
257
-
258
- ### File Version
259
-
260
- #### Fetch file version
261
-
262
- ```ruby
263
- Ribose::FileVersion.fetch(
264
- space_id: space_id, file_id: file_id, version_id: version_id
265
- )
266
- ```
267
-
268
- ### Conversations
269
-
270
- #### Listing Space Conversations
271
-
272
- ```ruby
273
- Ribose::Conversation.all(space_id, options = {})
274
- ```
275
-
276
- #### Retrieve a conversation details
277
-
278
- ```ruby
279
- Ribose::Conversation.fetch(space_id, conversation_id)
280
- ```
281
-
282
- #### Create A New Conversation
283
-
284
- ```ruby
285
- Ribose::Conversation.create(
286
- space_id, name: "Sample conversation", tag_list: "sample, conversation"
287
- )
288
- ```
289
-
290
- #### Update a conversation
291
-
292
- ```ruby
293
- Ribose::Conversation.update(space_id, conversation_id, new_attributes_hash)
294
- ```
295
-
296
- #### Remove A Conversation
297
-
298
- ```ruby
299
- Ribose::Conversation.destroy(space_id: "space_id", conversation_id: "12345")
300
- ```
301
-
302
- #### Mark a conversation as favorite
303
-
304
- ```ruby
305
- Ribose::Conversation.mark_as_favorite(space_id, conversation_id)
306
- ```
307
-
308
- ### Message
309
-
310
- #### List Conversation Messages
311
-
312
- ```ruby
313
- Ribose::Message.all(space_id: space_uuid, conversation_id: conversation_uuid)
314
- ```
315
-
316
- #### Create a new message
317
-
318
- ```ruby
319
- Ribose::Message.create(
320
- space_id: space_uuid,
321
- conversation_id: conversation_uuid,
322
- contents: "Provide your message body here",
323
- )
324
- ```
325
-
326
- #### Update an existing message
327
-
328
- ```ruby
329
- Ribose::Message.update(
330
- space_id: space_uuid,
331
- message_id: message_uuid,
332
- conversation_id: conversation_uuid,
333
- contents: "The new content for message",
334
- )
335
- ```
336
-
337
- #### Remove a message
338
-
339
- ```ruby
340
- Ribose::Message.remove(
341
- space_id: space_uuid,
342
- message_id: message_uuid,
343
- conversation_id: conversation_uuid,
344
- )
345
- ```
346
-
347
- ### Feeds
348
-
349
- #### List user feeds
350
-
351
- To retrieve the list of user feeds,
352
-
353
- ```ruby
354
- Ribose::Feed.all
355
- ```
356
-
357
- ### Widgets
358
-
359
- #### List widgets
360
-
361
- To retrieve the list of widgets,
362
-
363
- ```ruby
364
- Ribose::Widget.all
365
- ```
366
-
367
- ### Stream
368
-
369
- #### List of stream notifications
370
-
371
- To retrieve the list of notifications,
372
-
373
- ```ruby
374
- Ribose::Stream.all
375
- ```
376
-
377
- ### Leaderboard
378
-
379
- #### Retrieve the current leadership board
380
-
381
- To retrieve the current leadership board,
382
-
383
- ```ruby
384
- Ribose::Leaderboard.all
385
- ```
386
-
387
- ### Connections
388
-
389
- #### List of connections
390
-
391
- To retrieve the list of connections, we can use the `Connection.all` interface
392
- and it will return the connection as `Sawyer::Resource`.
393
-
394
- ```ruby
395
- Ribose::Connection.all
396
- ```
397
-
398
- #### Connection suggestions
399
-
400
- To retrieve the list of user connection suggestions,
401
-
402
- ```ruby
403
- Ribose::Connection.suggestions
404
- ```
405
-
406
- ### Invitations
407
-
408
- #### List connection invitations
409
-
410
- ```ruby
411
- Ribose::ConnectionInvitation.all
412
- ```
413
-
414
- #### List Space invitations
415
-
416
- ```ruby
417
- Ribose::SpaceInvitation.all
418
- ```
419
-
420
- #### Fetch a connection invitation
421
-
422
- ```ruby
423
- Ribose::ConnectionInvitation.fetch(invitation_id)
424
- ```
425
-
426
- #### Create mass connection invitations
427
-
428
- ```ruby
429
- Ribose::ConnectionInvitation.create(
430
- emails: ["email-one@example.com", "email-two@example.com"],
431
- body: "This contains the details message about the invitation",
432
- )
433
- ```
434
-
435
- #### Accept a connection invitation
436
-
437
- ```ruby
438
- Ribose::ConnectionInvitation.accept(invitation_id)
439
- ```
440
-
441
- #### Reject a connection invitation
442
-
443
- ```ruby
444
- Ribose::ConnectionInvitation.reject(invitation_id)
445
- ```
446
-
447
- #### Cancel a connection invitation
448
-
449
- ```ruby
450
- Ribose::ConnectionInvitation.cancel(invitation_id)
451
- ```
452
-
453
- #### Invite user to a Space
454
-
455
- ```ruby
456
- Ribose::SpaceInvitation.create(
457
- state: "0",
458
- space_id: "123_456_789",
459
- invitee_id: "456_789_012",
460
- type: "Invitation::ToSpace",
461
- body: "Please join to this amazing Space",
462
- )
463
- ```
464
-
465
- #### Create Space invitation - Mass
466
-
467
- ```ruby
468
- Ribose::SpaceInvitation.mass_create(
469
- space_id,
470
- emails: ["email-one@example.com"],
471
- role_ids: ["role-for-email-address-in-sequance"],
472
- body: "The complete message body for the invitation",
473
- )
474
- ```
475
-
476
- #### Update a Space invitation
477
-
478
- ```ruby
479
- Ribose::SpaceInvitation.update(invitation_id, new_attributes_hash)
480
- ```
481
-
482
- #### Accept a Space invitation
483
-
484
- ```ruby
485
- Ribose::SpaceInvitation.accept(invitation_id)
486
- ```
487
-
488
- #### Resend a Space invitation
489
-
490
- ```ruby
491
- Ribose::SpaceInvitation.resend(invitation_id)
492
- ```
493
-
494
- #### Reject a Space invitation
495
-
496
- ```ruby
497
- Ribose::SpaceInvitation.reject(invitation_id)
498
- ```
499
-
500
- #### Cancel a Space invitation
501
-
502
- ```ruby
503
- Ribose::SpaceInvitation.cancel(invitation_id)
504
- ```
505
-
506
- ### Join Space Request
507
-
508
- #### List Join Space Requests
509
-
510
- ```ruby
511
- Ribose::JoinSpaceRequest.all
512
- ```
513
-
514
- #### Fetch a join space request
515
-
516
- ```ruby
517
- Ribose::JoinSpaceRequest.fetch(request_id)
518
- ```
519
-
520
- #### Create a Join Space Request
521
-
522
- ```ruby
523
- Ribose::JoinSpaceRequest.create(
524
- state: 0,
525
- Space_id: 123_456_789,
526
- type: "Invitation::JoinSpaceRequest",
527
- body: "Hi, I would like to join to your Space",
528
- )
529
- ```
530
-
531
- #### Accept a Join Space Request
532
-
533
- ```ruby
534
- Ribose::JoinSpaceRequest.accept(invitation_id)
535
- ```
536
-
537
- #### Reject a Join Space Requests
538
-
539
- ```ruby
540
- Ribose::JoinSpaceRequest.reject(invitation_id)
541
- ```
542
-
543
- #### Update an Join Space Requests
544
-
545
- ```ruby
546
- Ribose::JoinSpaceRequest.update(invitation_id, new_attributes_hash)
547
- ```
548
-
549
- ### Calendar
550
-
551
- #### List user calendars
552
-
553
- To retrieve the list of calendars accessible to the current user,
554
-
555
- ```ruby
556
- Ribose::Calendar.all
557
- ```
558
-
559
- #### Fetch a calendar events
560
-
561
- ```ruby
562
- Ribose::Calendar.fetch(calendar_ids, start: Data.today, length: 7)
563
- ```
564
-
565
- #### Create a calendar
566
-
567
- ```ruby
568
- Ribose::Calendar.create(
569
- owner_type: "User",
570
- owner_id: "The Owner UUID",
571
- name: "The name for the calendar",
572
- )
573
- ```
574
-
575
- #### Delete a calendar
576
-
577
- ```ruby
578
- Ribose::Calendar.delete(calendar_id)
579
- ```
580
-
581
- ### Event
582
-
583
- #### List calendar events
584
-
585
- ```ruby
586
- Ribose::Event.all(calendar_id)
587
- ```
588
-
589
- #### Fetch a calendar event
590
-
591
- ```ruby
592
- Ribose::Event.fetch(calendar_id, event_id)
593
- ```
594
-
595
- #### Create a calendar event
596
-
597
- ```ruby
598
- Ribose::Event.create(
599
- calendar_id,
600
- name: "Sample Event",
601
- date_start: "04/04/2018",
602
- time_start: "4:30pm",
603
- date_finish: "04/04/2018",
604
- time_finish: "5:30pm",
605
- recurring_type: "not_repeat",
606
- until: "never",
607
- repeat_every: "1",
608
- where: "Skype",
609
- description: "Sample event",
610
- all_day: false,
611
- )
612
- ```
613
-
614
- #### Update a calendar event
615
-
616
- ```ruby
617
- Ribose::Event.update(
618
- calendar_id, event_id, new_attributes_hash, options_params
619
- )
620
- ```
621
-
622
- #### Delete a calendar event
623
-
624
- ```ruby
625
- Ribose::Event.delete(calendar_id, event_id)
626
- ```
627
-
628
- ### User
629
-
630
- #### Create a signup request
631
-
632
- ```ruby
633
- Ribose::User.create(email: "user@example.com", **other_attributes)
634
- ```
635
-
636
- #### Activate a signup request
637
-
638
- ```ruby
639
- Ribose::User.activate(
640
- email: "user@example.com",
641
- password: "ASecureUserPassword",
642
- otp: "OTP Recived via the Email",
643
- )
644
- ```
645
-
646
- ### Wikis
647
-
648
- #### List wiki pages
649
-
650
- ```ruby
651
- Ribose::Wiki.all(space_id, options = {})
652
- ```
653
-
654
- #### Fetch a wiki page
655
-
656
- ```ruby
657
- Ribose::Wiki.fetch(space_id, wiki_id, options = {})
658
- ```
659
-
660
- #### Create a wiki page
661
-
662
- ```ruby
663
- Ribose::Wiki.create(
664
- space_id, name: "Wiki Name", tag_list: "sample", **other_attributes_hash
665
- )
666
- ```
667
-
668
- #### Update a wiki page
669
-
670
- ```ruby
671
- Ribose::Wiki.update(
672
- space_id, wiki_id, **updated_attributes_hash
673
- )
674
- ```
675
-
676
- #### Remove a wiki page
677
-
678
- ```ruby
679
- Ribose::Wiki.delete(space_id, wiki_id)
680
- ```
681
-
682
- ### Space categories
683
-
684
- #### List space categories
685
-
686
- ```ruby
687
- Ribose::SpaceCategory.all
688
- ```
689
-
690
- ## Development
691
-
692
- We are following Sandi Metz's Rules for this gem, you can read the
693
- [description of the rules here][sandi-metz] All new code should follow these
694
- rules. If you make changes in a pre-existing file that violates these rules you
695
- should fix the violations as part of your contribution.
696
-
697
- ### Setup
698
-
699
- Clone the repository.
700
-
701
- ```sh
702
- git clone https://github.com/riboseinc/ribose-ruby
703
- ```
704
-
705
- Setup your environment.
706
-
707
- ```sh
708
- bin/setup
709
- ```
710
-
711
- Run the test suite
712
-
713
- ```sh
714
- bin/rspec
715
- ```
716
-
717
- ## Contributing
718
-
719
- First, thank you for contributing! We love pull requests from everyone. By
720
- participating in this project, you hereby grant [Ribose Inc.][riboseinc] the
721
- right to grant or transfer an unlimited number of non exclusive licenses or
722
- sub-licenses to third parties, under the copyright covering the contribution
723
- to use the contribution by all means.
724
-
725
- Here are a few technical guidelines to follow:
726
-
727
- 1. Open an [issue][issues] to discuss a new feature.
728
- 1. Write tests to support your new feature.
729
- 1. Make sure the entire test suite passes locally and on CI.
730
- 1. Open a Pull Request.
731
- 1. [Squash your commits][squash] after receiving feedback.
732
- 1. Party!
733
-
734
- ## Credits
735
-
736
- This gem is developed, maintained and funded by [Ribose Inc.][riboseinc]
737
-
738
- ## License
739
-
740
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
741
-
742
- [riboseinc]: https://www.ribose.com
743
- [issues]: https://github.com/riboseinc/ribose-ruby/issues
744
- [squash]: https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature
745
- [sandi-metz]: http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers