flat_api 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +34 -12
  4. data/docs/ClassApi.md +2 -2
  5. data/docs/Collection.md +18 -0
  6. data/docs/CollectionApi.md +521 -0
  7. data/docs/CollectionCapabilities.md +12 -0
  8. data/docs/CollectionCreation.md +8 -0
  9. data/docs/CollectionModification.md +8 -0
  10. data/docs/CollectionPrivacy.md +7 -0
  11. data/docs/CollectionTitle.md +7 -0
  12. data/docs/CollectionType.md +7 -0
  13. data/docs/ResourceCollaborator.md +16 -0
  14. data/docs/{ScoreCollaboratorCreation.md → ResourceCollaboratorCreation.md} +2 -1
  15. data/docs/ResourceRights.md +10 -0
  16. data/docs/ResourceSharingKey.md +7 -0
  17. data/docs/ScoreApi.md +144 -91
  18. data/docs/ScoreCreation.md +2 -1
  19. data/docs/ScoreDetails.md +2 -2
  20. data/docs/ScoreFork.md +1 -0
  21. data/docs/ScoreModification.md +2 -1
  22. data/docs/UserApi.md +1 -1
  23. data/flat_api.gemspec +1 -1
  24. data/lib/flat_api.rb +13 -4
  25. data/lib/flat_api/api/account_api.rb +1 -1
  26. data/lib/flat_api/api/class_api.rb +1 -1
  27. data/lib/flat_api/api/collection_api.rb +596 -0
  28. data/lib/flat_api/api/group_api.rb +1 -1
  29. data/lib/flat_api/api/organization_api.rb +1 -1
  30. data/lib/flat_api/api/score_api.rb +125 -53
  31. data/lib/flat_api/api/user_api.rb +3 -3
  32. data/lib/flat_api/api_client.rb +1 -1
  33. data/lib/flat_api/api_error.rb +1 -1
  34. data/lib/flat_api/configuration.rb +1 -1
  35. data/lib/flat_api/models/assignment.rb +1 -1
  36. data/lib/flat_api/models/assignment_copy.rb +1 -1
  37. data/lib/flat_api/models/assignment_creation.rb +1 -1
  38. data/lib/flat_api/models/assignment_submission.rb +1 -1
  39. data/lib/flat_api/models/assignment_submission_update.rb +1 -1
  40. data/lib/flat_api/models/class_attachment_creation.rb +1 -1
  41. data/lib/flat_api/models/class_creation.rb +1 -1
  42. data/lib/flat_api/models/class_details.rb +1 -1
  43. data/lib/flat_api/models/class_details_canvas.rb +1 -1
  44. data/lib/flat_api/models/class_details_clever.rb +1 -1
  45. data/lib/flat_api/models/class_details_google_classroom.rb +1 -1
  46. data/lib/flat_api/models/class_details_google_drive.rb +1 -1
  47. data/lib/flat_api/models/class_details_lti.rb +1 -1
  48. data/lib/flat_api/models/class_roles.rb +1 -1
  49. data/lib/flat_api/models/class_state.rb +1 -1
  50. data/lib/flat_api/models/class_update.rb +1 -1
  51. data/lib/flat_api/models/collection.rb +285 -0
  52. data/lib/flat_api/models/collection_capabilities.rb +229 -0
  53. data/lib/flat_api/models/collection_creation.rb +193 -0
  54. data/lib/flat_api/models/collection_modification.rb +188 -0
  55. data/lib/flat_api/models/collection_privacy.rb +30 -0
  56. data/lib/flat_api/models/collection_title.rb +179 -0
  57. data/lib/flat_api/models/collection_type.rb +34 -0
  58. data/lib/flat_api/models/flat_error_response.rb +1 -1
  59. data/lib/flat_api/models/flat_locales.rb +1 -1
  60. data/lib/flat_api/models/google_classroom_coursework.rb +1 -1
  61. data/lib/flat_api/models/google_classroom_submission.rb +1 -1
  62. data/lib/flat_api/models/group.rb +1 -1
  63. data/lib/flat_api/models/group_details.rb +1 -1
  64. data/lib/flat_api/models/group_type.rb +1 -1
  65. data/lib/flat_api/models/license_mode.rb +1 -1
  66. data/lib/flat_api/models/license_sources.rb +1 -1
  67. data/lib/flat_api/models/lms_name.rb +1 -1
  68. data/lib/flat_api/models/lti_credentials.rb +1 -1
  69. data/lib/flat_api/models/lti_credentials_creation.rb +1 -1
  70. data/lib/flat_api/models/media_attachment.rb +1 -1
  71. data/lib/flat_api/models/media_score_sharing_mode.rb +1 -1
  72. data/lib/flat_api/models/organization_invitation.rb +1 -1
  73. data/lib/flat_api/models/organization_invitation_creation.rb +1 -1
  74. data/lib/flat_api/models/organization_roles.rb +1 -1
  75. data/lib/flat_api/models/{score_collaborator.rb → resource_collaborator.rb} +54 -44
  76. data/lib/flat_api/models/{score_collaborator_creation.rb → resource_collaborator_creation.rb} +14 -4
  77. data/lib/flat_api/models/{score_rights.rb → resource_rights.rb} +6 -6
  78. data/lib/flat_api/models/resource_sharing_key.rb +179 -0
  79. data/lib/flat_api/models/score_comment.rb +1 -1
  80. data/lib/flat_api/models/score_comment_context.rb +1 -1
  81. data/lib/flat_api/models/score_comment_creation.rb +1 -1
  82. data/lib/flat_api/models/score_comment_update.rb +1 -1
  83. data/lib/flat_api/models/score_comments_counts.rb +1 -1
  84. data/lib/flat_api/models/score_creation.rb +13 -3
  85. data/lib/flat_api/models/score_creation_type.rb +1 -1
  86. data/lib/flat_api/models/score_data.rb +1 -1
  87. data/lib/flat_api/models/score_data_encoding.rb +1 -1
  88. data/lib/flat_api/models/score_details.rb +3 -3
  89. data/lib/flat_api/models/score_fork.rb +13 -3
  90. data/lib/flat_api/models/score_license.rb +1 -1
  91. data/lib/flat_api/models/score_likes_counts.rb +1 -1
  92. data/lib/flat_api/models/score_modification.rb +13 -20
  93. data/lib/flat_api/models/score_privacy.rb +1 -1
  94. data/lib/flat_api/models/score_revision.rb +1 -1
  95. data/lib/flat_api/models/score_revision_creation.rb +1 -1
  96. data/lib/flat_api/models/score_revision_statistics.rb +1 -1
  97. data/lib/flat_api/models/score_source.rb +1 -1
  98. data/lib/flat_api/models/score_summary.rb +1 -1
  99. data/lib/flat_api/models/score_track.rb +1 -1
  100. data/lib/flat_api/models/score_track_creation.rb +1 -1
  101. data/lib/flat_api/models/score_track_point.rb +1 -1
  102. data/lib/flat_api/models/score_track_state.rb +1 -1
  103. data/lib/flat_api/models/score_track_type.rb +1 -1
  104. data/lib/flat_api/models/score_track_update.rb +1 -1
  105. data/lib/flat_api/models/score_views_counts.rb +1 -1
  106. data/lib/flat_api/models/user_admin_update.rb +1 -1
  107. data/lib/flat_api/models/user_basics.rb +1 -1
  108. data/lib/flat_api/models/user_creation.rb +1 -1
  109. data/lib/flat_api/models/user_details.rb +1 -1
  110. data/lib/flat_api/models/user_details_admin.rb +1 -1
  111. data/lib/flat_api/models/user_details_admin_license.rb +1 -1
  112. data/lib/flat_api/models/user_instruments.rb +1 -1
  113. data/lib/flat_api/models/user_public.rb +1 -1
  114. data/lib/flat_api/models/user_public_summary.rb +1 -1
  115. data/lib/flat_api/version.rb +2 -2
  116. data/spec/api/account_api_spec.rb +2 -2
  117. data/spec/api/class_api_spec.rb +2 -2
  118. data/spec/api/collection_api_spec.rb +159 -0
  119. data/spec/api/group_api_spec.rb +2 -2
  120. data/spec/api/organization_api_spec.rb +2 -2
  121. data/spec/api/score_api_spec.rb +41 -26
  122. data/spec/api/user_api_spec.rb +3 -3
  123. data/spec/api_client_spec.rb +2 -2
  124. data/spec/configuration_spec.rb +2 -2
  125. data/spec/models/assignment_copy_spec.rb +2 -2
  126. data/spec/models/assignment_creation_spec.rb +2 -2
  127. data/spec/models/assignment_spec.rb +2 -2
  128. data/spec/models/assignment_submission_spec.rb +2 -2
  129. data/spec/models/assignment_submission_update_spec.rb +2 -2
  130. data/spec/models/class_attachment_creation_spec.rb +2 -2
  131. data/spec/models/class_creation_spec.rb +2 -2
  132. data/spec/models/class_details_canvas_spec.rb +2 -2
  133. data/spec/models/class_details_clever_spec.rb +2 -2
  134. data/spec/models/class_details_google_classroom_spec.rb +2 -2
  135. data/spec/models/class_details_google_drive_spec.rb +2 -2
  136. data/spec/models/class_details_lti_spec.rb +2 -2
  137. data/spec/models/class_details_spec.rb +2 -2
  138. data/spec/models/class_roles_spec.rb +2 -2
  139. data/spec/models/class_state_spec.rb +2 -2
  140. data/spec/models/class_update_spec.rb +2 -2
  141. data/spec/models/collection_capabilities_spec.rb +66 -0
  142. data/spec/models/collection_creation_spec.rb +42 -0
  143. data/spec/models/collection_modification_spec.rb +42 -0
  144. data/spec/models/collection_privacy_spec.rb +36 -0
  145. data/spec/models/collection_spec.rb +102 -0
  146. data/spec/models/collection_title_spec.rb +36 -0
  147. data/spec/models/collection_type_spec.rb +36 -0
  148. data/spec/models/flat_error_response_spec.rb +2 -2
  149. data/spec/models/flat_locales_spec.rb +2 -2
  150. data/spec/models/google_classroom_coursework_spec.rb +2 -2
  151. data/spec/models/google_classroom_submission_spec.rb +2 -2
  152. data/spec/models/group_details_spec.rb +2 -2
  153. data/spec/models/group_spec.rb +2 -2
  154. data/spec/models/group_type_spec.rb +2 -2
  155. data/spec/models/license_mode_spec.rb +2 -2
  156. data/spec/models/license_sources_spec.rb +2 -2
  157. data/spec/models/lms_name_spec.rb +2 -2
  158. data/spec/models/lti_credentials_creation_spec.rb +2 -2
  159. data/spec/models/lti_credentials_spec.rb +2 -2
  160. data/spec/models/media_attachment_spec.rb +2 -2
  161. data/spec/models/media_score_sharing_mode_spec.rb +2 -2
  162. data/spec/models/organization_invitation_creation_spec.rb +2 -2
  163. data/spec/models/organization_invitation_spec.rb +2 -2
  164. data/spec/models/organization_roles_spec.rb +2 -2
  165. data/spec/models/{score_collaborator_creation_spec.rb → resource_collaborator_creation_spec.rb} +14 -8
  166. data/spec/models/{score_collaborator_spec.rb → resource_collaborator_spec.rb} +22 -16
  167. data/spec/models/{score_rights_spec.rb → resource_rights_spec.rb} +14 -8
  168. data/spec/models/resource_sharing_key_spec.rb +36 -0
  169. data/spec/models/score_comment_context_spec.rb +2 -2
  170. data/spec/models/score_comment_creation_spec.rb +2 -2
  171. data/spec/models/score_comment_spec.rb +2 -2
  172. data/spec/models/score_comment_update_spec.rb +2 -2
  173. data/spec/models/score_comments_counts_spec.rb +2 -2
  174. data/spec/models/score_creation_spec.rb +8 -2
  175. data/spec/models/score_creation_type_spec.rb +2 -2
  176. data/spec/models/score_data_encoding_spec.rb +2 -2
  177. data/spec/models/score_data_spec.rb +2 -2
  178. data/spec/models/score_details_spec.rb +2 -2
  179. data/spec/models/score_fork_spec.rb +8 -2
  180. data/spec/models/score_license_spec.rb +2 -2
  181. data/spec/models/score_likes_counts_spec.rb +2 -2
  182. data/spec/models/score_modification_spec.rb +8 -2
  183. data/spec/models/score_privacy_spec.rb +2 -2
  184. data/spec/models/score_revision_creation_spec.rb +2 -2
  185. data/spec/models/score_revision_spec.rb +2 -2
  186. data/spec/models/score_revision_statistics_spec.rb +2 -2
  187. data/spec/models/score_source_spec.rb +2 -2
  188. data/spec/models/score_summary_spec.rb +2 -2
  189. data/spec/models/score_track_creation_spec.rb +2 -2
  190. data/spec/models/score_track_point_spec.rb +2 -2
  191. data/spec/models/score_track_spec.rb +2 -2
  192. data/spec/models/score_track_state_spec.rb +2 -2
  193. data/spec/models/score_track_type_spec.rb +2 -2
  194. data/spec/models/score_track_update_spec.rb +2 -2
  195. data/spec/models/score_views_counts_spec.rb +2 -2
  196. data/spec/models/user_admin_update_spec.rb +2 -2
  197. data/spec/models/user_basics_spec.rb +2 -2
  198. data/spec/models/user_creation_spec.rb +2 -2
  199. data/spec/models/user_details_admin_license_spec.rb +2 -2
  200. data/spec/models/user_details_admin_spec.rb +2 -2
  201. data/spec/models/user_details_spec.rb +2 -2
  202. data/spec/models/user_instruments_spec.rb +2 -2
  203. data/spec/models/user_public_spec.rb +2 -2
  204. data/spec/models/user_public_summary_spec.rb +2 -2
  205. data/spec/spec_helper.rb +2 -2
  206. metadata +50 -15
  207. data/docs/ScoreCollaborator.md +0 -15
  208. data/docs/ScoreRights.md +0 -10
  209. data/git_push.sh +0 -55
