|
33 | 33 | name: Flat |
34 | 34 | url: https://flat.io/developers/docs/api/ |
35 | 35 | email: developers@flat.io |
36 | | - version: 2.20.0 |
| 36 | + version: 2.20.1 |
37 | 37 | x-logo: |
38 | 38 | url: https://prod.flat-cdn.com/img/logo-flat.svg |
39 | 39 | servers: |
@@ -124,37 +124,37 @@ paths: |
124 | 124 | - account.public_profile |
125 | 125 | - account.education_profile |
126 | 126 | x-codeSamples: |
127 | | - - lang: 'Python' |
128 | | - source: | |
129 | | - from pprint import pprint |
130 | | - import os |
| 127 | + - lang: Python |
| 128 | + source: | |
| 129 | + from pprint import pprint |
| 130 | + import os |
131 | 131 |
|
132 | | - import flat_api |
133 | | - from flat_api.rest import ApiException |
| 132 | + import flat_api |
| 133 | + from flat_api.rest import ApiException |
134 | 134 |
|
135 | | - configuration = flat_api.Configuration() |
136 | | - configuration.access_token = os.environ['FLAT_ACCESS_TOKEN'] |
137 | | - flat_api_client = flat_api.ApiClient(configuration) |
138 | | - try: |
139 | | - pprint(flat_api.AccountApi(flat_api_client).get_authenticated_user()) |
140 | | - except ApiException as e: |
141 | | - print(e) |
142 | | - - lang: 'PHP' |
143 | | - source: | |
144 | | - <?php |
145 | | - require_once(__DIR__ . '/vendor/autoload.php'); |
| 135 | + configuration = flat_api.Configuration() |
| 136 | + configuration.access_token = os.environ['FLAT_ACCESS_TOKEN'] |
| 137 | + flat_api_client = flat_api.ApiClient(configuration) |
| 138 | + try: |
| 139 | + pprint(flat_api.AccountApi(flat_api_client).get_authenticated_user()) |
| 140 | + except ApiException as e: |
| 141 | + print(e) |
| 142 | + - lang: PHP |
| 143 | + source: | |
| 144 | + <?php |
| 145 | + require_once(__DIR__ . '/vendor/autoload.php'); |
146 | 146 |
|
147 | | - // Configure OAuth2 access token |
148 | | - Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']); |
| 147 | + // Configure OAuth2 access token |
| 148 | + Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']); |
149 | 149 |
|
150 | | - $api = new Flat\APIClient\Api\AccountApi(); |
| 150 | + $api = new Flat\APIClient\Api\AccountApi(); |
151 | 151 |
|
152 | | - try { |
153 | | - $result = $api->getAuthenticatedUser(); |
154 | | - print_r($result); |
155 | | - } catch (Exception $e) { |
156 | | - echo 'Exception when calling AccountApi->getAuthenticatedUser: ', $e->getMessage(), PHP_EOL; |
157 | | - } |
| 152 | + try { |
| 153 | + $result = $api->getAuthenticatedUser(); |
| 154 | + print_r($result); |
| 155 | + } catch (Exception $e) { |
| 156 | + echo 'Exception when calling AccountApi->getAuthenticatedUser: ', $e->getMessage(), PHP_EOL; |
| 157 | + } |
158 | 158 | /scores: |
159 | 159 | post: |
160 | 160 | tags: |
@@ -213,75 +213,75 @@ paths: |
213 | 213 | - scores |
214 | 214 | x-codegen-request-body-name: body |
215 | 215 | x-codeSamples: |
216 | | - - lang: 'Ruby' |
217 | | - source: | |
218 | | - require 'flat_api' |
219 | | - FlatApi.configure do |config| |
220 | | - config.access_token = 'your_access_token' |
221 | | - end |
222 | | - begin |
223 | | - score_data = File.open("my-score.musicxml", "r:UTF-8") { |f| f.read } |
224 | | - body = FlatApi::ScoreCreationFileImport.new({ |
225 | | - title: 'Score Title', |
226 | | - data: score_data, |
227 | | - }) |
228 | | - p FlatApi::ScoreApi.new.create_score(body) |
229 | | - rescue FlatApi::ApiError => e |
230 | | - puts "Error when calling ScoreApi->create_score: #{e}" |
231 | | - end |
232 | | - - lang: 'Python' |
233 | | - source: | |
234 | | - from pprint import pprint |
235 | | - import os |
236 | | - from urllib.request import urlopen |
237 | | - from urllib.error import HTTPError |
| 216 | + - lang: Ruby |
| 217 | + source: | |
| 218 | + require 'flat_api' |
| 219 | + FlatApi.configure do |config| |
| 220 | + config.access_token = 'your_access_token' |
| 221 | + end |
| 222 | + begin |
| 223 | + score_data = File.open("my-score.musicxml", "r:UTF-8") { |f| f.read } |
| 224 | + body = FlatApi::ScoreCreationFileImport.new({ |
| 225 | + title: 'Score Title', |
| 226 | + data: score_data, |
| 227 | + }) |
| 228 | + p FlatApi::ScoreApi.new.create_score(body) |
| 229 | + rescue FlatApi::ApiError => e |
| 230 | + puts "Error when calling ScoreApi->create_score: #{e}" |
| 231 | + end |
| 232 | + - lang: Python |
| 233 | + -forrce: | |
| 234 | + from pprint import pprint |
| 235 | + import os |
| 236 | + from urllib.request import urlopen |
| 237 | + from urllib.error import HTTPError |
238 | 238 |
|
239 | | - import flat_api |
240 | | - from flat_api.rest import ApiException |
| 239 | + import flat_api |
| 240 | + from flat_api.rest import ApiException |
241 | 241 |
|
242 | | - SCORE_TO_IMPORT='https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml' |
| 242 | + SCORE_TO_IMPORT='https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml' |
243 | 243 |
|
244 | | - configuration = flat_api.Configuration() |
245 | | - configuration.access_token = os.environ['FLAT_ACCESS_TOKEN'] |
246 | | - flat_api_client = flat_api.ApiClient(configuration) |
| 244 | + configuration = flat_api.Configuration() |
| 245 | + configuration.access_token = os.environ['FLAT_ACCESS_TOKEN'] |
| 246 | + flat_api_client = flat_api.ApiClient(configuration) |
247 | 247 |
|
248 | | - try: |
249 | | - # Download a MusicXML "Hello World" |
250 | | - hello_world = urlopen(SCORE_TO_IMPORT).read().decode('utf-8') |
| 248 | + try: |
| 249 | + # Download a MusicXML "Hello World" |
| 250 | + hello_world = urlopen(SCORE_TO_IMPORT).read().decode('utf-8') |
251 | 251 |
|
252 | | - # The new score meta, including the MusicXML file as `data` |
253 | | - new_score = flat_api.ScoreCreation( |
254 | | - title='Hello World', |
255 | | - privacy='private', |
256 | | - data=hello_world |
257 | | - ) |
| 252 | + # The new score meta, including the MusicXML file as `data` |
| 253 | + new_score = flat_api.ScoreCreation( |
| 254 | + title='Hello World', |
| 255 | + privacy='private', |
| 256 | + data=hello_world |
| 257 | + ) |
258 | 258 |
|
259 | | - # Create the document and print the meta returned by the API |
260 | | - pprint(flat_api.ScoreApi(flat_api_client).create_score(new_score)) |
261 | | - except (ApiException, HTTPError) as e: |
262 | | - print(e) |
263 | | - - lang: 'PHP' |
264 | | - source: | |
265 | | - <?php |
266 | | - require_once(__DIR__ . '/vendor/autoload.php'); |
| 259 | + # Create the document and print the meta returned by the API |
| 260 | + pprint(flat_api.ScoreApi(flat_api_client).create_score(new_score)) |
| 261 | + except (ApiException, HTTPError) as e: |
| 262 | + print(e) |
| 263 | + - lang: PHP |
| 264 | + source: | |
| 265 | + <?php |
| 266 | + require_once(__DIR__ . '/vendor/autoload.php'); |
267 | 267 |
|
268 | | - // Configure OAuth2 access token |
269 | | - Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']); |
| 268 | + // Configure OAuth2 access token |
| 269 | + Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']); |
270 | 270 |
|
271 | | - $musicXml = file_get_contents('https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml'); |
| 271 | + $musicXml = file_get_contents('https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml'); |
272 | 272 |
|
273 | | - try { |
274 | | - $body = new \Flat\APIClient\Model\ScoreCreation(); |
275 | | - $body->setTitle('Hello world'); |
276 | | - $body->setPrivacy('private'); |
277 | | - $body->setData($musicXml); |
| 273 | + try { |
| 274 | + $body = new \Flat\APIClient\Model\ScoreCreation(); |
| 275 | + $body->setTitle('Hello world'); |
| 276 | + $body->setPrivacy('private'); |
| 277 | + $body->setData($musicXml); |
278 | 278 |
|
279 | | - $scoreApi = new Flat\APIClient\Api\ScoreApi(); |
280 | | - $result = $scoreApi->createScore($body); |
281 | | - print_r($result); |
282 | | - } catch (Exception $e) { |
283 | | - echo 'Exception when calling ScoreApi->createScore: ', $e->getMessage(), PHP_EOL; |
284 | | - } |
| 279 | + $scoreApi = new Flat\APIClient\Api\ScoreApi(); |
| 280 | + $result = $scoreApi->createScore($body); |
| 281 | + print_r($result); |
| 282 | + } catch (Exception $e) { |
| 283 | + echo 'Exception when calling ScoreApi->createScore: ', $e->getMessage(), PHP_EOL; |
| 284 | + } |
285 | 285 | /scores/{score}: |
286 | 286 | parameters: |
287 | 287 | - name: score |
@@ -4918,7 +4918,6 @@ components: |
4918 | 4918 | - type: object |
4919 | 4919 | required: |
4920 | 4920 | - creationDate |
4921 | | - - rights |
4922 | 4921 | - collaborators |
4923 | 4922 | - instruments |
4924 | 4923 | - samples |
|
0 commit comments