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

filter: Statementstmt 54.0% 20 / 37 Branchbran n/a Conditioncond 0.0% 0 / 16 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 62.5% 5 / 8 Podpod 66.6% 2 / 3 totaltotal 37.5% 27 / 72 CC 9 SCAR 29.5
CC
9
Cov
38%
get_current_users_profile
30.0
get_users_profile
30.0
mapping
2.0
CRAP 19.2
« lib/Net/Async/Spotify/API/Generated/Episodes.pm ↑ Summary lib/Net/Async/Spotify.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.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::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 0 ▶sub mapping { shift->{mapping} }
Subroutine mapping: not called CC=1 SCAR=6.9
Pod undocumented
31  
32 =head2 get_current_users_profile
33  
34 get_current_users_profile - Get Current User's Profile
35  
36 Get detailed profile information about the current user (including the
37 current user’s username).
38  
39 with Request details being:
40  
41 =head3 header
42  
43 =over 4
44  
45 =item Authorization
46  
47 Type: string | Required: required
48 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.
49  
50 =back
51  
52 and Response Objects being:
53  
54 - user object
55  
56  
57 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
58  
59 =cut
60  
61 0 ▶async sub get_current_users_profile {
Subroutine get_current_users_profile: not called CC=5 SCAR=34.0
Pod documented
62 0 my ($self, %args) = @_;
63  
64 0 my $mapping = $self->mapping;
65 0 ▶ my $request->{method} = $mapping->{get_current_users_profile}{method} // 'GET';
Condition0%0/2
$mapping->{"get_current_users_profile"}{"method"} // "GET"
l!l
00
MC/DC0%0/1
$mapping->{"get_current_users_profile"}{"method"} // "GET"
$mapping->{"get_current_users_profile"}{"method"}
Truth table0%0/2
A
A= $mapping->{"get_current_users_profile"}{"method"}
Aresult
11
00
66 0 ▶ $request->{uri} = $mapping->{get_current_users_profile}{uri} // 'https://api.spotify.com/v1/me';
Condition0%0/2
$mapping->{"get_current_users_profile"}{"uri"} // "https://api.spotify.com/v1/me"
l!l
00
MC/DC0%0/1
$mapping->{"get_current_users_profile"}{"uri"} // "https://api.spotify.com/v1/me"
$mapping->{"get_current_users_profile"}{"uri"}
Truth table0%0/2
A
A= $mapping->{"get_current_users_profile"}{"uri"}
Aresult
11
00
67 $request->{param} = $mapping->{get_current_users_profile}{param} // {
68 0 ▶ header => {
Condition0%0/2
$mapping->{"get_current_users_profile"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}}
l!l
00
MC/DC0%0/1
$mapping->{"get_current_users_profile"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}}
$mapping->{"get_current_users_profile"}{"param"}
Truth table0%0/2
A
A= $mapping->{"get_current_users_profile"}{"param"}
Aresult
11
00
69 'Authorization' => {
70 type => 'string',
71 required => 'required',
72 },
73 },
74 };
75 my $response_objs = $mapping->{get_current_users_profile}{response} // [
76 0 ▶ 'user object',
Condition0%0/2
$mapping->{"get_current_users_profile"}{"response"} // ["user object"]
l!l
00
MC/DC0%0/1
$mapping->{"get_current_users_profile"}{"response"} // ["user object"]
$mapping->{"get_current_users_profile"}{"response"}
Truth table0%0/2
A
A= $mapping->{"get_current_users_profile"}{"response"}
Aresult
11
00
77  
78 ];
79  
80 0 await $self->call_api($request, $response_objs, %args);
81 2 }
82  
83 =head2 get_users_profile
84  
85 get_users_profile - Get a User's Profile
86  
87 Get public profile information about a Spotify user.
88  
89 with Request details being:
90  
91 =head3 header
92  
93 =over 4
94  
95 =item Authorization
96  
97 Type: string | Required: required
98 A valid access token from the Spotify Accounts service:
99 see the Web API Authorization Guide
100 for details.
101  
102 =back
103  
104 =head3 path_parameter
105  
106 =over 4
107  
108 =item user_id
109  
110 Type: string | Required: required
111 The user’s Spotify user ID.
112  
113 =back
114  
115 and Response Objects being:
116  
117 - user object
118  
119  
120 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
121  
122 =cut
123  
124 0 ▶async sub get_users_profile {
Subroutine get_users_profile: not called CC=5 SCAR=34.0
Pod documented
125 0 my ($self, %args) = @_;
126  
127 0 my $mapping = $self->mapping;
128 0 ▶ my $request->{method} = $mapping->{get_users_profile}{method} // 'GET';
Condition0%0/2
$mapping->{"get_users_profile"}{"method"} // "GET"
l!l
00
MC/DC0%0/1
$mapping->{"get_users_profile"}{"method"} // "GET"
$mapping->{"get_users_profile"}{"method"}
Truth table0%0/2
A
A= $mapping->{"get_users_profile"}{"method"}
Aresult
11
00
129 0 ▶ $request->{uri} = $mapping->{get_users_profile}{uri} // 'https://api.spotify.com/v1/users/{user_id}';
Condition0%0/2
$mapping->{"get_users_profile"}{"uri"} // "https://api.spotify.com/v1/users/{user_id}"
l!l
00
MC/DC0%0/1
$mapping->{"get_users_profile"}{"uri"} // "https://api.spotify.com/v1/users/{user_id}"
$mapping->{"get_users_profile"}{"uri"}
Truth table0%0/2
A
A= $mapping->{"get_users_profile"}{"uri"}
Aresult
11
00
130 $request->{param} = $mapping->{get_users_profile}{param} // {
131 0 ▶ header => {
Condition0%0/2
$mapping->{"get_users_profile"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"user_id", {"type", "string", "required", "required"}}}
l!l
00
MC/DC0%0/1
$mapping->{"get_users_profile"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"user_id", {"type", "string", "required", "required"}}}
$mapping->{"get_users_profile"}{"param"}
Truth table0%0/2
A
A= $mapping->{"get_users_profile"}{"param"}
Aresult
11
00
132 'Authorization' => {
133 type => 'string',
134 required => 'required',
135 },
136 },
137 path_parameter => {
138 'user_id' => {
139 type => 'string',
140 required => 'required',
141 },
142 },
143 };
144 my $response_objs = $mapping->{get_users_profile}{response} // [
145 0 ▶ 'user object',
Condition0%0/2
$mapping->{"get_users_profile"}{"response"} // ["user object"]
l!l
00
MC/DC0%0/1
$mapping->{"get_users_profile"}{"response"} // ["user object"]
$mapping->{"get_users_profile"}{"response"}
Truth table0%0/2
A
A= $mapping->{"get_users_profile"}{"response"}
Aresult
11
00
146  
147 ];
148  
149 0 await $self->call_api($request, $response_objs, %args);
150 2 }
151  
152 2 1;
« lib/Net/Async/Spotify/API/Generated/Episodes.pm ↑ Summary lib/Net/Async/Spotify.pm »