Class: FlatApi::ScoreApi

Inherits:
Object
  • Object
show all
Defined in:
lib/flat_api/api/score_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ScoreApi

Returns a new instance of ScoreApi.



19
20
21
# File 'lib/flat_api/api/score_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/flat_api/api/score_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_score_collaborator(score, body, opts = {}) ⇒ ResourceCollaborator

Add a new collaborator Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the ‘user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights.

Parameters:

  • 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`).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/flat_api/api/score_api.rb', line 29

def add_score_collaborator(score, body, opts = {})
  data, _status_code, _headers = add_score_collaborator_with_http_info(score, body, opts)
  return data
end

#add_score_collaborator_with_http_info(score, body, opts = {}) ⇒ Array<(ResourceCollaborator, Fixnum, Hash)>

Add a new collaborator Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the &#x60;user&#x60; property. - To invite an external user to the resource, specify its email in the &#x60;userEmail&#x60; property. - To add a Flat group to the resource, specify its unique identifier in the &#x60;group&#x60; property. - To update an existing collaborator, process the same request with different rights.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResourceCollaborator, Fixnum, Hash)>)

    ResourceCollaborator data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/flat_api/api/score_api.rb', line 40

def add_score_collaborator_with_http_info(score, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.add_score_collaborator ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.add_score_collaborator"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.add_score_collaborator"
  end
  # resource path
  local_var_path = "/scores/{score}/collaborators".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResourceCollaborator')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#add_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_score_track(score, body, opts = {}) ⇒ ScoreTrack

Add a new video or audio track to the score Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



90
91
92
93
# File 'lib/flat_api/api/score_api.rb', line 90

def add_score_track(score, body, opts = {})
  data, _status_code, _headers = add_score_track_with_http_info(score, body, opts)
  return data
end

#add_score_track_with_http_info(score, body, opts = {}) ⇒ Array<(ScoreTrack, Fixnum, Hash)>

Add a new video or audio track to the score Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ScoreTrack, Fixnum, Hash)>)

    ScoreTrack data, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/flat_api/api/score_api.rb', line 101

def add_score_track_with_http_info(score, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.add_score_track ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.add_score_track"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.add_score_track"
  end
  # resource path
  local_var_path = "/scores/{score}/tracks".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreTrack')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#add_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_score(body, opts = {}) ⇒ ScoreDetails

Create a new score Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (‘vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`) or a MIDI (`audio/midi`) file to create the new Flat document. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/score/revisions/revision`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. This can be the `root` collection or a different collection based on the user’s settings or API authentication method. If a ‘collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/score`.

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



150
151
152
153
# File 'lib/flat_api/api/score_api.rb', line 150

def create_score(body, opts = {})
  data, _status_code, _headers = create_score_with_http_info(body, opts)
  return data
end

#create_score_revision(score, body, opts = {}) ⇒ ScoreRevision

Create a new revision Update a score by uploading a new revision for this one.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



206
207
208
209
# File 'lib/flat_api/api/score_api.rb', line 206

def create_score_revision(score, body, opts = {})
  data, _status_code, _headers = create_score_revision_with_http_info(score, body, opts)
  return data
end

#create_score_revision_with_http_info(score, body, opts = {}) ⇒ Array<(ScoreRevision, Fixnum, Hash)>

Create a new revision Update a score by uploading a new revision for this one.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ScoreRevision, Fixnum, Hash)>)

    ScoreRevision data, response status code and response headers



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/flat_api/api/score_api.rb', line 217

def create_score_revision_with_http_info(score, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.create_score_revision ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.create_score_revision"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.create_score_revision"
  end
  # resource path
  local_var_path = "/scores/{score}/revisions".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreRevision')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#create_score_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_score_with_http_info(body, opts = {}) ⇒ Array<(ScoreDetails, Fixnum, Hash)>

Create a new score Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (&#x60;vnd.recordare.musicxml&#x60; or &#x60;vnd.recordare.musicxml+xml&#x60;) or a MIDI (&#x60;audio/midi&#x60;) file to create the new Flat document. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (&#x60;POST /v2/scores/score/revisions/revision&#x60;). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no &#x60;collection&#x60; is specified, the API will create the score in the most appropriate collection. This can be the &#x60;root&#x60; collection or a different collection based on the user&#39;s settings or API authentication method. If a &#x60;collection&#x60; is specified and this one has more public privacy settings than the score (e.g. &#x60;public&#x60; vs &#x60;private&#x60; for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score &#x60;privacy&#x60;, and optionally adjust these settings if needed using &#x60;PUT /scores/score&#x60;.

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ScoreDetails, Fixnum, Hash)>)

    ScoreDetails data, response status code and response headers



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/flat_api/api/score_api.rb', line 160

