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

filter: Statementstmt 58.8% 20 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 62.7% 27 / 43 SCAR 0.7
CC
1
Cov
59%
get_current_users_profile
2.0
get_users_profile
2.0
BEGIN
1.0
CRAP 1.1
« lib/Net/Async/Spotify/API/Generated/Episodes.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Markets.pm »
1 package Net::Async::Spotify::API::Generated::Users;
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::Users - Package representing Spotify Users 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_current_users_profile
31  
32 get_current_users_profile - Get Current User's Profile
33  
34 Get detailed profile information about the current user (including the
35 current user’s username).
36  
37 with Request details being:
38  
39 =head3 header
40  
41 =over 4
42  
43 =item Authorization
44  
45 Type: string | Required: required
46 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.Reading the user’s email address requires the user-read-email scope; reading country, product subscription level and explicit content settings requires the user-read-private scope. See Using Scopes.
47  
48 =back
49  
50 and Response Objects being:
51  
52 - user object
53  
54  
55 On success, the HTTP status code in the response header is 200 OK and the response body contains a user object in JSON format. On error, the header status code is an error code and the response body contains an error object. When requesting fields that you don’t have the user’s authorization to access, it will return error 403 Forbidden.Important! If the user-read-email scope is authorized, the returned JSON will include the email address that was entered when the user created their Spotify account. This email address is unverified; do not assume that the email address belongs to the user.Try in our Web Console
56  
57 =cut
58  
59 0 ▶async sub get_current_users_profile {
Subroutine get_current_users_profile: not called CC=1 SCAR=6.9
Pod documented
60 0 my ($self, %args) = @_;
61  
62 0 my $request->{method} = 'GET';
63 0 $request->{uri} = 'https://api.spotify.com/v1/me';
64 $request->{param} = {
65 0 header => {
66 'Authorization' => {
67 type => 'string',
68 required => 'required',
69 },
70 },
71 };
72 0 my $response_objs = [
73 'user object',
74  
75 ];
76  
77 0 await $self->call_api($request, $response_objs, %args);
78 2 }
79  
80 =head2 get_users_profile
81  
82 get_users_profile - Get a User's Profile
83  
84 Get public profile information about a Spotify user.
85  
86 with Request details being:
87  
88 =head3 header
89  
90 =over 4
91  
92 =item Authorization
93  
94 Type: string | Required: required
95 A valid access token from the Spotify Accounts service:
96 see the Web API Authorization Guide
97 for details.
98  
99 =back
100  
101 =head3 path_parameter
102  
103 =over 4
104  
105 =item user_id
106  
107 Type: string | Required: required
108 The user’s Spotify user ID.
109  
110 =back
111  
112 and Response Objects being:
113  
114 - user object
115  
116  
117 On success, the HTTP status code in the response header is 200 OK and the response body contains a user object in JSON format. On error, the header status code is an error code and the response body contains an error object. If a user with that user_id doesn’t exist, the status code is 404 NOT FOUND.Try in our Web Console
118  
119 =cut
120  
121 0 ▶async sub get_users_profile {
Subroutine get_users_profile: not called CC=1 SCAR=6.9
Pod documented
122 0 my ($self, %args) = @_;
123  
124 0 my $request->{method} = 'GET';
125 0 $request->{uri} = 'https://api.spotify.com/v1/users/{user_id}';
126 $request->{param} = {
127 0 header => {
128 'Authorization' => {
129 type => 'string',
130 required => 'required',
131 },
132 },
133 path_parameter => {
134 'user_id' => {
135 type => 'string',
136 required => 'required',
137 },
138 },
139 };
140 0 my $response_objs = [
141 'user object',
142  
143 ];
144  
145 0 await $self->call_api($request, $response_objs, %args);
146 2 }
147  
148 2 1;
« lib/Net/Async/Spotify/API/Generated/Episodes.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Markets.pm »