@@ -3,11 +3,12 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
- **title** | **String** | The title of the new score. If this title is not specified, the API will try to (in this order): - Use the name of the file for files from a specified `source` (e.g. Google Drive) - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Set a default title (e.g. \"New Music Score\") If the title is already used, the API will append the creation date after the title. If the title is too long, the API may trim this one. | [optional]
6
+ **title** | **String** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the name of the file for files from a specified `source` (e.g. Google Drive) - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Set a default title (e.g. \"New Music Score\") | [optional]
7
7
  **privacy** | [**ScorePrivacy**](ScorePrivacy.md) | |
8
8
  **data** | [**ScoreData**](ScoreData.md) | | [optional]
9
9
  **data_encoding** | [**ScoreDataEncoding**](ScoreDataEncoding.md) | | [optional]
10
10
  **source** | [**ScoreSource**](ScoreSource.md) | | [optional]
11
+ **collection** | **String** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will be stored in the `root` directory. | [optional]
11
12
  **google_drive_folder** | **String** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional]
12
13
 
13
14
 
@@ -20,8 +20,8 @@ Name | Type | Description | Notes
20
20
  **duration_time** | **Integer** | In seconds, an approximative duration of the score | [optional]
21
21
  **number_measures** | **Integer** | The number of measures in the score | [optional]
22
22
  **main_tempo_qpm** | **Integer** | The main tempo of the score (in QPM) | [optional]
23
- **rights** | [**ScoreRights**](ScoreRights.md) | | [optional]
24
- **collaborators** | [**Array<ScoreCollaborator>**](ScoreCollaborator.md) | The list of the collaborators of the score | [optional]
23
+ **rights** | [**ResourceRights**](ResourceRights.md) | | [optional]
24
+ **collaborators** | [**Array<ResourceCollaborator>**](ResourceCollaborator.md) | The list of the collaborators of the score | [optional]
25
25
  **creation_date** | **DateTime** | The date when the score was created | [optional]
26
26
  **modification_date** | **DateTime** | The date of the last revision of the score | [optional]
27
27
  **publication_date** | **DateTime** | The date when the score was published on Flat | [optional]
@@ -3,5 +3,6 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **collection** | **String** | Unique identifier of a collection where the score will be copied. If no collection identifier is provided, the score will be stored in the `root` directory. | [optional]
6
7
 
7
8
 
@@ -3,8 +3,9 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **title** | **String** | The title of the score | [optional]
6
7
  **privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional]