def create_score_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.create_score ..."
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.create_score"
  end
  # resource path
  local_var_path = "/scores"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#create_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_score(score, opts = {}) ⇒ nil

Delete a score This method can be used by the owner/admin (‘aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won’t be accessible anymore after calling this method and the user’s quota will directly be updated. When called by a regular collaborator (‘aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections).

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


266
267
268
269
# File 'lib/flat_api/api/score_api.rb', line 266

def delete_score(score, opts = {})
  delete_score_with_http_info(score, opts)
  return nil
end

#delete_score_comment(score, comment, opts = {}) ⇒ nil

Delete a comment

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (nil)


322
323
324
325
# File 'lib/flat_api/api/score_api.rb', line 322

def delete_score_comment(score, comment, opts = {})
  delete_score_comment_with_http_info(score, comment, opts)
  return nil
end

#delete_score_comment_with_http_info(score, comment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a comment

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/flat_api/api/score_api.rb', line 334

def delete_score_comment_with_http_info(score, comment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.delete_score_comment ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.delete_score_comment"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.delete_score_comment"
  end
  # resource path
  local_var_path = "/scores/{score}/comments/{comment}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#delete_score_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_score_track(score, track, opts = {}) ⇒ nil

Remove an audio or video track linked to the score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


384
385
386
387
# File 'lib/flat_api/api/score_api.rb', line 384

def delete_score_track(score, track, opts = {})
  delete_score_track_with_http_info(score, track, opts)
  return nil
end

#delete_score_track_with_http_info(score, track, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Remove an audio or video track linked to the score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# File 'lib/flat_api/api/score_api.rb', line 395

def delete_score_track_with_http_info(score, track, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.delete_score_track ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.delete_score_track"
  end
  # verify the required parameter 'track' is set
  if @api_client.config.client_side_validation && track.nil?
    fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.delete_score_track"
  end
  # resource path
  local_var_path = "/scores/{score}/tracks/{track}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'track' + '}', track.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#delete_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_score_with_http_info(score, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a score This method can be used by the owner/admin (&#x60;aclAdmin&#x60; rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won&#39;t be accessible anymore after calling this method and the user&#39;s quota will directly be updated. When called by a regular collaborator (&#x60;aclRead&#x60; / &#x60;aclWrite&#x60;), the score will be unshared (i.e. removed from the account &amp; own collections).

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/flat_api/api/score_api.rb', line 276

def delete_score_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.delete_score ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.delete_score"
  end
  # resource path
  local_var_path = "/scores/{score}".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#delete_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_score(score, opts = {}) ⇒ ScoreDetails

Edit a score’s metadata This API method allows you to change the metadata of a score document (e.g. its ‘title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/score/revisions/revision`). When editing the `title` of the score, the API metadata are updated directly when calling this method, unlike the data itself. The title in the score data will be "lazy" updated at the next score save with the editor or our internal save.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



444
445
446
447
# File 'lib/flat_api/api/score_api.rb', line 444

def edit_score(score, opts = {})
  data, _status_code, _headers = edit_score_with_http_info(score, opts)
  return data
end

#edit_score_with_http_info(score, opts = {}) ⇒ Array<(ScoreDetails, Fixnum, Hash)>

Edit a score&#39;s metadata This API method allows you to change the metadata of a score document (e.g. its &#x60;title&#x60; or &#x60;privacy&#x60;), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (&#x60;POST /v2/scores/score/revisions/revision&#x60;). When editing the &#x60;title&#x60; of the score, the API metadata are updated directly when calling this method, unlike the data itself. The title in the score data will be &quot;lazy&quot; updated at the next score save with the editor or our internal save.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(ScoreDetails, Fixnum, Hash)>)

    ScoreDetails data, response status code and response headers



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/flat_api/api/score_api.rb', line 455

def edit_score_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.edit_score ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.edit_score"
  end
  # resource path
  local_var_path = "/scores/{score}".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#edit_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fork_score(score, body, opts = {}) ⇒ ScoreDetails

Fork a score This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to ‘private`. When using a [Flat for Education](flat.io/edu) account, the inline and contextualized comments will be accessible in the child document.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



502
503
504
505
# File 'lib/flat_api/api/score_api.rb', line 502

def fork_score(score, body, opts = {})
  data, _status_code, _headers = fork_score_with_http_info(score, body, opts)
  return data
end

#fork_score_with_http_info(score, body, opts = {}) ⇒ Array<(ScoreDetails, Fixnum, Hash)>

Fork a score This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to &#x60;private&#x60;. When using a [Flat for Education](flat.io/edu) account, the inline and contextualized comments will be accessible in the child document.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreDetails, Fixnum, Hash)>)

    ScoreDetails data, response status code and response headers



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/flat_api/api/score_api.rb', line 514

def fork_score_with_http_info(score, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.fork_score ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.fork_score"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.fork_score"
  end
  # resource path
  local_var_path = "/scores/{score}/fork".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#fork_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ger_user_likes(user, opts = {}) ⇒ Array<ScoreDetails>

List liked scores

Parameters:

  • user

    Unique identifier of a Flat user. If you authenticated, you can use &#x60;me&#x60; to refer to the current user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ids (BOOLEAN)

    Return only the identifiers of the scores

Returns:



565
566
567
568
# File 'lib/flat_api/api/score_api.rb', line 565

def ger_user_likes(user, opts = {})
  data, _status_code, _headers = ger_user_likes_with_http_info(user, opts)
  return data
end

#ger_user_likes_with_http_info(user, opts = {}) ⇒ Array<(Array<ScoreDetails>, Fixnum, Hash)>

List liked scores

Parameters:

  • user

    Unique identifier of a Flat user. If you authenticated, you can use &#x60;me&#x60; to refer to the current user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ids (BOOLEAN)

    Return only the identifiers of the scores

Returns:

  • (Array<(Array<ScoreDetails>, Fixnum, Hash)>)

    Array<ScoreDetails> data, response status code and response headers



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# File 'lib/flat_api/api/score_api.rb', line 576

def ger_user_likes_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.ger_user_likes ..."
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling ScoreApi.ger_user_likes"
  end
  # resource path
  local_var_path = "/users/{user}/likes".sub('{' + 'user' + '}', user.to_s)

  # query parameters
  query_params = {}
  query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreDetails>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#ger_user_likes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_group_scores(group, opts = {}) ⇒ Array<ScoreDetails>

List group’s scores Get the list of scores shared with a group.

Parameters:

  • group

    Unique identifier of a Flat group

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent (String)

    Filter the score forked from the score id &#x60;parent&#x60;

Returns:



623
624
625
626
# File 'lib/flat_api/api/score_api.rb', line 623

def get_group_scores(group, opts = {})
  data, _status_code, _headers = get_group_scores_with_http_info(group, opts)
  return data
end

#get_group_scores_with_http_info(group, opts = {}) ⇒ Array<(Array<ScoreDetails>, Fixnum, Hash)>

List group&#39;s scores Get the list of scores shared with a group.

Parameters:

  • group

    Unique identifier of a Flat group

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent (String)

    Filter the score forked from the score id &#x60;parent&#x60;

Returns:

  • (Array<(Array<ScoreDetails>, Fixnum, Hash)>)

    Array<ScoreDetails> data, response status code and response headers



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/flat_api/api/score_api.rb', line 634

def get_group_scores_with_http_info(group, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_group_scores ..."
  end
  # verify the required parameter 'group' is set
  if @api_client.config.client_side_validation && group.nil?
    fail ArgumentError, "Missing the required parameter 'group' when calling ScoreApi.get_group_scores"
  end
  # resource path
  local_var_path = "/groups/{group}/scores".sub('{' + 'group' + '}', group.to_s)

  # query parameters
  query_params = {}
  query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreDetails>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_group_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score(score, opts = {}) ⇒ ScoreDetails

Get a score’s metadata Get the details of a score identified by the ‘score` parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



681
682
683
684
# File 'lib/flat_api/api/score_api.rb', line 681

def get_score(score, opts = {})
  data, _status_code, _headers = get_score_with_http_info(score, opts)
  return data
end

#get_score_collaborator(score, collaborator, opts = {}) ⇒ ResourceCollaborator

Get a collaborator Get the information about a collaborator (User or Group).

Parameters:

  • 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;).

  • collaborator

    Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



740
741
742
743
# File 'lib/flat_api/api/score_api.rb', line 740

def get_score_collaborator(score, collaborator, opts = {})
  data, _status_code, _headers = get_score_collaborator_with_http_info(score, collaborator, opts)
  return data
end

#get_score_collaborator_with_http_info(score, collaborator, opts = {}) ⇒ Array<(ResourceCollaborator, Fixnum, Hash)>

Get a collaborator Get the information about a collaborator (User or Group).

Parameters:

  • 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;).

  • collaborator

    Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ResourceCollaborator, Fixnum, Hash)>)

    ResourceCollaborator data, response status code and response headers



752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/flat_api/api/score_api.rb', line 752

def get_score_collaborator_with_http_info(score, collaborator, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_collaborator ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_collaborator"
  end
  # verify the required parameter 'collaborator' is set
  if @api_client.config.client_side_validation && collaborator.nil?
    fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.get_score_collaborator"
  end
  # resource path
  local_var_path = "/scores/{score}/collaborators/{collaborator}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'collaborator' + '}', collaborator.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResourceCollaborator')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_collaborators(score, opts = {}) ⇒ Array<ResourceCollaborator>

List the collaborators This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object ‘user` will be populated) or a group (the object `group` will be populated).

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



803
804
805
806
# File 'lib/flat_api/api/score_api.rb', line 803

def get_score_collaborators(score, opts = {})
  data, _status_code, _headers = get_score_collaborators_with_http_info(score, opts)
  return data
end

#get_score_collaborators_with_http_info(score, opts = {}) ⇒ Array<(Array<ResourceCollaborator>, Fixnum, Hash)>

List the collaborators This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object &#x60;user&#x60; will be populated) or a group (the object &#x60;group&#x60; will be populated).

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(Array<ResourceCollaborator>, Fixnum, Hash)>)

    Array<ResourceCollaborator> data, response status code and response headers



814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
# File 'lib/flat_api/api/score_api.rb', line 814

def get_score_collaborators_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_collaborators ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_collaborators"
  end
  # resource path
  local_var_path = "/scores/{score}/collaborators".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ResourceCollaborator>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_collaborators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_comments(score, opts = {}) ⇒ Array<ScoreComment>

List comments This method lists the different comments added on a music score (documents and inline) sorted by their post dates.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

  • :type (String)

    Filter the comments by type

  • :sort (String)

    Sort

  • :direction (String)

    Sort direction

Returns:



864
865
866
867
# File 'lib/flat_api/api/score_api.rb', line 864

def get_score_comments(score, opts = {})
  data, _status_code, _headers = get_score_comments_with_http_info(score, opts)
  return data
end

#get_score_comments_with_http_info(score, opts = {}) ⇒ Array<(Array<ScoreComment>, Fixnum, Hash)>

List comments This method lists the different comments added on a music score (documents and inline) sorted by their post dates.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

  • :type (String)

    Filter the comments by type

  • :sort (String)

    Sort

  • :direction (String)

    Sort direction

Returns:

  • (Array<(Array<ScoreComment>, Fixnum, Hash)>)

    Array<ScoreComment> data, response status code and response headers



878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
# File 'lib/flat_api/api/score_api.rb', line 878

def get_score_comments_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_comments ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_comments"
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['document', 'inline'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of document, inline'
  end
  if @api_client.config.client_side_validation && opts[:'sort'] && !['date'].include?(opts[:'sort'])
    fail ArgumentError, 'invalid value for "sort", must be one of date'
  end
  if @api_client.config.client_side_validation && opts[:'direction'] && !['asc', 'desc'].include?(opts[:'direction'])
    fail ArgumentError, 'invalid value for "direction", must be one of asc, desc'
  end
  # resource path
  local_var_path = "/scores/{score}/comments".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreComment>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_revision(score, revision, opts = {}) ⇒ ScoreRevision

Get a score revision When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata.

Parameters:

  • 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;).

  • revision

    Unique identifier of a score revision. You can use &#x60;last&#x60; to fetch the information related to the last version created.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



938
939
940
941
# File 'lib/flat_api/api/score_api.rb', line 938

def get_score_revision(score, revision, opts = {})
  data, _status_code, _headers = get_score_revision_with_http_info(score, revision, opts)
  return data
end

#get_score_revision_data(score, revision, format, opts = {}) ⇒ String

Get a score revision data Retrieve the file corresponding to a score revision (the following formats are available: Flat JSON/Adagio JSON ‘json`, MusicXML `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, or a tumbnail of the first page `thumbnail.png`).

Parameters:

  • 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;).

  • revision

    Unique identifier of a score revision. You can use &#x60;last&#x60; to fetch the information related to the last version created.

  • format

    The format of the file you will retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

  • :parts (String)

    An optional a set of parts to be exported. This parameter must be specified with a list of integers. For example &quot;1,2,5&quot;.

  • :only_cached (BOOLEAN)

    Only return files already generated and cached in Flat&#39;s production cache. If the file is not availabe, a 404 will be returned

Returns:

  • (String)


1005
1006
1007
1008
# File 'lib/flat_api/api/score_api.rb', line 1005

def get_score_revision_data(score, revision, format, opts = {})
  data, _status_code, _headers = get_score_revision_data_with_http_info(score, revision, format, opts)
  return data
end

#get_score_revision_data_with_http_info(score, revision, format, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get a score revision data Retrieve the file corresponding to a score revision (the following formats are available: Flat JSON/Adagio JSON &#x60;json&#x60;, MusicXML &#x60;mxl&#x60;/&#x60;xml&#x60;, MP3 &#x60;mp3&#x60;, WAV &#x60;wav&#x60;, MIDI &#x60;midi&#x60;, or a tumbnail of the first page &#x60;thumbnail.png&#x60;).

Parameters:

  • 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;).

  • revision

    Unique identifier of a score revision. You can use &#x60;last&#x60; to fetch the information related to the last version created.

  • format

    The format of the file you will retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

  • :parts (String)

    An optional a set of parts to be exported. This parameter must be specified with a list of integers. For example &quot;1,2,5&quot;.

  • :only_cached (BOOLEAN)

    Only return files already generated and cached in Flat&#39;s production cache. If the file is not availabe, a 404 will be returned

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/flat_api/api/score_api.rb', line 1020

def get_score_revision_data_with_http_info(score, revision, format, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revision_data ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revision_data"
  end
  # verify the required parameter 'revision' is set
  if @api_client.config.client_side_validation && revision.nil?
    fail ArgumentError, "Missing the required parameter 'revision' when calling ScoreApi.get_score_revision_data"
  end
  # verify the required parameter 'format' is set
  if @api_client.config.client_side_validation && format.nil?
    fail ArgumentError, "Missing the required parameter 'format' when calling ScoreApi.get_score_revision_data"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['json', 'mxl', 'xml', 'mp3', 'wav', 'midi', 'thumbnail.png'].include?(format)
    fail ArgumentError, "invalid value for 'format', must be one of json, mxl, xml, mp3, wav, midi, thumbnail.png"
  end
  # resource path
  local_var_path = "/scores/{score}/revisions/{revision}/{format}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'revision' + '}', revision.to_s).sub('{' + 'format' + '}', format.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?
  query_params[:'parts'] = opts[:'parts'] if !opts[:'parts'].nil?
  query_params[:'onlyCached'] = opts[:'only_cached'] if !opts[:'only_cached'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/vnd.recordare.musicxml+xml', 'application/vnd.recordare.musicxml', 'audio/mp3', 'audio/wav', 'audio/midi', 'image/png'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_revision_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_revision_with_http_info(score, revision, opts = {}) ⇒ Array<(ScoreRevision, Fixnum, Hash)>

Get a score revision When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata.

Parameters:

  • 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;).

  • revision

    Unique identifier of a score revision. You can use &#x60;last&#x60; to fetch the information related to the last version created.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreRevision, Fixnum, Hash)>)

    ScoreRevision data, response status code and response headers



950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/flat_api/api/score_api.rb', line 950

def get_score_revision_with_http_info(score, revision, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revision ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revision"
  end
  # verify the required parameter 'revision' is set
  if @api_client.config.client_side_validation && revision.nil?
    fail ArgumentError, "Missing the required parameter 'revision' when calling ScoreApi.get_score_revision"
  end
  # resource path
  local_var_path = "/scores/{score}/revisions/{revision}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'revision' + '}', revision.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreRevision')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_revisions(score, opts = {}) ⇒ Array<ScoreRevision>

List the revisions When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



1081
1082
1083
1084
# File 'lib/flat_api/api/score_api.rb', line 1081

def get_score_revisions(score, opts = {})
  data, _status_code, _headers = get_score_revisions_with_http_info(score, opts)
  return data
end

#get_score_revisions_with_http_info(score, opts = {}) ⇒ Array<(Array<ScoreRevision>, Fixnum, Hash)>

List the revisions When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(Array<ScoreRevision>, Fixnum, Hash)>)

    Array<ScoreRevision> data, response status code and response headers



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/flat_api/api/score_api.rb', line 1092

def get_score_revisions_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revisions ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revisions"
  end
  # resource path
  local_var_path = "/scores/{score}/revisions".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreRevision>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_submissions(score, opts = {}) ⇒ Array<AssignmentSubmission>

List submissions related to the score This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1138
1139
1140
1141
# File 'lib/flat_api/api/score_api.rb', line 1138

def get_score_submissions(score, opts = {})
  data, _status_code, _headers = get_score_submissions_with_http_info(score, opts)
  return data
end

#get_score_submissions_with_http_info(score, opts = {}) ⇒ Array<(Array<AssignmentSubmission>, Fixnum, Hash)>

List submissions related to the score This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<AssignmentSubmission>, Fixnum, Hash)>)

    Array<AssignmentSubmission> data, response status code and response headers



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/flat_api/api/score_api.rb', line 1148

def get_score_submissions_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_submissions ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_submissions"
  end
  # resource path
  local_var_path = "/scores/{score}/submissions".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<AssignmentSubmission>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_track(score, track, opts = {}) ⇒ ScoreTrack

Retrieve the details of an audio or video track linked to a score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



1195
1196
1197
1198
# File 'lib/flat_api/api/score_api.rb', line 1195

def get_score_track(score, track, opts = {})
  data, _status_code, _headers = get_score_track_with_http_info(score, track, opts)
  return data
end

#get_score_track_with_http_info(score, track, opts = {}) ⇒ Array<(ScoreTrack, Fixnum, Hash)>

Retrieve the details of an audio or video track linked to a score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreTrack, Fixnum, Hash)>)

    ScoreTrack data, response status code and response headers



