lib/Net/Async/Spotify/API/Generated/Player.pm

filter: Statementstmt 24.6% 32 / 130 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 26.3% 5 / 19 Podpod 100% 14 / 14 totaltotal 31.2% 51 / 163 SCAR 3.6
CC
1
Cov
25%
add_to_queue
2.0
get_a_users_available_devices
2.0
get_information_about_the_users_current_playback
2.0
CRAP 1.4
« lib/Net/Async/Spotify/API/Generated/Library.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Playlists.pm »
1 package Net::Async::Spotify::API::Generated::Player;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.001'; # VERSION
7 2 our $AUTHORITY = 'cpan:VNEALV'; # AUTHORITY
8  
9 2 ▶use mro;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use parent qw(Net::Async::Spotify::API::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Future::AsyncAwait;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 =encoding utf8
15  
16 =head1 NAME
17  
18 Net::Async::Spotify::API::Generated::Player - Package representing Spotify Player API
19  
20 =head1 DESCRIPTION
21  
22 Autogenerated module.
23 Based on https://developer.spotify.com/documentation/web-api/reference/#reference-index
24 Check C<crawl-api-doc.pl> for more information.
25  
26 =head1 METHODS
27  
28 =cut
29  
30 =head2 add_to_queue
31  
32 add_to_queue - Add an item to queue
33  
34 Add an item to the end of the user’s current playback queue.
35  
36 with Request details being:
37  
38 =head3 header
39  
40 =over 4
41  
42 =item Authorization
43  
44 Type: string | Required: required
45 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback
46  
47 =back
48  
49 =head3 query_parameter
50  
51 =over 4
52  
53 =item device_id
54  
55 Type: string | Required: optional
56 The id of the device this command is targeting. If
57 not supplied, the user’s currently active device is the target.
58  
59 =item uri
60  
61 Type: string | Required: required
62 The uri of the item to add to the queue. Must be a track or an episode uri.
63  
64 =back
65  
66 and Response Objects being:
67  
68  
69  
70 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
71  
72 =cut
73  
74 0 ▶async sub add_to_queue {
Subroutine add_to_queue: not called CC=1 SCAR=6.9
Pod documented
75 0 my ($self, %args) = @_;
76  
77 0 my $request->{method} = 'POST';
78 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/queue';
79 $request->{param} = {
80 0 header => {
81 'Authorization' => {
82 type => 'string',
83 required => 'required',
84 },
85 },
86 query_parameter => {
87 'device_id' => {
88 type => 'string',
89 required => 'optional',
90 },
91 'uri' => {
92 type => 'string',
93 required => 'required',
94 },
95 },
96 };
97 0 my $response_objs = [
98  
99 ];
100  
101 0 await $self->call_api($request, $response_objs, %args);
102 2 }
103  
104 =head2 get_a_users_available_devices
105  
106 get_a_users_available_devices - Get a User's Available Devices
107  
108 Get information about a user’s available devices.
109  
110 with Request details being:
111  
112 =head3 header
113  
114 =over 4
115  
116 =item Authorization
117  
118 Type: string | Required: required
119 A valid access token from the Spotify Accounts service:
120 see the Web API Authorization Guide
121 for details. The access token must have been issued on behalf of a user.
122 The access token must have the user-read-playback-state scope authorized
123 in order to read information.
124  
125 =back
126  
127 and Response Objects being:
128  
129 - device object
130  
131  
132 A successful request will return a 200 OK response code with a json payload that contains the device objects (see below).
133 When no available devices are found, the request will return a 200 OK response with an empty devices list.Try in our Web Console
134  
135 =cut
136  
137 0 ▶async sub get_a_users_available_devices {
Subroutine get_a_users_available_devices: not called CC=1 SCAR=6.9
Pod documented
138 0 my ($self, %args) = @_;
139  
140 0 my $request->{method} = 'GET';
141 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/devices';
142 $request->{param} = {
143 0 header => {
144 'Authorization' => {
145 type => 'string',
146 required => 'required',
147 },
148 },
149 };
150 0 my $response_objs = [
151 'device object',
152  
153 ];
154  
155 0 await $self->call_api($request, $response_objs, %args);
156 2 }
157  
158 =head2 get_information_about_the_users_current_playback
159  
160 get_information_about_the_users_current_playback - Get Information About The User's Current Playback
161  
162 Get information about the user’s current playback state, including track or episode, progress, and active device.
163  
164 with Request details being:
165  
166 =head3 header
167  
168 =over 4
169  
170 =item Authorization
171  
172 Type: string | Required: required
173 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.
174  
175 =back
176  
177 =head3 query_parameter
178  
179 =over 4
180  
181 =item additional_types
182  
183 Type: string | Required: optional
184 A comma-separated list of item types that your client supports besides the default track type. Valid types are: track and episode. An unsupported type in the response is expected to be represented as null value in the item field.
185 Note: This parameter was introduced to allow existing clients to maintain their current behaviour and might be deprecated in the future. In addition to providing this parameter, make sure that your client properly handles cases of new
186  
187 =item market
188  
189 Type: string | Required: optional
190 An ISO 3166-1 alpha-2 country code
191 or the string from_token. Provide this parameter if you want to apply Track
192 Relinking.
193  
194 =back
195  
196 and Response Objects being:
197  
198  
199  
200 A successful request will return a 200 OK response code with a json payload that contains information about the current playback. The information returned is for the last known state, which means an inactive device could be returned if it was the last one to execute playback.
201 When no available devices are found, the request will return a 200 OK response but with no data populated.Try in our Web Console
202  
203 =cut
204  
205 0 ▶async sub get_information_about_the_users_current_playback {
Subroutine get_information_about_the_users_current_playback: not called CC=1 SCAR=6.9
Pod documented
206 0 my ($self, %args) = @_;
207  
208 0 my $request->{method} = 'GET';
209 0 $request->{uri} = 'https://api.spotify.com/v1/me/player';
210 $request->{param} = {
211 0 header => {
212 'Authorization' => {
213 type => 'string',
214 required => 'required',
215 },
216 },
217 query_parameter => {
218 'additional_types' => {
219 type => 'string',
220 required => 'optional',
221 },
222 'market' => {
223 type => 'string',
224 required => 'optional',
225 },
226 },
227 };
228 0 my $response_objs = [
229  
230 ];
231  
232 0 await $self->call_api($request, $response_objs, %args);
233 2 }
234  
235 =head2 get_recently_played
236  
237 get_recently_played - Get Current User's Recently Played Tracks
238  
239 Get tracks from the current user’s recently played tracks.
240 Note: Currently doesn’t support podcast episodes.
241  
242 with Request details being:
243  
244 =head3 header
245  
246 =over 4
247  
248 =item Authorization
249  
250 Type: string | Required: required
251 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details. The access token must have been issued on behalf of a user.
252  
253 =back
254  
255 =head3 query_parameter
256  
257 =over 4
258  
259 =item after
260  
261 Type: integer | Required: optional
262 A Unix timestamp in milliseconds. Returns all items
263 after (but not including) this cursor position. If after is specified, before
264 must not be specified.
265  
266 =item before
267  
268 Type: integer | Required: optional
269 A Unix timestamp in milliseconds. Returns all items
270 before (but not including) this cursor position. If before is specified,
271 after must not be specified.
272  
273 =item limit
274  
275 Type: integer | Required: optional
276 The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
277  
278 =back
279  
280 and Response Objects being:
281  
282 - history object
283  
284  
285 On success, the HTTP status code in the response header is 200 OK and the response body contains an array of play history objects (wrapped in a cursor-based paging object) in JSON format. The play history items each contain the context the track was played from (e.g. playlist, album), the date and time the track was played, and a track object (simplified). On error, the header status code is an error code and the response body contains an error object.If private session is enabled the response will be a 204 NO CONTENT with an empty payload.Try in our Web Console
286  
287 =cut
288  
289 0 ▶async sub get_recently_played {
Subroutine get_recently_played: not called CC=1 SCAR=6.9
Pod documented
290 0 my ($self, %args) = @_;
291  
292 0 my $request->{method} = 'GET';
293 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/recently-played';
294 $request->{param} = {
295 0 header => {
296 'Authorization' => {
297 type => 'string',
298 required => 'required',
299 },
300 },
301 query_parameter => {
302 'after' => {
303 type => 'integer',
304 required => 'optional',
305 },
306 'before' => {
307 type => 'integer',
308 required => 'optional',
309 },
310 'limit' => {
311 type => 'integer',
312 required => 'optional',
313 },
314 },
315 };
316 0 my $response_objs = [
317 'history object',
318  
319 ];
320  
321 0 await $self->call_api($request, $response_objs, %args);
322 2 }
323  
324 =head2 get_the_users_currently_playing_track
325  
326 get_the_users_currently_playing_track - Get the User's Currently Playing Track
327  
328 Get the object currently being played on the user’s Spotify account.
329  
330 with Request details being:
331  
332 =head3 header
333  
334 =over 4
335  
336 =item Authorization
337  
338 Type: string | Required: required
339 A valid access token from the Spotify Accounts service:
340 see the Web API Authorization Guide
341 for details. The access token must have been issued on behalf of a user. The
342 access token must have the user-read-currently-playing and/or user-read-playback-state
343 scope authorized in order to read information.
344  
345 =back
346  
347 =head3 query_parameter
348  
349 =over 4
350  
351 =item additional_types
352  
353 Type: string | Required: optional
354 A comma-separated list of item types that your client supports besides the default track type. Valid types are: track and episode. An unsupported type in the response is expected to be represented as null value in the item field.
355 Note: This parameter was introduced to allow existing clients to maintain their current behaviour and might be deprecated in the future. In addition to providing this parameter, make sure that your client properly handles cases of new types in the future by checking against the currently_playing_type field.
356  
357 =item market
358  
359 Type: string | Required: required
360 An ISO 3166-1 alpha-2 country code
361 or the string from_token. Provide this parameter if you want to apply Track
362 Relinking.
363  
364 =back
365  
366 and Response Objects being:
367  
368  
369  
370 A successful request will return a 200 OK response code with a json payload that contains information about the currently playing track or episode and its context (see below). The information returned is for the last known state, which means an inactive device could be returned if it was the last one to execute playback.When no available devices are found, the request will return a 200 OK response but with no data populated.When no track is currently playing, the request will return a 204 NO CONTENT response with no payload.If private session is enabled the response will be a 204 NO CONTENT with an empty payload.Try in our Web Console
371  
372 =cut
373  
374 0 ▶async sub get_the_users_currently_playing_track {
Subroutine get_the_users_currently_playing_track: not called CC=1 SCAR=6.9
Pod documented
375 0 my ($self, %args) = @_;
376  
377 0 my $request->{method} = 'GET';
378 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/currently-playing';
379 $request->{param} = {
380 0 header => {
381 'Authorization' => {
382 type => 'string',
383 required => 'required',
384 },
385 },
386 query_parameter => {
387 'additional_types' => {
388 type => 'string',
389 required => 'optional',
390 },
391 'market' => {
392 type => 'string',
393 required => 'required',
394 },
395 },
396 };
397 0 my $response_objs = [
398  
399 ];
400  
401 0 await $self->call_api($request, $response_objs, %args);
402 2 }
403  
404 =head2 pause_a_users_playback
405  
406 pause_a_users_playback - Pause a User's Playback
407  
408 Pause playback on the user’s account.
409  
410 with Request details being:
411  
412 =head3 header
413  
414 =over 4
415  
416 =item Authorization
417  
418 Type: string | Required: required
419 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.
420  
421 =back
422  
423 =head3 query_parameter
424  
425 =over 4
426  
427 =item device_id
428  
429 Type: string | Required: optional
430 The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
431  
432 =back
433  
434 and Response Objects being:
435  
436  
437  
438 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
439  
440 =cut
441  
442 0 ▶async sub pause_a_users_playback {
Subroutine pause_a_users_playback: not called CC=1 SCAR=6.9
Pod documented
443 0 my ($self, %args) = @_;
444  
445 0 my $request->{method} = 'PUT';
446 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/pause';
447 $request->{param} = {
448 0 header => {
449 'Authorization' => {
450 type => 'string',
451 required => 'required',
452 },
453 },
454 query_parameter => {
455 'device_id' => {
456 type => 'string',
457 required => 'optional',
458 },
459 },
460 };
461 0 my $response_objs = [
462  
463 ];
464  
465 0 await $self->call_api($request, $response_objs, %args);
466 2 }
467  
468 =head2 seek_to_position_in_currently_playing_track
469  
470 seek_to_position_in_currently_playing_track - Seek To Position In Currently Playing Track
471  
472 Seeks to the given position in the user’s currently playing track.
473  
474 with Request details being:
475  
476 =head3 header
477  
478 =over 4
479  
480 =item Authorization
481  
482 Type: string | Required: required
483 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback
484  
485 =back
486  
487 =head3 query_parameter
488  
489 =over 4
490  
491 =item device_id
492  
493 Type: string | Required: optional
494 The id of the device this command is targeting. If
495 not supplied, the user’s currently active device is the target.
496  
497 =item position_ms
498  
499 Type: integer | Required: required
500 The position in milliseconds to seek to. Must be a
501 positive number. Passing in a position that is greater than the length of
502 the track will cause the player to start playing the next song.
503  
504 =back
505  
506 and Response Objects being:
507  
508  
509  
510 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
511  
512 =cut
513  
514 0 ▶async sub seek_to_position_in_currently_playing_track {
Subroutine seek_to_position_in_currently_playing_track: not called CC=1 SCAR=6.9
Pod documented
515 0 my ($self, %args) = @_;
516  
517 0 my $request->{method} = 'PUT';
518 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/seek';
519 $request->{param} = {
520 0 header => {
521 'Authorization' => {
522 type => 'string',
523 required => 'required',
524 },
525 },
526 query_parameter => {
527 'device_id' => {
528 type => 'string',
529 required => 'optional',
530 },
531 'position_ms' => {
532 type => 'integer',
533 required => 'required',
534 },
535 },
536 };
537 0 my $response_objs = [
538  
539 ];
540  
541 0 await $self->call_api($request, $response_objs, %args);
542 2 }
543  
544 =head2 set_repeat_mode_on_users_playback
545  
546 set_repeat_mode_on_users_playback - Set Repeat Mode On User’s Playback
547  
548 Set the repeat mode for the user’s playback. Options are repeat-track,
549 repeat-context, and off.
550  
551 with Request details being:
552  
553 =head3 header
554  
555 =over 4
556  
557 =item Authorization
558  
559 Type: string | Required: required
560 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
561  
562 =back
563  
564 =head3 query_parameter
565  
566 =over 4
567  
568 =item device_id
569  
570 Type: string | Required: optional
571 The id of the device this command is targeting. If
572 not supplied, the user’s currently active device is the target.
573  
574 =item state
575  
576 Type: string | Required: required
577 track, context or off.
578 track will repeat the current track.
579 context will repeat the current context.
580 off will turn repeat off.
581  
582 =back
583  
584 and Response Objects being:
585  
586  
587  
588 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
589  
590 =cut
591  
592 0 ▶async sub set_repeat_mode_on_users_playback {
Subroutine set_repeat_mode_on_users_playback: not called CC=1 SCAR=6.9
Pod documented
593 0 my ($self, %args) = @_;
594  
595 0 my $request->{method} = 'PUT';
596 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/repeat';
597 $request->{param} = {
598 0 header => {
599 'Authorization' => {
600 type => 'string',
601 required => 'required',
602 },
603 },
604 query_parameter => {
605 'device_id' => {
606 type => 'string',
607 required => 'optional',
608 },
609 'state' => {
610 type => 'string',
611 required => 'required',
612 },
613 },
614 };
615 0 my $response_objs = [
616  
617 ];
618  
619 0 await $self->call_api($request, $response_objs, %args);
620 2 }
621  
622 =head2 set_volume_for_users_playback
623  
624 set_volume_for_users_playback - Set Volume For User's Playback
625  
626 Set the volume for the user’s current playback device.
627  
628 with Request details being:
629  
630 =head3 header
631  
632 =over 4
633  
634 =item Authorization
635  
636 Type: string | Required: required
637 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
638  
639 =back
640  
641 =head3 query_parameter
642  
643 =over 4
644  
645 =item device_id
646  
647 Type: string | Required: optional
648 The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
649  
650 =item volume_percent
651  
652 Type: integer | Required: required
653 The volume to set. Must be a value from 0 to 100 inclusive.
654  
655 =back
656  
657 and Response Objects being:
658  
659  
660  
661 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
662  
663 =cut
664  
665 0 ▶async sub set_volume_for_users_playback {
Subroutine set_volume_for_users_playback: not called CC=1 SCAR=6.9
Pod documented
666 0 my ($self, %args) = @_;
667  
668 0 my $request->{method} = 'PUT';
669 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/volume';
670 $request->{param} = {
671 0 header => {
672 'Authorization' => {
673 type => 'string',
674 required => 'required',
675 },
676 },
677 query_parameter => {
678 'device_id' => {
679 type => 'string',
680 required => 'optional',
681 },
682 'volume_percent' => {
683 type => 'integer',
684 required => 'required',
685 },
686 },
687 };
688 0 my $response_objs = [
689  
690 ];
691  
692 0 await $self->call_api($request, $response_objs, %args);
693 2 }
694  
695 =head2 skip_users_playback_to_next_track
696  
697 skip_users_playback_to_next_track - Skip User’s Playback To Next Track
698  
699 Skips to next track in the user’s queue.
700  
701 with Request details being:
702  
703 =head3 header
704  
705 =over 4
706  
707 =item Authorization
708  
709 Type: string | Required: required
710 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
711  
712 =back
713  
714 =head3 query_parameter
715  
716 =over 4
717  
718 =item device_id
719  
720 Type: string | Required: optional
721 The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
722  
723 =back
724  
725 and Response Objects being:
726  
727  
728  
729 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
730  
731 =cut
732  
733 0 ▶async sub skip_users_playback_to_next_track {
Subroutine skip_users_playback_to_next_track: not called CC=1 SCAR=6.9
Pod documented
734 0 my ($self, %args) = @_;
735  
736 0 my $request->{method} = 'POST';
737 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/next';
738 $request->{param} = {
739 0 header => {
740 'Authorization' => {
741 type => 'string',
742 required => 'required',
743 },
744 },
745 query_parameter => {
746 'device_id' => {
747 type => 'string',
748 required => 'optional',
749 },
750 },
751 };
752 0 my $response_objs = [
753  
754 ];
755  
756 0 await $self->call_api($request, $response_objs, %args);
757 2 }
758  
759 =head2 skip_users_playback_to_previous_track
760  
761 skip_users_playback_to_previous_track - Skip User’s Playback To Previous Track
762  
763 Skips to previous track in the user’s queue.
764  
765 with Request details being:
766  
767 =head3 header
768  
769 =over 4
770  
771 =item Authorization
772  
773 Type: string | Required: required
774 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
775  
776 =back
777  
778 =head3 query_parameter
779  
780 =over 4
781  
782 =item device_id
783  
784 Type: string | Required: optional
785 The id of the device this command is targeting. If
786 not supplied, the user’s currently active device is the target.
787  
788 =back
789  
790 and Response Objects being:
791  
792  
793  
794 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
795  
796 =cut
797  
798 0 ▶async sub skip_users_playback_to_previous_track {
Subroutine skip_users_playback_to_previous_track: not called CC=1 SCAR=6.9
Pod documented
799 0 my ($self, %args) = @_;
800  
801 0 my $request->{method} = 'POST';
802 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/previous';
803 $request->{param} = {
804 0 header => {
805 'Authorization' => {
806 type => 'string',
807 required => 'required',
808 },
809 },
810 query_parameter => {
811 'device_id' => {
812 type => 'string',
813 required => 'optional',
814 },
815 },
816 };
817 0 my $response_objs = [
818  
819 ];
820  
821 0 await $self->call_api($request, $response_objs, %args);
822 2 }
823  
824 =head2 start_a_users_playback
825  
826 start_a_users_playback - Start/Resume a User's Playback
827  
828 Start a new context or resume current playback on the user’s active device.
829  
830 with Request details being:
831  
832 =head3 header
833  
834 =over 4
835  
836 =item Authorization
837  
838 Type: string | Required: required
839 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
840  
841 =back
842  
843 =head3 json_body_parameter
844  
845 =over 4
846  
847 =item context_uri
848  
849 Type: string | Required: optional
850 string
851  
852 =item offset
853  
854 Type: object | Required: optional
855 object
856  
857 =item position_ms
858  
859 Type: integer | Required: optional
860 integer
861  
862 =item uris
863  
864 Type: array[string] | Required: optional
865 Array of URIs
866  
867 =back
868  
869 =head3 query_parameter
870  
871 =over 4
872  
873 =item device_id
874  
875 Type: string | Required: optional
876 The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.
877  
878 =back
879  
880 and Response Objects being:
881  
882  
883  
884 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
885  
886 =cut
887  
888 0 ▶async sub start_a_users_playback {
Subroutine start_a_users_playback: not called CC=1 SCAR=6.9
Pod documented
889 0 my ($self, %args) = @_;
890  
891 0 my $request->{method} = 'PUT';
892 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/play';
893 $request->{param} = {
894 0 header => {
895 'Authorization' => {
896 type => 'string',
897 required => 'required',
898 },
899 },
900 json_body_parameter => {
901 'context_uri' => {
902 type => 'string',
903 required => 'optional',
904 },
905 'offset' => {
906 type => 'object',
907 required => 'optional',
908 },
909 'position_ms' => {
910 type => 'integer',
911 required => 'optional',
912 },
913 'uris' => {
914 type => 'array[string]',
915 required => 'optional',
916 },
917 },
918 query_parameter => {
919 'device_id' => {
920 type => 'string',
921 required => 'optional',
922 },
923 },
924 };
925 0 my $response_objs = [
926  
927 ];
928  
929 0 await $self->call_api($request, $response_objs, %args);
930 2 }
931  
932 =head2 toggle_shuffle_for_users_playback
933  
934 toggle_shuffle_for_users_playback - Toggle Shuffle For User’s Playback
935  
936 Toggle shuffle on or off for user’s playback.
937  
938 with Request details being:
939  
940 =head3 header
941  
942 =over 4
943  
944 =item Authorization
945  
946 Type: string | Required: required
947 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
948  
949 =back
950  
951 =head3 query_parameter
952  
953 =over 4
954  
955 =item device_id
956  
957 Type: string | Required: optional
958 The id of the device this command is targeting. If
959 not supplied, the user’s currently active device is the target.
960  
961 =item state
962  
963 Type: boolean | Required: required
964 true : Shuffle user’s playback.
965 false : Do not shuffle user’s playback.
966  
967 =back
968  
969 and Response Objects being:
970  
971  
972  
973 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
974  
975 =cut
976  
977 0 ▶async sub toggle_shuffle_for_users_playback {
Subroutine toggle_shuffle_for_users_playback: not called CC=1 SCAR=6.9
Pod documented
978 0 my ($self, %args) = @_;
979  
980 0 my $request->{method} = 'PUT';
981 0 $request->{uri} = 'https://api.spotify.com/v1/me/player/shuffle';
982 $request->{param} = {
983 0 header => {
984 'Authorization' => {
985 type => 'string',
986 required => 'required',
987 },
988 },
989 query_parameter => {
990 'device_id' => {
991 type => 'string',
992 required => 'optional',
993 },
994 'state' => {
995 type => 'boolean',
996 required => 'required',
997 },
998 },
999 };
1000 0 my $response_objs = [
1001  
1002 ];
1003  
1004 0 await $self->call_api($request, $response_objs, %args);
1005 2 }
1006  
1007 =head2 transfer_a_users_playback
1008  
1009 transfer_a_users_playback - Transfer a User's Playback
1010  
1011 Transfer playback to a new device and determine if it should start playing.
1012  
1013 with Request details being:
1014  
1015 =head3 header
1016  
1017 =over 4
1018  
1019 =item Authorization
1020  
1021 Type: string | Required: required
1022 A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.The access token must have been issued on behalf of a user.The access token must have the user-modify-playback-state scope authorized in order to control playback.
1023  
1024 =back
1025  
1026 =head3 json_body_parameter
1027  
1028 =over 4
1029  
1030 =item device_ids
1031  
1032 Type: array[string] | Required: required
1033 A JSON array containing the ID of the device on which playback should be started/transferred.For example:{device_ids:["74ASZWbe4lXaubB36ztrGX"]}Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return 400 Bad Request
1034  
1035 =item play
1036  
1037 Type: boolean | Required: optional
1038 true: ensure playback happens on new device.false or not provided: keep the current playback state.
1039  
1040 =back
1041  
1042 and Response Objects being:
1043  
1044  
1045  
1046 A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player.If the device is not found, the request will return 404 NOT FOUND response code.If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.Try in our Web Console
1047  
1048 =cut
1049  
1050 0 ▶async sub transfer_a_users_playback {
Subroutine transfer_a_users_playback: not called CC=1 SCAR=6.9
Pod documented
1051 0 my ($self, %args) = @_;
1052  
1053 0 my $request->{method} = 'PUT';
1054 0 $request->{uri} = 'https://api.spotify.com/v1/me/player';
1055 $request->{param} = {
1056 0 header => {
1057 'Authorization' => {
1058 type => 'string',
1059 required => 'required',
1060 },
1061 },
1062 json_body_parameter => {
1063 'device_ids' => {
1064 type => 'array[string]',
1065 required => 'required',
1066 },
1067 'play' => {
1068 type => 'boolean',
1069 required => 'optional',
1070 },
1071 },
1072 };
1073 0 my $response_objs = [
1074  
1075 ];
1076  
1077 0 await $self->call_api($request, $response_objs, %args);
1078 2 }
1079  
1080 2 1;
« lib/Net/Async/Spotify/API/Generated/Library.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Playlists.pm »