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

filter: Statementstmt 33.7% 25 / 74 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 41.6% 5 / 12 Podpod 100% 7 / 7 totaltotal 39.7% 37 / 93 SCAR 2.5
CC
1
Cov
34%
check_current_user_follows
2.0
check_if_user_follows_playlist
2.0
follow_artists_users
2.0
CRAP 1.3
« lib/Net/Async/Spotify/API/Generated/Browse.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Artists.pm »
1 package Net::Async::Spotify::API::Generated::Follow;
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::Follow - Package representing Spotify Follow 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 check_current_user_follows
31  
32 check_current_user_follows - Get Following State for Artists/Users
33  
34 Check to see if the current user is following one or more artists or other Spotify users.
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 user access token or your client credentials. Requires the user-follow-read scope.
46  
47 =back
48  
49 =head3 query_parameter
50  
51 =over 4
52  
53 =item ids
54  
55 Type: string | Required: required
56 A comma-separated list of the artist or the user Spotify IDs to check. For example: ids=74ASZWbe4lXaubB36ztrGX,08td7MxkoHQkXnWAYD8d6Q. A maximum of 50 IDs can be sent in one request.
57  
58 =item type
59  
60 Type: string | Required: required
61 The ID type: either artist or user.
62  
63 =back
64  
65 and Response Objects being:
66  
67 - error object
68  
69  
70 On success, the HTTP status code in the response header is 200 OK and the response body contains a JSON array of true or false values, in the same order in which the ids were specified.
71 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
72  
73 =cut
74  
75 0 ▶async sub check_current_user_follows {
Subroutine check_current_user_follows: not called CC=1 SCAR=6.9
Pod documented
76 0 my ($self, %args) = @_;
77  
78 0 my $request->{method} = 'GET';
79 0 $request->{uri} = 'https://api.spotify.com/v1/me/following/contains';
80 $request->{param} = {
81 0 header => {
82 'Authorization' => {
83 type => 'string',
84 required => 'required',
85 },
86 },
87 query_parameter => {
88 'ids' => {
89 type => 'string',
90 required => 'required',
91 },
92 'type' => {
93 type => 'string',
94 required => 'required',
95 },
96 },
97 };
98 0 my $response_objs = [
99 'error object',
100  
101 ];
102  
103 0 await $self->call_api($request, $response_objs, %args);
104 2 }
105  
106 =head2 check_if_user_follows_playlist
107  
108 check_if_user_follows_playlist - Check if Users Follow a Playlist
109  
110 Check to see if one or more Spotify users are following a specified playlist.
111  
112 with Request details being:
113  
114 =head3 header
115  
116 =over 4
117  
118 =item Authorization
119  
120 Type: string | Required: required
121 A valid user access token or your client credentials. Requires the playlist-read-private scope if a private playlist is requested.
122  
123 =back
124  
125 =head3 path_parameter
126  
127 =over 4
128  
129 =item playlist_id
130  
131 Type: string | Required: required
132 The Spotify ID of the playlist.
133  
134 =back
135  
136 =head3 query_parameter
137  
138 =over 4
139  
140 =item ids
141  
142 Type: string | Required: required
143 A comma-separated list of Spotify User IDs ; the ids of the users that you want to check to see if they follow the playlist. Maximum: 5 ids.
144  
145 =back
146  
147 and Response Objects being:
148  
149 - error object
150  
151  
152 On success, the HTTP status code in the response header is 200 OK and the response body contains a JSON array of true or false values, in the same order in which the ids were specified.
153 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
154  
155 =cut
156  
157 0 ▶async sub check_if_user_follows_playlist {
Subroutine check_if_user_follows_playlist: not called CC=1 SCAR=6.9
Pod documented
158 0 my ($self, %args) = @_;
159  
160 0 my $request->{method} = 'GET';
161 0 $request->{uri} = 'https://api.spotify.com/v1/playlists/{playlist_id}/followers/contains';
162 $request->{param} = {
163 0 header => {
164 'Authorization' => {
165 type => 'string',
166 required => 'required',
167 },
168 },
169 path_parameter => {
170 'playlist_id' => {
171 type => 'string',
172 required => 'required',
173 },
174 },
175 query_parameter => {
176 'ids' => {
177 type => 'string',
178 required => 'required',
179 },
180 },
181 };
182 0 my $response_objs = [
183 'error object',
184  
185 ];
186  
187 0 await $self->call_api($request, $response_objs, %args);
188 2 }
189  
190 =head2 follow_artists_users
191  
192 follow_artists_users - Follow Artists or Users
193  
194 Add the current user as a follower of one or more artists or other Spotify users.
195  
196 with Request details being:
197  
198 =head3 header
199  
200 =over 4
201  
202 =item Authorization
203  
204 Type: string | Required: required
205 A valid user access token or your client credentials. Requires the user-follow-modify scope.
206  
207 =item Content-Type
208  
209 Type: string | Required: optional
210 Required if IDs are passed in the request body, otherwise ignored. The content type of the request body: application/json
211  
212 =back
213  
214 =head3 json_body_parameter
215  
216 =over 4
217  
218 =item ids
219  
220 Type: array[string] | Required: required
221 A JSON array of the artist or user Spotify IDs.
222 For example: {ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}. A maximum of 50 IDs can be sent in one request. Note: if the ids parameter is present in the query string, any IDs listed here in the body will be ignored.
223  
224 =back
225  
226 =head3 query_parameter
227  
228 =over 4
229  
230 =item ids
231  
232 Type: string | Required: required
233 A comma-separated list of the artist or the user Spotify IDs.
234 For example: ids=74ASZWbe4lXaubB36ztrGX,08td7MxkoHQkXnWAYD8d6Q. A maximum of 50 IDs can be sent in one request.
235  
236 =item type
237  
238 Type: string | Required: required
239 The ID type: either artist or user.
240  
241 =back
242  
243 and Response Objects being:
244  
245 - error object
246  
247  
248 On success, the HTTP status code in the response header is 204 No Content and the response body is empty.
249 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
250  
251 =cut
252  
253 0 ▶async sub follow_artists_users {
Subroutine follow_artists_users: not called CC=1 SCAR=6.9
Pod documented
254 0 my ($self, %args) = @_;
255  
256 0 my $request->{method} = 'PUT';
257 0 $request->{uri} = 'https://api.spotify.com/v1/me/following';
258 $request->{param} = {
259 0 header => {
260 'Authorization' => {
261 type => 'string',
262 required => 'required',
263 },
264 'Content-Type' => {
265 type => 'string',
266 required => 'optional',
267 },
268 },
269 json_body_parameter => {
270 'ids' => {
271 type => 'array[string]',
272 required => 'required',
273 },
274 },
275 query_parameter => {
276 'ids' => {
277 type => 'string',
278 required => 'required',
279 },
280 'type' => {
281 type => 'string',
282 required => 'required',
283 },
284 },
285 };
286 0 my $response_objs = [
287 'error object',
288  
289 ];
290  
291 0 await $self->call_api($request, $response_objs, %args);
292 2 }
293  
294 =head2 follow_playlist
295  
296 follow_playlist - Follow a Playlist
297  
298 Add the current user as a follower of a playlist.
299  
300 with Request details being:
301  
302 =head3 header
303  
304 =over 4
305  
306 =item Authorization
307  
308 Type: string | Required: required
309 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 the user.Following a playlist publicly requires authorization of the playlist-modify-public scope; following a playlist privately requires the playlist-modify-private scope. See Using Scopes.Note that the scopes you provide relate only to whether the current user is following the playlist publicly or privately (i.e. showing others what they are following), not whether the playlist itself is public or private.
310  
311 =item Content-Type
312  
313 Type: string | Required: required
314 The content type of the request body: application/json
315  
316 =back
317  
318 =head3 json_body_parameter
319  
320 =over 4
321  
322 =item public
323  
324 Type: boolean | Required: optional
325 Defaults to true. If true the playlist will be included in user’s public playlists, if false it will remain private.
326  
327 =back
328  
329 =head3 path_parameter
330  
331 =over 4
332  
333 =item playlist_id
334  
335 Type: string | Required: required
336 The Spotify ID of the playlist. Any playlist can be followed, regardless of its public/private status, as long as you know its playlist ID.
337  
338 =back
339  
340 and Response Objects being:
341  
342 - error object
343  
344  
345 On success, the HTTP status code in the response header is 200 OK and the response body is empty.
346 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
347  
348 =cut
349  
350 0 ▶async sub follow_playlist {
Subroutine follow_playlist: not called CC=1 SCAR=6.9
Pod documented
351 0 my ($self, %args) = @_;
352  
353 0 my $request->{method} = 'PUT';
354 0 $request->{uri} = 'https://api.spotify.com/v1/playlists/{playlist_id}/followers';
355 $request->{param} = {
356 0 header => {
357 'Authorization' => {
358 type => 'string',
359 required => 'required',
360 },
361 'Content-Type' => {
362 type => 'string',
363 required => 'required',
364 },
365 },
366 json_body_parameter => {
367 'public' => {
368 type => 'boolean',
369 required => 'optional',
370 },
371 },
372 path_parameter => {
373 'playlist_id' => {
374 type => 'string',
375 required => 'required',
376 },
377 },
378 };
379 0 my $response_objs = [
380 'error object',
381  
382 ];
383  
384 0 await $self->call_api($request, $response_objs, %args);
385 2 }
386  
387 =head2 get_followed
388  
389 get_followed - Get User's Followed Artists
390  
391 Get the current user’s followed artists.
392  
393 with Request details being:
394  
395 =head3 header
396  
397 =over 4
398  
399 =item Authorization
400  
401 Type: string | Required: required
402 A valid user access token or your client credentials. Requires the user-follow-modify scope.
403  
404 =back
405  
406 =head3 query_parameter
407  
408 =over 4
409  
410 =item after
411  
412 Type: string | Required: optional
413 The last artist ID retrieved from the previous request.
414  
415 =item limit
416  
417 Type: integer | Required: optional
418 The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
419  
420 =item type
421  
422 Type: string | Required: required
423 The ID type: currently only artist is supported.
424  
425 =back
426  
427 and Response Objects being:
428  
429 - paging object
430  
431  
432 On success, the HTTP status code in the response header is 200 OK and the response body contains an artists object.
433 The artists object in turn contains a cursor-based paging object of Artists.
434 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
435  
436 =cut
437  
438 0 ▶async sub get_followed {
Subroutine get_followed: not called CC=1 SCAR=6.9
Pod documented
439 0 my ($self, %args) = @_;
440  
441 0 my $request->{method} = 'GET';
442 0 $request->{uri} = 'https://api.spotify.com/v1/me/following';
443 $request->{param} = {
444 0 header => {
445 'Authorization' => {
446 type => 'string',
447 required => 'required',
448 },
449 },
450 query_parameter => {
451 'after' => {
452 type => 'string',
453 required => 'optional',
454 },
455 'limit' => {
456 type => 'integer',
457 required => 'optional',
458 },
459 'type' => {
460 type => 'string',
461 required => 'required',
462 },
463 },
464 };
465 0 my $response_objs = [
466 'paging object',
467  
468 ];
469  
470 0 await $self->call_api($request, $response_objs, %args);
471 2 }
472  
473 =head2 unfollow_artists_users
474  
475 unfollow_artists_users - Unfollow Artists or Users
476  
477 Remove the current user as a follower of one or more artists or other Spotify users.
478  
479 with Request details being:
480  
481 =head3 header
482  
483 =over 4
484  
485 =item Authorization
486  
487 Type: string | Required: required
488 A valid user access token or your client credentials. Requires the user-follow-modify scope.
489  
490 =item Content-Type
491  
492 Type: string | Required: optional
493 Required if IDs are passed in the request body, otherwise ignored. The content type of the request body: application/json.
494  
495 =back
496  
497 =head3 json_body_parameter
498  
499 =over 4
500  
501 =item ids
502  
503 Type: array[string] | Required: optional
504 A JSON array of the artist or user Spotify IDs. For example: {ids:["74ASZWbe4lXaubB36ztrGX", "08td7MxkoHQkXnWAYD8d6Q"]}. A maximum of 50 IDs can be sent in one request. Note: if the ids parameter is present in the query string, any IDs listed here in the body will be ignored.
505  
506 =back
507  
508 =head3 query_parameter
509  
510 =over 4
511  
512 =item ids
513  
514 Type: string | Required: required
515 A comma-separated list of the artist or the user Spotify IDs. For example: ids=74ASZWbe4lXaubB36ztrGX,08td7MxkoHQkXnWAYD8d6Q. A maximum of 50 IDs can be sent in one request.
516  
517 =item type
518  
519 Type: string | Required: required
520 The ID type: either artist or user.
521  
522 =back
523  
524 and Response Objects being:
525  
526 - error object
527  
528  
529 On success, the HTTP status code in the response header is 204 No Content and the response body is empty.
530 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
531  
532 =cut
533  
534 0 ▶async sub unfollow_artists_users {
Subroutine unfollow_artists_users: not called CC=1 SCAR=6.9
Pod documented
535 0 my ($self, %args) = @_;
536  
537 0 my $request->{method} = 'DELETE';
538 0 $request->{uri} = 'https://api.spotify.com/v1/me/following';
539 $request->{param} = {
540 0 header => {
541 'Authorization' => {
542 type => 'string',
543 required => 'required',
544 },
545 'Content-Type' => {
546 type => 'string',
547 required => 'optional',
548 },
549 },
550 json_body_parameter => {
551 'ids' => {
552 type => 'array[string]',
553 required => 'optional',
554 },
555 },
556 query_parameter => {
557 'ids' => {
558 type => 'string',
559 required => 'required',
560 },
561 'type' => {
562 type => 'string',
563 required => 'required',
564 },
565 },
566 };
567 0 my $response_objs = [
568 'error object',
569  
570 ];
571  
572 0 await $self->call_api($request, $response_objs, %args);
573 2 }
574  
575 =head2 unfollow_playlist
576  
577 unfollow_playlist - Unfollow Playlist
578  
579 Remove the current user as a follower of a playlist.
580  
581 with Request details being:
582  
583 =head3 header
584  
585 =over 4
586  
587 =item Authorization
588  
589 Type: string | Required: required
590 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 the user.Unfollowing a publicly followed playlist for a user requires authorization of the playlist-modify-public scope; unfollowing a privately followed playlist requires the playlist-modify-private scope. See Using Scopes.Note that the scopes you provide relate only to whether the current user is following the playlist publicly or privately (i.e. showing others what they are following), not whether the playlist itself is public or private.
591  
592 =back
593  
594 =head3 path_parameter
595  
596 =over 4
597  
598 =item playlist_id
599  
600 Type: string | Required: required
601 The Spotify ID of the playlist that is to be no longer followed.
602  
603 =back
604  
605 and Response Objects being:
606  
607 - error object
608  
609  
610 On success, the HTTP status code in the response header is 200 OK and the response body is empty.
611 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
612  
613 =cut
614  
615 0 ▶async sub unfollow_playlist {
Subroutine unfollow_playlist: not called CC=1 SCAR=6.9
Pod documented
616 0 my ($self, %args) = @_;
617  
618 0 my $request->{method} = 'DELETE';
619 0 $request->{uri} = 'https://api.spotify.com/v1/playlists/{playlist_id}/followers';
620 $request->{param} = {
621 0 header => {
622 'Authorization' => {
623 type => 'string',
624 required => 'required',
625 },
626 },
627 path_parameter => {
628 'playlist_id' => {
629 type => 'string',
630 required => 'required',
631 },
632 },
633 };
634 0 my $response_objs = [
635 'error object',
636  
637 ];
638  
639 0 await $self->call_api($request, $response_objs, %args);
640 2 }
641  
642 2 1;
« lib/Net/Async/Spotify/API/Generated/Browse.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Artists.pm »