« 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.002'; # 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 | 0 | ▶ | sub mapping { shift->{mapping} } | ||||||||||
|
Subroutine
mapping: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 31 | |||||||||||||
| 32 | =head2 get_users_top_artists_and_tracks | ||||||||||||
| 33 | |||||||||||||
| 34 | get_users_top_artists_and_tracks - Get a User's Top Artists and Tracks | ||||||||||||
| 35 | |||||||||||||
| 36 | Get the current user’s top artists or tracks based on calculated affinity. | ||||||||||||
| 37 | |||||||||||||
| 38 | with Request details being: | ||||||||||||
| 39 | |||||||||||||
| 40 | =head3 header | ||||||||||||
| 41 | |||||||||||||
| 42 | =over 4 | ||||||||||||
| 43 | |||||||||||||
| 44 | =item Authorization | ||||||||||||
| 45 | |||||||||||||
| 46 | Type: string | Required: required | ||||||||||||
| 47 | 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. | ||||||||||||
| 48 | |||||||||||||
| 49 | =back | ||||||||||||
| 50 | |||||||||||||
| 51 | =head3 path_parameter | ||||||||||||
| 52 | |||||||||||||
| 53 | =over 4 | ||||||||||||
| 54 | |||||||||||||
| 55 | =item type | ||||||||||||
| 56 | |||||||||||||
| 57 | Type: string | Required: required | ||||||||||||
| 58 | The type of entity to return. Valid values: artists or tracks | ||||||||||||
| 59 | |||||||||||||
| 60 | =back | ||||||||||||
| 61 | |||||||||||||
| 62 | =head3 query_parameter | ||||||||||||
| 63 | |||||||||||||
| 64 | =over 4 | ||||||||||||
| 65 | |||||||||||||
| 66 | =item limit | ||||||||||||
| 67 | |||||||||||||
| 68 | Type: integer | Required: optional | ||||||||||||
| 69 | The number of entities to return. Default: 20. Minimum: 1. Maximum: 50. For example: limit=2 | ||||||||||||
| 70 | |||||||||||||
| 71 | =item offset | ||||||||||||
| 72 | |||||||||||||
| 73 | Type: integer | Required: optional | ||||||||||||
| 74 | 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. | ||||||||||||
| 75 | |||||||||||||
| 76 | =item time_range | ||||||||||||
| 77 | |||||||||||||
| 78 | Type: string | Required: optional | ||||||||||||
| 79 | 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 | ||||||||||||
| 80 | |||||||||||||
| 81 | =back | ||||||||||||
| 82 | |||||||||||||
| 83 | and Response Objects being: | ||||||||||||
| 84 | |||||||||||||
| 85 | - paging object | ||||||||||||
| 86 | |||||||||||||
| 87 | |||||||||||||
| 88 | 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 | ||||||||||||
| 89 | |||||||||||||
| 90 | =cut | ||||||||||||
| 91 | |||||||||||||
| 92 | 0 | ▶ | async sub get_users_top_artists_and_tracks { | ||||||||||
|
Subroutine
get_users_top_artists_and_tracks: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||
| 93 | 0 | my ($self, %args) = @_; | |||||||||||
| 94 | |||||||||||||
| 95 | 0 | my $mapping = $self->mapping; | |||||||||||
| 96 | 0 | ▶ | my $request->{method} = $mapping->{get_users_top_artists_and_tracks}{method} // 'GET'; | ||||||||||
|
Condition0%0/2
$mapping->{"get_users_top_artists_and_tracks"}{"method"} // "GET"
MC/DC0%0/1
$mapping->{"get_users_top_artists_and_tracks"}{"method"} // "GET"
$mapping->{"get_users_top_artists_and_tracks"}{"method"}
Truth table0%0/2
A
A= $mapping->{"get_users_top_artists_and_tracks"}{"method"}
| |||||||||||||
| 97 | 0 | ▶ | $request->{uri} = $mapping->{get_users_top_artists_and_tracks}{uri} // 'https://api.spotify.com/v1/me/top/{type}'; | ||||||||||
|
Condition0%0/2
$mapping->{"get_users_top_artists_and_tracks"}{"uri"} // "https://api.spotify.com/v1/me/top/{type}"
MC/DC0%0/1
$mapping->{"get_users_top_artists_and_tracks"}{"uri"} // "https://api.spotify.com/v1/me/top/{type}"
$mapping->{"get_users_top_artists_and_tracks"}{"uri"}
Truth table0%0/2
A
A= $mapping->{"get_users_top_artists_and_tracks"}{"uri"}
| |||||||||||||
| 98 | $request->{param} = $mapping->{get_users_top_artists_and_tracks}{param} // { | ||||||||||||
| 99 | 0 | ▶ | header => { | ||||||||||
|
Condition0%0/2
$mapping->{"get_users_top_artists_and_tracks"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"type", {"type", "string", "required", "required"}}, "query_parameter", {"limit", {"type", "integer", "required", "optional"}, "offset", {"type", "integer", "required", "optional"}, "time_range", {"type", "string", "required", "optional"}}}
MC/DC0%0/1
$mapping->{"get_users_top_artists_and_tracks"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"type", {"type", "string", "required", "required"}}, "query_parameter", {"limit", {"type", "integer", "required", "optional"}, "offset", {"type", "integer", "required", "optional"}, "time_range", {"type", "string", "required", "optional"}}}
$mapping->{"get_users_top_artists_and_tracks"}{"param"}
Truth table0%0/2
A
A= $mapping->{"get_users_top_artists_and_tracks"}{"param"}
| |||||||||||||
| 100 | 'Authorization' => { | ||||||||||||
| 101 | type => 'string', | ||||||||||||
| 102 | required => 'required', | ||||||||||||
| 103 | }, | ||||||||||||
| 104 | }, | ||||||||||||
| 105 | path_parameter => { | ||||||||||||
| 106 | 'type' => { | ||||||||||||
| 107 | type => 'string', | ||||||||||||
| 108 | required => 'required', | ||||||||||||
| 109 | }, | ||||||||||||
| 110 | }, | ||||||||||||
| 111 | query_parameter => { | ||||||||||||
| 112 | 'limit' => { | ||||||||||||
| 113 | type => 'integer', | ||||||||||||
| 114 | required => 'optional', | ||||||||||||
| 115 | }, | ||||||||||||
| 116 | 'offset' => { | ||||||||||||
| 117 | type => 'integer', | ||||||||||||
| 118 | required => 'optional', | ||||||||||||
| 119 | }, | ||||||||||||
| 120 | 'time_range' => { | ||||||||||||
| 121 | type => 'string', | ||||||||||||
| 122 | required => 'optional', | ||||||||||||
| 123 | }, | ||||||||||||
| 124 | }, | ||||||||||||
| 125 | }; | ||||||||||||
| 126 | my $response_objs = $mapping->{get_users_top_artists_and_tracks}{response} // [ | ||||||||||||
| 127 | 0 | ▶ | 'paging object', | ||||||||||
|
Condition0%0/2
$mapping->{"get_users_top_artists_and_tracks"}{"response"} // ["paging object"]
MC/DC0%0/1
$mapping->{"get_users_top_artists_and_tracks"}{"response"} // ["paging object"]
$mapping->{"get_users_top_artists_and_tracks"}{"response"}
Truth table0%0/2
A
A= $mapping->{"get_users_top_artists_and_tracks"}{"response"}
| |||||||||||||
| 128 | |||||||||||||
| 129 | ]; | ||||||||||||
| 130 | |||||||||||||
| 131 | 0 | await $self->call_api($request, $response_objs, %args); | |||||||||||
| 132 | 2 | } | |||||||||||
| 133 | |||||||||||||
| 134 | 2 | 1; | |||||||||||