« lib/Net/Async/Spotify/API/Generated/Markets.pm
↑ Summary
lib/Net/Async/Spotify/API/Generated/Search.pm »
| 1 | package Net::Async::Spotify::API::Generated::Personalization; | ||
| 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::Personalization - Package representing Spotify Personalization 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 get_users_top_artists_and_tracks | ||
| 31 | |||
| 32 | get_users_top_artists_and_tracks - Get a User's Top Artists and Tracks | ||
| 33 | |||
| 34 | Get the current user’s top artists or tracks based on calculated affinity. | ||
| 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 the current user.Getting details of a user’s top artists and tracks requires authorization of the user-top-read scope. See Using Scopes. | ||
| 46 | |||
| 47 | =back | ||
| 48 | |||
| 49 | =head3 path_parameter | ||
| 50 | |||
| 51 | =over 4 | ||
| 52 | |||
| 53 | =item type | ||
| 54 | |||
| 55 | Type: string | Required: required | ||
| 56 | The type of entity to return. Valid values: artists or tracks | ||
| 57 | |||
| 58 | =back | ||
| 59 | |||
| 60 | =head3 query_parameter | ||
| 61 | |||
| 62 | =over 4 | ||
| 63 | |||
| 64 | =item limit | ||
| 65 | |||
| 66 | Type: integer | Required: optional | ||
| 67 | The number of entities to return. Default: 20. Minimum: 1. Maximum: 50. For example: limit=2 | ||
| 68 | |||
| 69 | =item offset | ||
| 70 | |||
| 71 | Type: integer | Required: optional | ||
| 72 | The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities. | ||
| 73 | |||
| 74 | =item time_range | ||
| 75 | |||
| 76 | Type: string | Required: optional | ||
| 77 | Over what time frame the affinities are computed. Valid values: long_term (calculated from several years of data and including all new data as it becomes available), medium_term (approximately last 6 months), short_term (approximately last 4 weeks). Default: medium_term | ||
| 78 | |||
| 79 | =back | ||
| 80 | |||
| 81 | and Response Objects being: | ||
| 82 | |||
| 83 | - paging object | ||
| 84 | |||
| 85 | |||
| 86 | On success, the HTTP status code in the response header is 200 OK and the response body contains a paging object of Artists or Tracks. On error, the header status code is an error code and the response body contains an error object.Try in our Web Console | ||
| 87 | |||
| 88 | =cut | ||
| 89 | |||
| 90 | 0 | ▶ | async sub get_users_top_artists_and_tracks { |
|
Subroutine
get_users_top_artists_and_tracks: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 91 | 0 | my ($self, %args) = @_; | |
| 92 | |||
| 93 | 0 | my $request->{method} = 'GET'; | |
| 94 | 0 | $request->{uri} = 'https://api.spotify.com/v1/me/top/{type}'; | |
| 95 | $request->{param} = { | ||
| 96 | 0 | header => { | |
| 97 | 'Authorization' => { | ||
| 98 | type => 'string', | ||
| 99 | required => 'required', | ||
| 100 | }, | ||
| 101 | }, | ||
| 102 | path_parameter => { | ||
| 103 | 'type' => { | ||
| 104 | type => 'string', | ||
| 105 | required => 'required', | ||
| 106 | }, | ||
| 107 | }, | ||
| 108 | query_parameter => { | ||
| 109 | 'limit' => { | ||
| 110 | type => 'integer', | ||
| 111 | required => 'optional', | ||
| 112 | }, | ||
| 113 | 'offset' => { | ||
| 114 | type => 'integer', | ||
| 115 | required => 'optional', | ||
| 116 | }, | ||
| 117 | 'time_range' => { | ||
| 118 | type => 'string', | ||
| 119 | required => 'optional', | ||
| 120 | }, | ||
| 121 | }, | ||
| 122 | }; | ||
| 123 | 0 | my $response_objs = [ | |
| 124 | 'paging object', | ||
| 125 | |||
| 126 | ]; | ||
| 127 | |||
| 128 | 0 | await $self->call_api($request, $response_objs, %args); | |
| 129 | 2 | } | |
| 130 | |||
| 131 | 2 | 1; | |