1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
# File 'lib/flat_api/api/score_api.rb', line 1207

def get_score_track_with_http_info(score, track, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score_track ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_track"
  end
  # verify the required parameter 'track' is set
  if @api_client.config.client_side_validation && track.nil?
    fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.get_score_track"
  end
  # resource path
  local_var_path = "/scores/{score}/tracks/{track}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'track' + '}', track.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreTrack')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_score_with_http_info(score, opts = {}) ⇒ Array<(ScoreDetails, Fixnum, Hash)>

Get a score&#39;s metadata Get the details of a score identified by the &#x60;score&#x60; parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreDetails, Fixnum, Hash)>)

    ScoreDetails data, response status code and response headers



692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
# File 'lib/flat_api/api/score_api.rb', line 692

def get_score_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_score ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score"
  end
  # resource path
  local_var_path = "/scores/{score}".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_scores(user, opts = {}) ⇒ Array<ScoreDetails>

List user’s scores 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.

Parameters:

  • user

    Unique identifier of a Flat user. If you authenticated, you can use &#x60;me&#x60; to refer to the current user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent (String)

    Filter the score forked from the score id &#x60;parent&#x60;

Returns:



1258
1259
1260
1261
# File 'lib/flat_api/api/score_api.rb', line 1258

def get_user_scores(user, opts = {})
  data, _status_code, _headers = get_user_scores_with_http_info(user, opts)
  return data
end

#get_user_scores_with_http_info(user, opts = {}) ⇒ Array<(Array<ScoreDetails>, Fixnum, Hash)>

List user&#39;s scores 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.

Parameters:

  • user

    Unique identifier of a Flat user. If you authenticated, you can use &#x60;me&#x60; to refer to the current user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :parent (String)

    Filter the score forked from the score id &#x60;parent&#x60;

Returns:

  • (Array<(Array<ScoreDetails>, Fixnum, Hash)>)

    Array<ScoreDetails> data, response status code and response headers



1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
# File 'lib/flat_api/api/score_api.rb', line 1269

def get_user_scores_with_http_info(user, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.get_user_scores ..."
  end
  # verify the required parameter 'user' is set
  if @api_client.config.client_side_validation && user.nil?
    fail ArgumentError, "Missing the required parameter 'user' when calling ScoreApi.get_user_scores"
  end
  # resource path
  local_var_path = "/users/{user}/scores".sub('{' + 'user' + '}', user.to_s)

  # query parameters
  query_params = {}
  query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreDetails>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#get_user_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_score_tracks(score, opts = {}) ⇒ Array<ScoreTrack>

List the audio or video tracks linked to a score

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



1316
1317
1318
1319
# File 'lib/flat_api/api/score_api.rb', line 1316

def list_score_tracks(score, opts = {})
  data, _status_code, _headers = list_score_tracks_with_http_info(score, opts)
  return data
end

#list_score_tracks_with_http_info(score, opts = {}) ⇒ Array<(Array<ScoreTrack>, Fixnum, Hash)>

List the audio or video tracks linked to a score

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(Array<ScoreTrack>, Fixnum, Hash)>)

    Array<ScoreTrack> data, response status code and response headers



1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/flat_api/api/score_api.rb', line 1327

def list_score_tracks_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.list_score_tracks ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.list_score_tracks"
  end
  # resource path
  local_var_path = "/scores/{score}/tracks".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<ScoreTrack>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#list_score_tracks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mark_score_comment_resolved(score, comment, opts = {}) ⇒ nil

Mark the comment as resolved

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (nil)


1375
1376
1377
1378
# File 'lib/flat_api/api/score_api.rb', line 1375

def mark_score_comment_resolved(score, comment, opts = {})
  mark_score_comment_resolved_with_http_info(score, comment, opts)
  return nil
end

#mark_score_comment_resolved_with_http_info(score, comment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Mark the comment as resolved

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/flat_api/api/score_api.rb', line 1387

def mark_score_comment_resolved_with_http_info(score, comment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.mark_score_comment_resolved ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.mark_score_comment_resolved"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_resolved"
  end
  # resource path
  local_var_path = "/scores/{score}/comments/{comment}/resolved".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#mark_score_comment_resolved\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mark_score_comment_unresolved(score, comment, opts = {}) ⇒ nil

Mark the comment as unresolved

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (nil)


1438
1439
1440
1441
# File 'lib/flat_api/api/score_api.rb', line 1438

def mark_score_comment_unresolved(score, comment, opts = {})
  mark_score_comment_unresolved_with_http_info(score, comment, opts)
  return nil
end

#mark_score_comment_unresolved_with_http_info(score, comment, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Mark the comment as unresolved

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/flat_api/api/score_api.rb', line 1450

def mark_score_comment_unresolved_with_http_info(score, comment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.mark_score_comment_unresolved ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.mark_score_comment_unresolved"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_unresolved"
  end
  # resource path
  local_var_path = "/scores/{score}/comments/{comment}/resolved".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#mark_score_comment_unresolved\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_score_comment(score, body, opts = {}) ⇒ ScoreComment

Post a new comment Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don’t guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a ‘403` HTTP error and hidden from other users when the `spam` property is `true`.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



1501
1502
1503
1504
# File 'lib/flat_api/api/score_api.rb', line 1501

def post_score_comment(score, body, opts = {})
  data, _status_code, _headers = post_score_comment_with_http_info(score, body, opts)
  return data
end

#post_score_comment_with_http_info(score, body, opts = {}) ⇒ Array<(ScoreComment, Fixnum, Hash)>

Post a new comment Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don&#39;t guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a &#x60;403&#x60; HTTP error and hidden from other users when the &#x60;spam&#x60; property is &#x60;true&#x60;.

Parameters:

  • 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;).

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreComment, Fixnum, Hash)>)

    ScoreComment data, response status code and response headers



1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
# File 'lib/flat_api/api/score_api.rb', line 1513

def post_score_comment_with_http_info(score, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.post_score_comment ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.post_score_comment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.post_score_comment"
  end
  # resource path
  local_var_path = "/scores/{score}/comments".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreComment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#post_score_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_score_collaborator(score, collaborator, opts = {}) ⇒ nil

Delete a collaborator Remove the specified collaborator from the score

Parameters:

  • 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;).

  • collaborator

    Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1564
1565
1566
1567
# File 'lib/flat_api/api/score_api.rb', line 1564

def remove_score_collaborator(score, collaborator, opts = {})
  remove_score_collaborator_with_http_info(score, collaborator, opts)
  return nil
end

#remove_score_collaborator_with_http_info(score, collaborator, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a collaborator Remove the specified collaborator from the score

Parameters:

  • 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;).

  • collaborator

    Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
# File 'lib/flat_api/api/score_api.rb', line 1575

def remove_score_collaborator_with_http_info(score, collaborator, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.remove_score_collaborator ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.remove_score_collaborator"
  end
  # verify the required parameter 'collaborator' is set
  if @api_client.config.client_side_validation && collaborator.nil?
    fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.remove_score_collaborator"
  end
  # resource path
  local_var_path = "/scores/{score}/collaborators/{collaborator}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'collaborator' + '}', collaborator.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#remove_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#untrash_score(score, opts = {}) ⇒ nil

Untrash a score This method will remove the score from the ‘trash` collection and from the deletion queue, and add it back to the original collections.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1623
1624
1625
1626
# File 'lib/flat_api/api/score_api.rb', line 1623

def untrash_score(score, opts = {})
  untrash_score_with_http_info(score, opts)
  return nil
end

#untrash_score_with_http_info(score, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Untrash a score This method will remove the score from the &#x60;trash&#x60; collection and from the deletion queue, and add it back to the original collections.

Parameters:

  • 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;).

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
# File 'lib/flat_api/api/score_api.rb', line 1633

def untrash_score_with_http_info(score, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.untrash_score ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.untrash_score"
  end
  # resource path
  local_var_path = "/scores/{score}/untrash".sub('{' + 'score' + '}', score.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#untrash_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_score_comment(score, comment, body, opts = {}) ⇒ ScoreComment

Update an existing comment

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:



1680
1681
1682
1683
# File 'lib/flat_api/api/score_api.rb', line 1680

def update_score_comment(score, comment, body, opts = {})
  data, _status_code, _headers = update_score_comment_with_http_info(score, comment, body, opts)
  return data
end

#update_score_comment_with_http_info(score, comment, body, opts = {}) ⇒ Array<(ScoreComment, Fixnum, Hash)>

Update an existing comment

Parameters:

  • 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;).

  • comment

    Unique identifier of a sheet music comment

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sharing_key (String)

    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.

Returns:

  • (Array<(ScoreComment, Fixnum, Hash)>)

    ScoreComment data, response status code and response headers



1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
# File 'lib/flat_api/api/score_api.rb', line 1693

def update_score_comment_with_http_info(score, comment, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.update_score_comment ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.update_score_comment"
  end
  # verify the required parameter 'comment' is set
  if @api_client.config.client_side_validation && comment.nil?
    fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.update_score_comment"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_comment"
  end
  # resource path
  local_var_path = "/scores/{score}/comments/{comment}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s)

  # query parameters
  query_params = {}
  query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreComment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#update_score_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_score_track(score, track, body, opts = {}) ⇒ ScoreTrack

Update an audio or video track linked to a score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1749
1750
1751
1752
# File 'lib/flat_api/api/score_api.rb', line 1749

def update_score_track(score, track, body, opts = {})
  data, _status_code, _headers = update_score_track_with_http_info(score, track, body, opts)
  return data
end

#update_score_track_with_http_info(score, track, body, opts = {}) ⇒ Array<(ScoreTrack, Fixnum, Hash)>

Update an audio or video track linked to a score

Parameters:

  • 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;).

  • track

    Unique identifier of a score audio track

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ScoreTrack, Fixnum, Hash)>)

    ScoreTrack data, response status code and response headers



1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
# File 'lib/flat_api/api/score_api.rb', line 1761

def update_score_track_with_http_info(score, track, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ScoreApi.update_score_track ..."
  end
  # verify the required parameter 'score' is set
  if @api_client.config.client_side_validation && score.nil?
    fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.update_score_track"
  end
  # verify the required parameter 'track' is set
  if @api_client.config.client_side_validation && track.nil?
    fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.update_score_track"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_track"
  end
  # resource path
  local_var_path = "/scores/{score}/tracks/{track}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'track' + '}', track.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ScoreTrack')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ScoreApi#update_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end