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 = {}) ⇒ ScoreCollaborator

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 document. - To add an existing Flat user to the document, specify its unique identifier in the ‘user` property. - To invite an external user to the document, specify its email in the `userEmail` property. - To add a Flat group to the document, 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<(ScoreCollaborator, 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 document. - To add an existing Flat user to the document, specify its unique identifier in the &#x60;user&#x60; property. - To invite an external user to the document, specify its email in the &#x60;userEmail&#x60; property. - To add a Flat group to the document, 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<(ScoreCollaborator, Fixnum, Hash)>)

    ScoreCollaborator 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 => 'ScoreCollaborator')
  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).

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

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 API call will schedule the deletion of the score, its revisions, and whole history. The user calling this API method must have the ‘aclAdmin` rights on this document to process this action. The score won’t be accessible anymore after calling this method and the user’s quota will directly be updated.

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 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 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 API call will schedule the deletion of the score, its revisions, and whole history. The user calling this API method must have the &#x60;aclAdmin&#x60; rights on this document to process this action. The score won&#39;t be accessible anymore after calling this method and the user&#39;s quota will directly be updated.

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

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

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 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 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 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 = {}) ⇒ ScoreCollaborator

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 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<(ScoreCollaborator, 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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:

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

    ScoreCollaborator 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 => 'ScoreCollaborator')
  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<ScoreCollaborator>

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 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<ScoreCollaborator>, 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 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<ScoreCollaborator>, Fixnum, Hash)>)

    Array<ScoreCollaborator> 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<ScoreCollaborator>')
  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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



861
862
863
864
# File 'lib/flat_api/api/score_api.rb', line 861

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 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<ScoreComment>, Fixnum, Hash)>)

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



872
873
874
875
876
877
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
# File 'lib/flat_api/api/score_api.rb', line 872

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
  # 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 = 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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



920
921
922
923
# File 'lib/flat_api/api/score_api.rb', line 920

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

  • :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

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

Returns:

  • (String)


987
988
989
990
# File 'lib/flat_api/api/score_api.rb', line 987

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

  • :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

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

Returns:

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

    String data, response status code and response headers



1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
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
# File 'lib/flat_api/api/score_api.rb', line 1002

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[:'onlyCached'] = opts[:'only_cached'] if !opts[:'only_cached'].nil?
  query_params[:'parts'] = opts[:'parts'] if !opts[:'parts'].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 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



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
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
# File 'lib/flat_api/api/score_api.rb', line 932

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



1063
1064
1065
1066
# File 'lib/flat_api/api/score_api.rb', line 1063

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 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



1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
# File 'lib/flat_api/api/score_api.rb', line 1074

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:



1120
1121
1122
1123
# File 'lib/flat_api/api/score_api.rb', line 1120

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



1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File 'lib/flat_api/api/score_api.rb', line 1130

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



1177
1178
1179
1180
# File 'lib/flat_api/api/score_api.rb', line 1177

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 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



1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
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
# File 'lib/flat_api/api/score_api.rb', line 1189

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 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 scores owned by the User

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:



1240
1241
1242
1243
# File 'lib/flat_api/api/score_api.rb', line 1240

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 scores owned by the User

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



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
# File 'lib/flat_api/api/score_api.rb', line 1251

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



1298
1299
1300
1301
# File 'lib/flat_api/api/score_api.rb', line 1298

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 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



1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
# File 'lib/flat_api/api/score_api.rb', line 1309

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:

  • (nil)


1357
1358
1359
1360
# File 'lib/flat_api/api/score_api.rb', line 1357

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 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



1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
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
# File 'lib/flat_api/api/score_api.rb', line 1369

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:

  • (nil)


1420
1421
1422
1423
# File 'lib/flat_api/api/score_api.rb', line 1420

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 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



1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
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
# File 'lib/flat_api/api/score_api.rb', line 1432

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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



1483
1484
1485
1486
# File 'lib/flat_api/api/score_api.rb', line 1483

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 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



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
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
# File 'lib/flat_api/api/score_api.rb', line 1495

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)


1546
1547
1548
1549
# File 'lib/flat_api/api/score_api.rb', line 1546

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



1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
# File 'lib/flat_api/api/score_api.rb', line 1557

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

#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 with a &#x60;privacy&#x60; mode set to &#x60;privateLink&#x60; and the current user is not a collaborator of the document.

Returns:



1608
1609
1610
1611
# File 'lib/flat_api/api/score_api.rb', line 1608

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 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



1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
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
# File 'lib/flat_api/api/score_api.rb', line 1621

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:



1677
1678
1679
1680
# File 'lib/flat_api/api/score_api.rb', line 1677

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



1689
1690
1691
1692
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
# File 'lib/flat_api/api/score_api.rb', line 1689

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