class FlatApi::ScoreApi
Attributes
Public Class Methods
# File lib/flat_api/api/score_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Add a new collaborator Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [ResourceCollaborator]
# 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 a new collaborator Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [Array<(ResourceCollaborator
, Fixnum, Hash)>] ResourceCollaborator
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 40 def add_score_collaborator_with_http_info(score, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.add_score_collaborator ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.add_score_collaborator" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.add_score_collaborator" end # resource path local_var_path = "/scores/{score}/collaborators".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ResourceCollaborator') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#add_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [ScoreTrack]
# 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 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [Array<(ScoreTrack
, Fixnum, Hash)>] ScoreTrack
data, response status code and response headers
# 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 a new score Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`) or a MIDI (`audio/midi`) file to create the new Flat document. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. This can be the `root` collection or a different collection based on the user's settings or API authentication method. If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. @param body @param [Hash] opts the optional parameters @return [ScoreDetails]
# 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 a new revision Update a score by uploading a new revision for this one. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [ScoreRevision]
# 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 a new revision Update a score by uploading a new revision for this one. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @return [Array<(ScoreRevision
, Fixnum, Hash)>] ScoreRevision
data, response status code and response headers
# 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 a new score Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`) or a MIDI (`audio/midi`) file to create the new Flat document. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. This can be the `root` collection or a different collection based on the user's settings or API authentication method. If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. @param body @param [Hash] opts the optional parameters @return [Array<(ScoreDetails
, Fixnum, Hash)>] ScoreDetails
data, response status code and response headers
# 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 a score This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [nil]
# 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 a comment
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [nil]
# 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 a comment
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
Remove an audio or video track linked to the score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param [Hash] opts the optional parameters @return [nil]
# 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
Remove an audio or video track linked to the score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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 a score This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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 a score's metadata This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title` of the score, the API metadata are updated directly when calling this method, unlike the data itself. The title in the score data will be "lazy" updated at the next score save with the editor or our internal save. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [ScoreModification] :body @return [ScoreDetails]
# 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 a score's metadata This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title` of the score, the API metadata are updated directly when calling this method, unlike the data itself. The title in the score data will be "lazy" updated at the next score save with the editor or our internal save. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [ScoreModification] :body @return [Array<(ScoreDetails
, Fixnum, Hash)>] ScoreDetails
data, response status code and response headers
# 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 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreDetails]
# 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 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreDetails
, Fixnum, Hash)>] ScoreDetails
data, response status code and response headers
# 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
List liked scores
@param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :ids Return only the identifiers of the scores @return [Array<ScoreDetails>]
# 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
List liked scores
@param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :ids Return only the identifiers of the scores @return [Array<(Array<ScoreDetails>, Fixnum, Hash)>] Array<ScoreDetails> data, response status code and response headers
# 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
List group's scores Get the list of scores shared with a group. @param group Unique identifier of a Flat group @param [Hash] opts the optional parameters @option opts [String] :parent Filter the score forked from the score id `parent` @return [Array<ScoreDetails>]
# 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
List group's scores Get the list of scores shared with a group. @param group Unique identifier of a Flat group @param [Hash] opts the optional parameters @option opts [String] :parent Filter the score forked from the score id `parent` @return [Array<(Array<ScoreDetails>, Fixnum, Hash)>] Array<ScoreDetails> data, response status code and response headers
# 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 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreDetails]
# 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 a collaborator Get the information about a collaborator (User or Group
). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ResourceCollaborator]
# 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 a collaborator Get the information about a collaborator (User or Group
). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ResourceCollaborator
, Fixnum, Hash)>] ResourceCollaborator
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 752 def get_score_collaborator_with_http_info(score, collaborator, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_collaborator ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_collaborator" end # verify the required parameter 'collaborator' is set if @api_client.config.client_side_validation && collaborator.nil? fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.get_score_collaborator" end # resource path local_var_path = "/scores/{score}/collaborators/{collaborator}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'collaborator' + '}', collaborator.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ResourceCollaborator') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
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). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<ResourceCollaborator>]
# 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
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). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(Array<ResourceCollaborator>, Fixnum, Hash)>] Array<ResourceCollaborator> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 814 def get_score_collaborators_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_collaborators ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_collaborators" end # resource path local_var_path = "/scores/{score}/collaborators".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ResourceCollaborator>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_collaborators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List comments This method lists the different comments added on a music score (documents and inline) sorted by their post dates. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @option opts [String] :type Filter the comments by type @option opts [String] :sort Sort @option opts [String] :direction Sort direction @return [Array<ScoreComment>]
# File lib/flat_api/api/score_api.rb, line 864 def get_score_comments(score, opts = {}) data, _status_code, _headers = get_score_comments_with_http_info(score, opts) return data end
List comments This method lists the different comments added on a music score (documents and inline) sorted by their post dates. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @option opts [String] :type Filter the comments by type @option opts [String] :sort Sort @option opts [String] :direction Sort direction @return [Array<(Array<ScoreComment>, Fixnum, Hash)>] Array<ScoreComment> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 878 def get_score_comments_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_comments ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_comments" end if @api_client.config.client_side_validation && opts[:'type'] && !['document', 'inline'].include?(opts[:'type']) fail ArgumentError, 'invalid value for "type", must be one of document, inline' end if @api_client.config.client_side_validation && opts[:'sort'] && !['date'].include?(opts[:'sort']) fail ArgumentError, 'invalid value for "sort", must be one of date' end if @api_client.config.client_side_validation && opts[:'direction'] && !['asc', 'desc'].include?(opts[:'direction']) fail ArgumentError, 'invalid value for "direction", must be one of asc, desc' end # resource path local_var_path = "/scores/{score}/comments".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ScoreComment>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreRevision]
# File lib/flat_api/api/score_api.rb, line 938 def get_score_revision(score, revision, opts = {}) data, _status_code, _headers = get_score_revision_with_http_info(score, revision, opts) return data end
Get 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`). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. @param format The format of the file you will retrieve @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @option opts [String] :parts An optional a set of parts to be exported. This parameter must be specified with a list of integers. For example "1,2,5". @option opts [BOOLEAN] :only_cached Only return files already generated and cached in Flat's production cache. If the file is not availabe, a 404 will be returned @return [String]
# File lib/flat_api/api/score_api.rb, line 1005 def get_score_revision_data(score, revision, format, opts = {}) data, _status_code, _headers = get_score_revision_data_with_http_info(score, revision, format, opts) return data end
Get 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`). @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. @param format The format of the file you will retrieve @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @option opts [String] :parts An optional a set of parts to be exported. This parameter must be specified with a list of integers. For example "1,2,5". @option opts [BOOLEAN] :only_cached Only return files already generated and cached in Flat's production cache. If the file is not availabe, a 404 will be returned @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1020 def get_score_revision_data_with_http_info(score, revision, format, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revision_data ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revision_data" end # verify the required parameter 'revision' is set if @api_client.config.client_side_validation && revision.nil? fail ArgumentError, "Missing the required parameter 'revision' when calling ScoreApi.get_score_revision_data" end # verify the required parameter 'format' is set if @api_client.config.client_side_validation && format.nil? fail ArgumentError, "Missing the required parameter 'format' when calling ScoreApi.get_score_revision_data" end # verify enum value if @api_client.config.client_side_validation && !['json', 'mxl', 'xml', 'mp3', 'wav', 'midi', 'thumbnail.png'].include?(format) fail ArgumentError, "invalid value for 'format', must be one of json, mxl, xml, mp3, wav, midi, thumbnail.png" end # resource path local_var_path = "/scores/{score}/revisions/{revision}/{format}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'revision' + '}', revision.to_s).sub('{' + 'format' + '}', format.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? query_params[:'parts'] = opts[:'parts'] if !opts[:'parts'].nil? query_params[:'onlyCached'] = opts[:'only_cached'] if !opts[:'only_cached'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/vnd.recordare.musicxml+xml', 'application/vnd.recordare.musicxml', 'audio/mp3', 'audio/wav', 'audio/midi', 'image/png']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_revision_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param revision Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreRevision
, Fixnum, Hash)>] ScoreRevision
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 950 def get_score_revision_with_http_info(score, revision, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revision ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revision" end # verify the required parameter 'revision' is set if @api_client.config.client_side_validation && revision.nil? fail ArgumentError, "Missing the required parameter 'revision' when calling ScoreApi.get_score_revision" end # resource path local_var_path = "/scores/{score}/revisions/{revision}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'revision' + '}', revision.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScoreRevision') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<ScoreRevision>]
# File lib/flat_api/api/score_api.rb, line 1081 def get_score_revisions(score, opts = {}) data, _status_code, _headers = get_score_revisions_with_http_info(score, opts) return data end
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(Array<ScoreRevision>, Fixnum, Hash)>] Array<ScoreRevision> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1092 def get_score_revisions_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_revisions ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_revisions" end # resource path local_var_path = "/scores/{score}/revisions".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ScoreRevision>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<AssignmentSubmission>]
# File lib/flat_api/api/score_api.rb, line 1138 def get_score_submissions(score, opts = {}) data, _status_code, _headers = get_score_submissions_with_http_info(score, opts) return data end
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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<(Array<AssignmentSubmission>, Fixnum, Hash)>] Array<AssignmentSubmission> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1148 def get_score_submissions_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_submissions ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_submissions" end # resource path local_var_path = "/scores/{score}/submissions".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<AssignmentSubmission>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_submissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieve the details of an audio or video track linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreTrack]
# File lib/flat_api/api/score_api.rb, line 1195 def get_score_track(score, track, opts = {}) data, _status_code, _headers = get_score_track_with_http_info(score, track, opts) return data end
Retrieve the details of an audio or video track linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreTrack
, Fixnum, Hash)>] ScoreTrack
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1207 def get_score_track_with_http_info(score, track, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_score_track ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.get_score_track" end # verify the required parameter 'track' is set if @api_client.config.client_side_validation && track.nil? fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.get_score_track" end # resource path local_var_path = "/scores/{score}/tracks/{track}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'track' + '}', track.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScoreTrack') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get 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. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreDetails
, Fixnum, Hash)>] ScoreDetails
data, response status code and response headers
# 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
List user's scores Get the list of public scores owned by a User. DEPRECATED: Please note that the current behavior will be deprecrated on 2019-01-01. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](tag/Collection) instead. @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. @param [Hash] opts the optional parameters @option opts [String] :parent Filter the score forked from the score id `parent` @return [Array<ScoreDetails>]
# File lib/flat_api/api/score_api.rb, line 1258 def get_user_scores(user, opts = {}) data, _status_code, _headers = get_user_scores_with_http_info(user, opts) return data end
List user's scores Get the list of public scores owned by a User. DEPRECATED: Please note that the current behavior will be deprecrated on 2019-01-01. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](tag/Collection) instead. @param user Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. @param [Hash] opts the optional parameters @option opts [String] :parent Filter the score forked from the score id `parent` @return [Array<(Array<ScoreDetails>, Fixnum, Hash)>] Array<ScoreDetails> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1269 def get_user_scores_with_http_info(user, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.get_user_scores ..." end # verify the required parameter 'user' is set if @api_client.config.client_side_validation && user.nil? fail ArgumentError, "Missing the required parameter 'user' when calling ScoreApi.get_user_scores" end # resource path local_var_path = "/users/{user}/scores".sub('{' + 'user' + '}', user.to_s) # query parameters query_params = {} query_params[:'parent'] = opts[:'parent'] if !opts[:'parent'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ScoreDetails>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#get_user_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List the audio or video tracks linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<ScoreTrack>]
# File lib/flat_api/api/score_api.rb, line 1316 def list_score_tracks(score, opts = {}) data, _status_code, _headers = list_score_tracks_with_http_info(score, opts) return data end
List the audio or video tracks linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(Array<ScoreTrack>, Fixnum, Hash)>] Array<ScoreTrack> data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1327 def list_score_tracks_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.list_score_tracks ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.list_score_tracks" end # resource path local_var_path = "/scores/{score}/tracks".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<ScoreTrack>') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#list_score_tracks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Mark the comment as resolved
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [nil]
# File lib/flat_api/api/score_api.rb, line 1375 def mark_score_comment_resolved(score, comment, opts = {}) mark_score_comment_resolved_with_http_info(score, comment, opts) return nil end
Mark the comment as resolved
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1387 def mark_score_comment_resolved_with_http_info(score, comment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.mark_score_comment_resolved ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.mark_score_comment_resolved" end # verify the required parameter 'comment' is set if @api_client.config.client_side_validation && comment.nil? fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_resolved" end # resource path local_var_path = "/scores/{score}/comments/{comment}/resolved".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#mark_score_comment_resolved\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Mark the comment as unresolved
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [nil]
# File lib/flat_api/api/score_api.rb, line 1438 def mark_score_comment_unresolved(score, comment, opts = {}) mark_score_comment_unresolved_with_http_info(score, comment, opts) return nil end
Mark the comment as unresolved
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1450 def mark_score_comment_unresolved_with_http_info(score, comment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.mark_score_comment_unresolved ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.mark_score_comment_unresolved" end # verify the required parameter 'comment' is set if @api_client.config.client_side_validation && comment.nil? fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.mark_score_comment_unresolved" end # resource path local_var_path = "/scores/{score}/comments/{comment}/resolved".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#mark_score_comment_unresolved\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Post 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`. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreComment]
# File lib/flat_api/api/score_api.rb, line 1501 def post_score_comment(score, body, opts = {}) data, _status_code, _headers = post_score_comment_with_http_info(score, body, opts) return data end
Post 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`. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreComment
, Fixnum, Hash)>] ScoreComment
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1513 def post_score_comment_with_http_info(score, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.post_score_comment ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.post_score_comment" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.post_score_comment" end # resource path local_var_path = "/scores/{score}/comments".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScoreComment') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#post_score_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a collaborator Remove the specified collaborator from the score @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group @param [Hash] opts the optional parameters @return [nil]
# File lib/flat_api/api/score_api.rb, line 1564 def remove_score_collaborator(score, collaborator, opts = {}) remove_score_collaborator_with_http_info(score, collaborator, opts) return nil end
Delete a collaborator Remove the specified collaborator from the score @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param collaborator Unique identifier of a **collaborator permission**, or unique identifier of a User, or unique identifier of a Group @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1575 def remove_score_collaborator_with_http_info(score, collaborator, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.remove_score_collaborator ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.remove_score_collaborator" end # verify the required parameter 'collaborator' is set if @api_client.config.client_side_validation && collaborator.nil? fail ArgumentError, "Missing the required parameter 'collaborator' when calling ScoreApi.remove_score_collaborator" end # resource path local_var_path = "/scores/{score}/collaborators/{collaborator}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'collaborator' + '}', collaborator.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#remove_score_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Untrash a score This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [nil]
# File lib/flat_api/api/score_api.rb, line 1623 def untrash_score(score, opts = {}) untrash_score_with_http_info(score, opts) return nil end
Untrash a score This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. @param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1633 def untrash_score_with_http_info(score, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.untrash_score ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.untrash_score" end # resource path local_var_path = "/scores/{score}/untrash".sub('{' + 'score' + '}', score.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#untrash_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update an existing comment
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [ScoreComment]
# File lib/flat_api/api/score_api.rb, line 1680 def update_score_comment(score, comment, body, opts = {}) data, _status_code, _headers = update_score_comment_with_http_info(score, comment, body, opts) return data end
Update an existing comment
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param comment Unique identifier of a sheet music comment @param body @param [Hash] opts the optional parameters @option opts [String] :sharing_key This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. @return [Array<(ScoreComment
, Fixnum, Hash)>] ScoreComment
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1693 def update_score_comment_with_http_info(score, comment, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.update_score_comment ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.update_score_comment" end # verify the required parameter 'comment' is set if @api_client.config.client_side_validation && comment.nil? fail ArgumentError, "Missing the required parameter 'comment' when calling ScoreApi.update_score_comment" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_comment" end # resource path local_var_path = "/scores/{score}/comments/{comment}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'comment' + '}', comment.to_s) # query parameters query_params = {} query_params[:'sharingKey'] = opts[:'sharing_key'] if !opts[:'sharing_key'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScoreComment') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#update_score_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update an audio or video track linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param body @param [Hash] opts the optional parameters @return [ScoreTrack]
# File lib/flat_api/api/score_api.rb, line 1749 def update_score_track(score, track, body, opts = {}) data, _status_code, _headers = update_score_track_with_http_info(score, track, body, opts) return data end
Update an audio or video track linked to a score
@param score Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). @param track Unique identifier of a score audio track @param body @param [Hash] opts the optional parameters @return [Array<(ScoreTrack
, Fixnum, Hash)>] ScoreTrack
data, response status code and response headers
# File lib/flat_api/api/score_api.rb, line 1761 def update_score_track_with_http_info(score, track, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ScoreApi.update_score_track ..." end # verify the required parameter 'score' is set if @api_client.config.client_side_validation && score.nil? fail ArgumentError, "Missing the required parameter 'score' when calling ScoreApi.update_score_track" end # verify the required parameter 'track' is set if @api_client.config.client_side_validation && track.nil? fail ArgumentError, "Missing the required parameter 'track' when calling ScoreApi.update_score_track" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ScoreApi.update_score_track" end # resource path local_var_path = "/scores/{score}/tracks/{track}".sub('{' + 'score' + '}', score.to_s).sub('{' + 'track' + '}', track.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['OAuth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ScoreTrack') if @api_client.config.debugging @api_client.config.logger.debug "API called: ScoreApi#update_score_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end