7
- **sharing_key** | **String** | When using the `privacy` mode `privateLink`, this property can be used to set a custom sharing key, otherwise a new key will be generated. | [optional]
8
+ **sharing_key** | [**ResourceSharingKey**](ResourceSharingKey.md) | | [optional]
8
9
  **description** | **String** | Description of the creation | [optional]
9
10
  **tags** | **Array<String>** | Tags describing the score | [optional]
10
11
  **creation_type** | [**ScoreCreationType**](ScoreCreationType.md) | | [optional]
@@ -120,7 +120,7 @@ Name | Type | Description | Notes
120
120
 
121
121
  List user's scores
122
122
 
123
- Get the list of scores owned by the User
123
+ Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead.
124
124
 
125
125
  ### Example
126
126
  ```ruby
@@ -5,7 +5,7 @@
5
5
 
6
6
  #The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
7
7
 
8
- OpenAPI spec version: 2.5.2
8
+ OpenAPI spec version: 2.6.0
9
9
  Contact: developers@flat.io
10
10
  Generated by: https://github.com/swagger-api/swagger-codegen.git
11
11
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
5
5
 
6
- OpenAPI spec version: 2.5.2
6
+ OpenAPI spec version: 2.6.0
7
7
  Contact: developers@flat.io
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -33,6 +33,13 @@ require 'flat_api/models/class_details_lti'
33
33
  require 'flat_api/models/class_roles'
34
34
  require 'flat_api/models/class_state'
35
35
  require 'flat_api/models/class_update'
36
+ require 'flat_api/models/collection'
37
+ require 'flat_api/models/collection_capabilities'
38
+ require 'flat_api/models/collection_creation'
39
+ require 'flat_api/models/collection_modification'
40
+ require 'flat_api/models/collection_privacy'
41
+ require 'flat_api/models/collection_title'
42
+ require 'flat_api/models/collection_type'
36
43
  require 'flat_api/models/flat_error_response'
37
44
  require 'flat_api/models/flat_locales'
38
45
  require 'flat_api/models/google_classroom_coursework'
@@ -50,8 +57,9 @@ require 'flat_api/models/media_score_sharing_mode'
50
57
  require 'flat_api/models/organization_invitation'
51
58
  require 'flat_api/models/organization_invitation_creation'
52
59
  require 'flat_api/models/organization_roles'
53
- require 'flat_api/models/score_collaborator'
54
- require 'flat_api/models/score_collaborator_creation'
60
+ require 'flat_api/models/resource_collaborator_creation'
61
+ require 'flat_api/models/resource_rights'
62
+ require 'flat_api/models/resource_sharing_key'
55
63
  require 'flat_api/models/score_comment'
56
64
  require 'flat_api/models/score_comment_context'
57
65
  require 'flat_api/models/score_comment_creation'
@@ -69,7 +77,6 @@ require 'flat_api/models/score_privacy'
69
77
  require 'flat_api/models/score_revision'
70
78
  require 'flat_api/models/score_revision_creation'
71
79
  require 'flat_api/models/score_revision_statistics'
72
- require 'flat_api/models/score_rights'
73
80
  require 'flat_api/models/score_source'
74
81
  require 'flat_api/models/score_summary'
75
82
  require 'flat_api/models/score_track'
@@ -84,6 +91,7 @@ require 'flat_api/models/user_basics'
84
91
  require 'flat_api/models/user_creation'
85
92
  require 'flat_api/models/user_details_admin_license'
86
93
  require 'flat_api/models/user_instruments'
94
+ require 'flat_api/models/resource_collaborator'
87
95
  require 'flat_api/models/score_details'
88
96
  require 'flat_api/models/user_public_summary'
89
97
  require 'flat_api/models/user_details_admin'
@@ -93,6 +101,7 @@ require 'flat_api/models/user_details'
93
101
  # APIs
94
102
  require 'flat_api/api/account_api'
95
103
  require 'flat_api/api/class_api'
104
+ require 'flat_api/api/collection_api'
96
105
  require 'flat_api/api/group_api'
97
106
  require 'flat_api/api/organization_api'
98
107
  require 'flat_api/api/score_api'
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
5
5
 
6
- OpenAPI spec version: 2.5.2
6
+ OpenAPI spec version: 2.6.0
7
7
  Contact: developers@flat.io
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
5
5
 
6
- OpenAPI spec version: 2.5.2
6
+ OpenAPI spec version: 2.6.0
7
7
  Contact: developers@flat.io
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -0,0 +1,596 @@
1
+ =begin
2
+ #Flat API
3
+
4
+ #The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML or MIDI files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and interoduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html)
5
+
6
+ OpenAPI spec version: 2.6.0
7
+ Contact: developers@flat.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module FlatApi
16
+ class CollectionApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Add a score to the collection
24
+ # This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action.
25
+ # @param collection Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted
26
+ # @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
29
+ # @return [ScoreDetails]
30
+ def add_score_to_collection(collection, score, opts = {})
31
+ data, _status_code, _headers = add_score_to_collection_with_http_info(collection, score, opts)
32
+ return data
33
+ end
34
+
35
+ # Add a score to the collection
36
+ # This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action.
37
+ # @param collection Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted
38
+ # @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
41
+ # @return [Array<(ScoreDetails, Fixnum, Hash)>] ScoreDetails data, response status code and response headers
42
+ def add_score_to_collection_with_http_info(collection, score, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug "Calling API: CollectionApi.add_score_to_collection ..."
45
+ end
46
+ # verify the required parameter 'collection' is set
47
+ if @api_client.config.client_side_validation && collection.nil?
48
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.add_score_to_collection"
49
+ end
50
+ # verify the required parameter 'score' is set
51
+ if @api_client.config.client_side_validation && score.nil?
52
+ fail ArgumentError, "Missing the required parameter 'score' when calling CollectionApi.add_score_to_collection"
53
+ end
54
+ # resource path
55
+ local_var_path = "/collections/{collection}/scores/{score}".sub('{' + 'collection' + '}', collection.to_s).sub('{' + 'score' + '}', score.to_s)
56
+
57
+ # query parameters
58
+ query_params = {}
59
+ query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?
60
+
61
+ # header parameters
62
+ header_params = {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+ # HTTP header 'Content-Type'
66
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = {}
70
+
71
+ # http body (model)
72
+ post_body = nil
73
+ auth_names = ['OAuth2']
74
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => 'ScoreDetails')
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: CollectionApi#add_score_to_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+
87
+ # Create a new collection
88
+ # This method will create a new collection and add it to your `root` collection.
89
+ # @param body
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Collection]
92
+ def create_collection(body, opts = {})
93
+ data, _status_code, _headers = create_collection_with_http_info(body, opts)
94
+ return data
95
+ end
96
+
97
+ # Create a new collection
98
+ # This method will create a new collection and add it to your &#x60;root&#x60; collection.
99
+ # @param body
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(Collection, Fixnum, Hash)>] Collection data, response status code and response headers
102
+ def create_collection_with_http_info(body, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "Calling API: CollectionApi.create_collection ..."
105
+ end
106
+ # verify the required parameter 'body' is set
107
+ if @api_client.config.client_side_validation && body.nil?
108
+ fail ArgumentError, "Missing the required parameter 'body' when calling CollectionApi.create_collection"
109
+ end
110
+ # resource path
111
+ local_var_path = "/collections"
112
+
113
+ # query parameters
114
+ query_params = {}
115
+
116
+ # header parameters
117
+ header_params = {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
120
+ # HTTP header 'Content-Type'
121
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
122
+
123
+ # form parameters
124
+ form_params = {}
125
+
126
+ # http body (model)
127
+ post_body = @api_client.object_to_http_body(body)
128
+ auth_names = ['OAuth2']
129
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
130
+ :header_params => header_params,
131
+ :query_params => query_params,
132
+ :form_params => form_params,
133
+ :body => post_body,
134
+ :auth_names => auth_names,
135
+ :return_type => 'Collection')
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: CollectionApi#create_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+
142
+ # Delete the collection
143
+ # This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`.
144
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [nil]
147
+ def delete_collection(collection, opts = {})
148
+ delete_collection_with_http_info(collection, opts)
149
+ return nil
150
+ end
151
+
152
+ # Delete the collection
153
+ # This method will schedule the deletion of the collection. Until deleted, the collection will be available in the &#x60;trash&#x60;.
154
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
155
+ # @param [Hash] opts the optional parameters
156
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
157
+ def delete_collection_with_http_info(collection, opts = {})
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "Calling API: CollectionApi.delete_collection ..."
160
+ end
161
+ # verify the required parameter 'collection' is set
162
+ if @api_client.config.client_side_validation && collection.nil?
163
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.delete_collection"
164
+ end
165
+ # resource path
166
+ local_var_path = "/collections/{collection}".sub('{' + 'collection' + '}', collection.to_s)
167
+
168
+ # query parameters
169
+ query_params = {}
170
+
171
+ # header parameters
172
+ header_params = {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+ # HTTP header 'Content-Type'
176
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
177
+
178
+ # form parameters
179
+ form_params = {}
180
+
181
+ # http body (model)
182
+ post_body = nil
183
+ auth_names = ['OAuth2']
184
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
185
+ :header_params => header_params,
186
+ :query_params => query_params,
187
+ :form_params => form_params,
188
+ :body => post_body,
189
+ :auth_names => auth_names)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: CollectionApi#delete_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ return data, status_code, headers
194
+ end
195
+
196
+ # Delete a score from the collection
197
+ # This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections.
198
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
199
+ # @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. &#x60;ScoreDetails.id&#x60;) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with &#x60;drive-&#x60; (e.g. &#x60;drive-0B000000000&#x60;).
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [nil]
202
+ def delete_score_from_collection(collection, score, opts = {})
203
+ delete_score_from_collection_with_http_info(collection, score, opts)
204
+ return nil
205
+ end
206
+
207
+ # Delete a score from the collection
208
+ # This method will delete a score from the collection. Unlike [&#x60;DELETE /scores/{score}&#x60;](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections.
209
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
210
+ # @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. &#x60;ScoreDetails.id&#x60;) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with &#x60;drive-&#x60; (e.g. &#x60;drive-0B000000000&#x60;).
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
213
+ def delete_score_from_collection_with_http_info(collection, score, opts = {})
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "Calling API: CollectionApi.delete_score_from_collection ..."
216
+ end
217
+ # verify the required parameter 'collection' is set
218
+ if @api_client.config.client_side_validation && collection.nil?
219
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.delete_score_from_collection"
220
+ end
221
+ # verify the required parameter 'score' is set
222
+ if @api_client.config.client_side_validation && score.nil?
223
+ fail ArgumentError, "Missing the required parameter 'score' when calling CollectionApi.delete_score_from_collection"
224
+ end
225
+ # resource path
226
+ local_var_path = "/collections/{collection}/scores/{score}".sub('{' + 'collection' + '}', collection.to_s).sub('{' + 'score' + '}', score.to_s)
227
+
228
+ # query parameters
229
+ query_params = {}
230
+
231
+ # header parameters
232
+ header_params = {}
233
+ # HTTP header 'Accept' (if needed)
234
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
235
+ # HTTP header 'Content-Type'
236
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
237
+
238
+ # form parameters
239
+ form_params = {}
240
+
241
+ # http body (model)
242
+ post_body = nil
243
+ auth_names = ['OAuth2']
244
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
245
+ :header_params => header_params,
246
+ :query_params => query_params,
247
+ :form_params => form_params,
248
+ :body => post_body,
249
+ :auth_names => auth_names)
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug "API called: CollectionApi#delete_score_from_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
252
+ end
253
+ return data, status_code, headers
254
+ end
255
+
256
+ # Update a collection's metadata
257
+ #
258
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [CollectionModification] :body
261
+ # @return [Collection]
262
+ def edit_collection(collection, opts = {})
263
+ data, _status_code, _headers = edit_collection_with_http_info(collection, opts)
264
+ return data
265
+ end
266
+
267
+ # Update a collection&#39;s metadata
268
+ #
269
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
270
+ # @param [Hash] opts the optional parameters
271
+ # @option opts [CollectionModification] :body
272
+ # @return [Array<(Collection, Fixnum, Hash)>] Collection data, response status code and response headers
273
+ def edit_collection_with_http_info(collection, opts = {})
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug "Calling API: CollectionApi.edit_collection ..."
276
+ end
277
+ # verify the required parameter 'collection' is set
278
+ if @api_client.config.client_side_validation && collection.nil?
279
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.edit_collection"
280
+ end
281
+ # resource path
282
+ local_var_path = "/collections/{collection}".sub('{' + 'collection' + '}', collection.to_s)
283
+
284
+ # query parameters
285
+ query_params = {}
286
+
287
+ # header parameters
288
+ header_params = {}
289
+ # HTTP header 'Accept' (if needed)
290
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
291
+ # HTTP header 'Content-Type'
292
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
293
+
294
+ # form parameters
295
+ form_params = {}
296
+
297
+ # http body (model)
298
+ post_body = @api_client.object_to_http_body(opts[:'body'])
299
+ auth_names = ['OAuth2']
300
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
301
+ :header_params => header_params,
302
+ :query_params => query_params,
303
+ :form_params => form_params,
304
+ :body => post_body,
305
+ :auth_names => auth_names,
306
+ :return_type => 'Collection')
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug "API called: CollectionApi#edit_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
309
+ end
310
+ return data, status_code, headers
311
+ end
312
+
313
+ # Get collection details
314
+ #
315
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
316
+ # @param [Hash] opts the optional parameters
317
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.
318
+ # @return [Collection]
319
+ def get_collection(collection, opts = {})
320
+ data, _status_code, _headers = get_collection_with_http_info(collection, opts)
321
+ return data
322
+ end
323
+
324
+ # Get collection details
325
+ #
326
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
327
+ # @param [Hash] opts the optional parameters
328
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.
329
+ # @return [Array<(Collection, Fixnum, Hash)>] Collection data, response status code and response headers
330
+ def get_collection_with_http_info(collection, opts = {})
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug "Calling API: CollectionApi.get_collection ..."
333
+ end
334
+ # verify the required parameter 'collection' is set
335
+ if @api_client.config.client_side_validation && collection.nil?
336
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.get_collection"
337
+ end
338
+ # resource path
339
+ local_var_path = "/collections/{collection}".sub('{' + 'collection' + '}', collection.to_s)
340
+
341
+ # query parameters
342
+ query_params = {}
343
+ query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?
344
+
345
+ # header parameters
346
+ header_params = {}
347
+ # HTTP header 'Accept' (if needed)
348
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
349
+ # HTTP header 'Content-Type'
350
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
351
+
352
+ # form parameters
353
+ form_params = {}
354
+
355
+ # http body (model)
356
+ post_body = nil
357
+ auth_names = ['OAuth2']
358
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
359
+ :header_params => header_params,
360
+ :query_params => query_params,
361
+ :form_params => form_params,
362
+ :body => post_body,
363
+ :auth_names => auth_names,
364
+ :return_type => 'Collection')
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug "API called: CollectionApi#get_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
367
+ end
368
+ return data, status_code, headers
369
+ end
370
+
371
+ # List the scores contained in a collection
372
+ # Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`.
373
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
374
+ # @param [Hash] opts the optional parameters
375
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.
376
+ # @option opts [String] :sort Sort
377
+ # @option opts [String] :direction Sort direction
378
+ # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25)
379
+ # @option opts [String] :_next An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
380
+ # @option opts [String] :previous An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
381
+ # @return [Array<ScoreDetails>]
382
+ def list_collection_scores(collection, opts = {})
383
+ data, _status_code, _headers = list_collection_scores_with_http_info(collection, opts)
384
+ return data
385
+ end
386
+
387
+ # List the scores contained in a collection
388
+ # Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by &#x60;modificationDate&#x60; &#x60;desc&#x60;.
389
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
390
+ # @param [Hash] opts the optional parameters
391
+ # @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.
392
+ # @option opts [String] :sort Sort
393
+ # @option opts [String] :direction Sort direction
394
+ # @option opts [Integer] :limit This is the maximum number of objects that may be returned
395
+ # @option opts [String] :_next An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
396
+ # @option opts [String] :previous An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
397
+ # @return [Array<(Array<ScoreDetails>, Fixnum, Hash)>] Array<ScoreDetails> data, response status code and response headers
398
+ def list_collection_scores_with_http_info(collection, opts = {})
399
+ if @api_client.config.debugging
400
+ @api_client.config.logger.debug "Calling API: CollectionApi.list_collection_scores ..."
401
+ end
402
+ # verify the required parameter 'collection' is set
403
+ if @api_client.config.client_side_validation && collection.nil?
404
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.list_collection_scores"
405
+ end
406
+ if @api_client.config.client_side_validation && opts[:'sort'] && !['creationDate', 'modificationDate', 'title'].include?(opts[:'sort'])
407
+ fail ArgumentError, 'invalid value for "sort", must be one of creationDate, modificationDate, title'
408
+ end
409
+ if @api_client.config.client_side_validation && opts[:'direction'] && !['asc', 'desc'].include?(opts[:'direction'])
410
+ fail ArgumentError, 'invalid value for "direction", must be one of asc, desc'
411
+ end
412
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
413
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CollectionApi.list_collection_scores, must be smaller than or equal to 100.'
414
+ end
415
+
416
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
417
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CollectionApi.list_collection_scores, must be greater than or equal to 1.'
418
+ end
419
+
420
+ # resource path
421
+ local_var_path = "/collections/{collection}/scores".sub('{' + 'collection' + '}', collection.to_s)
422
+
423
+ # query parameters
424
+ query_params = {}
425
+ query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?
426
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
427
+ query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
428
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
429
+ query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
430
+ query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
431
+
432
+ # header parameters
433
+ header_params = {}
434
+ # HTTP header 'Accept' (if needed)
435
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
436
+ # HTTP header 'Content-Type'
437
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
438
+
439
+ # form parameters
440
+ form_params = {}
441
+
442
+ # http body (model)
443
+ post_body = nil
444
+ auth_names = ['OAuth2']
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
446
+ :header_params => header_params,
447
+ :query_params => query_params,
448
+ :form_params => form_params,
449
+ :body => post_body,
450
+ :auth_names => auth_names,
451
+ :return_type => 'Array<ScoreDetails>')
452
+ if @api_client.config.debugging
453
+ @api_client.config.logger.debug "API called: CollectionApi#list_collection_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
454
+ end
455
+ return data, status_code, headers
456
+ end
457
+
458
+ # List the collections
459
+ # Use this method to list the user's collections contained in `parent` (by default in the `root` collection). If no sort option is provided, the collections are sorted by `creationDate` `desc`. Note that this method will not include the `parent` collection in the listing. For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`.
460
+ # @param [Hash] opts the optional parameters
461
+ # @option opts [String] :parent List the collection contained in this &#x60;parent&#x60; collection. This option doesn&#39;t provide a complete multi-level collection support. When sharing a collection with someone, this one will have as &#x60;parent&#x60; &#x60;sharedWithMe&#x60;. (default to root)
462
+ # @option opts [String] :sort Sort
463
+ # @option opts [String] :direction Sort direction
464
+ # @option opts [Integer] :limit This is the maximum number of objects that may be returned (default to 25)
465
+ # @option opts [String] :_next An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
466
+ # @option opts [String] :previous An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
467
+ # @return [Array<Collection>]
468
+ def list_collections(opts = {})
469
+ data, _status_code, _headers = list_collections_with_http_info(opts)
470
+ return data
471
+ end
472
+
473
+ # List the collections
474
+ # Use this method to list the user&#39;s collections contained in &#x60;parent&#x60; (by default in the &#x60;root&#x60; collection). If no sort option is provided, the collections are sorted by &#x60;creationDate&#x60; &#x60;desc&#x60;. Note that this method will not include the &#x60;parent&#x60; collection in the listing. For example, if you need the details of the &#x60;root&#x60; collection, you can use &#x60;GET /v2/collections/root&#x60;.
475
+ # @param [Hash] opts the optional parameters
476
+ # @option opts [String] :parent List the collection contained in this &#x60;parent&#x60; collection. This option doesn&#39;t provide a complete multi-level collection support. When sharing a collection with someone, this one will have as &#x60;parent&#x60; &#x60;sharedWithMe&#x60;.
477
+ # @option opts [String] :sort Sort
478
+ # @option opts [String] :direction Sort direction
479
+ # @option opts [Integer] :limit This is the maximum number of objects that may be returned
480
+ # @option opts [String] :_next An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
481
+ # @option opts [String] :previous An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data.
482
+ # @return [Array<(Array<Collection>, Fixnum, Hash)>] Array<Collection> data, response status code and response headers
483
+ def list_collections_with_http_info(opts = {})
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "Calling API: CollectionApi.list_collections ..."
486
+ end
487
+ if @api_client.config.client_side_validation && opts[:'parent'] && !['root', 'sharedWithMe', 'trash'].include?(opts[:'parent'])
488
+ fail ArgumentError, 'invalid value for "parent", must be one of root, sharedWithMe, trash'
489
+ end
490
+ if @api_client.config.client_side_validation && opts[:'sort'] && !['creationDate', 'title'].include?(opts[:'sort'])
491
+ fail ArgumentError, 'invalid value for "sort", must be one of creationDate, title'
492
+ end
493
+ if @api_client.config.client_side_validation && opts[:'direction'] && !['asc', 'desc'].include?(opts[:'direction'])
494
+ fail ArgumentError, 'invalid value for "direction", must be one of asc, desc'
495
+ end
496
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
497
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CollectionApi.list_collections, must be smaller than or equal to 100.'
498
+ end
499
+
500
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
501
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CollectionApi.list_collections, must be greater than or equal to 1.'
502
+ end
503
+
504
+ # resource path
505
+ local_var_path = "/collections"
506
+
507
+ # query parameters
508
+ query_params = {}
509
+ query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil?
510
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
511
+ query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
512
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
513
+ query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
514
+ query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
515
+
516
+ # header parameters
517
+ header_params = {}
518
+ # HTTP header 'Accept' (if needed)
519
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
520
+ # HTTP header 'Content-Type'
521
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
522
+
523
+ # form parameters
524
+ form_params = {}
525
+
526
+ # http body (model)
527
+ post_body = nil
528
+ auth_names = ['OAuth2']
529
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
530
+ :header_params => header_params,
531
+ :query_params => query_params,
532
+ :form_params => form_params,
533
+ :body => post_body,
534
+ :auth_names => auth_names,
535
+ :return_type => 'Array<Collection>')
536
+ if @api_client.config.debugging
537
+ @api_client.config.logger.debug "API called: CollectionApi#list_collections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
538
+ end
539
+ return data, status_code, headers
540
+ end
541
+
542
+ # Untrash a collection
543
+ # This method will restore the collection by removing it from the `trash` and add it back to the `root` collection.
544
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
545
+ # @param [Hash] opts the optional parameters
546
+ # @return [nil]
547
+ def untrash_collection(collection, opts = {})
548
+ untrash_collection_with_http_info(collection, opts)
549
+ return nil
550
+ end
551
+
552
+ # Untrash a collection
553
+ # This method will restore the collection by removing it from the &#x60;trash&#x60; and add it back to the &#x60;root&#x60; collection.
554
+ # @param collection Unique identifier of the collection. The following aliases are supported: - &#x60;root&#x60;: The root collection of the account - &#x60;sharedWithMe&#x60;: Automatically contains new resources that have been shared individually - &#x60;trash&#x60;: Automatically contains resources that have been deleted
555
+ # @param [Hash] opts the optional parameters
556
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
557
+ def untrash_collection_with_http_info(collection, opts = {})
558
+ if @api_client.config.debugging
559
+ @api_client.config.logger.debug "Calling API: CollectionApi.untrash_collection ..."
560
+ end
561
+ # verify the required parameter 'collection' is set
562
+ if @api_client.config.client_side_validation && collection.nil?
563
+ fail ArgumentError, "Missing the required parameter 'collection' when calling CollectionApi.untrash_collection"
564
+ end
565
+ # resource path
566
+ local_var_path = "/collections/{collection}/untrash".sub('{' + 'collection' + '}', collection.to_s)
567
+
568
+ # query parameters
569
+ query_params = {}
570
+
571
+ # header parameters
572
+ header_params = {}
573
+ # HTTP header 'Accept' (if needed)
574
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
575
+ # HTTP header 'Content-Type'
576
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
577
+
578
+ # form parameters
579
+ form_params = {}
580
+
581
+ # http body (model)
582
+ post_body = nil
583
+ auth_names = ['OAuth2']
584
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
585
+ :header_params => header_params,
586
+ :query_params => query_params,
587
+ :form_params => form_params,
588
+ :body => post_body,
589
+ :auth_names => auth_names)
590
+ if @api_client.config.debugging
591
+ @api_client.config.logger.debug "API called: CollectionApi#untrash_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
592
+ end
593
+ return data, status_code, headers
594
+ end
595
+ end
596
+ end