lib/Net/Async/Spotify/API/Generated/Episodes.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_an_episode
30.0
get_multiple_episodes
30.0
mapping
2.0
CRAP 19.2
« lib/Net/Async/Spotify/API/Generated/Shows.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Users.pm »
1 package Net::Async::Spotify::API::Generated::Episodes;
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::Episodes - Package representing Spotify Episodes 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_an_episode
33  
34 get_an_episode - Get an Episode
35  
36 Get Spotify catalog information for a single episode identified by its
37 unique Spotify ID.
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:
49 see the Web API Authorization Guide
50 for details.
51  
52 =back
53  
54 =head3 path_parameter
55  
56 =over 4
57  
58 =item id
59  
60 Type: string | Required: required
61 The Spotify ID for the episode.
62  
63 =back
64  
65 =head3 query_parameter
66  
67 =over 4
68  
69 =item market
70  
71 Type: string | Required: optional
72 An ISO 3166-1 alpha-2 country code.
73 If a country code is specified, only shows and episodes that are available in that market will be returned.
74 If a valid user access token is specified in the request header, the country associated with
75 the user account will take priority over this parameter.
76 Note: If neither market or user country are provided, the content is considered unavailable for the client.
77 Users can view the country that is associated with their account in the account settings.
78  
79 =back
80  
81 and Response Objects being:
82  
83 - episode object
84  
85  
86 On success, the HTTP status code in the response header is 200
87 OK and the response body contains an episode object
88 in JSON format.
89 On error, the header status code is an error code
90 and the response body contains an error object.
91 If an episode is unavailable in the given market the HTTP status code in the response header is 404 NOT FOUND.Try in our Web Console
92  
93 =cut
94  
95 0 ▶async sub get_an_episode {
Subroutine get_an_episode: not called CC=5 SCAR=34.0
Pod documented
96 0 my ($self, %args) = @_;
97  
98 0 my $mapping = $self->mapping;
99 0 ▶ my $request->{method} = $mapping->{get_an_episode}{method} // 'GET';
Condition0%0/2
$mapping->{"get_an_episode"}{"method"} // "GET"
l!l
00
MC/DC0%0/1
$mapping->{"get_an_episode"}{"method"} // "GET"
$mapping->{"get_an_episode"}{"method"}
Truth table0%0/2
A
A= $mapping->{"get_an_episode"}{"method"}
Aresult
11
00
100 0 ▶ $request->{uri} = $mapping->{get_an_episode}{uri} // 'https://api.spotify.com/v1/episodes/{id}';
Condition0%0/2
$mapping->{"get_an_episode"}{"uri"} // "https://api.spotify.com/v1/episodes/{id}"
l!l
00
MC/DC0%0/1
$mapping->{"get_an_episode"}{"uri"} // "https://api.spotify.com/v1/episodes/{id}"
$mapping->{"get_an_episode"}{"uri"}
Truth table0%0/2
A
A= $mapping->{"get_an_episode"}{"uri"}
Aresult
11
00
101 $request->{param} = $mapping->{get_an_episode}{param} // {
102 0 ▶ header => {
Condition0%0/2
$mapping->{"get_an_episode"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"id", {"type", "string", "required", "required"}}, "query_parameter", {"market", {"type", "string", "required", "optional"}}}
l!l
00
MC/DC0%0/1
$mapping->{"get_an_episode"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "path_parameter", {"id", {"type", "string", "required", "required"}}, "query_parameter", {"market", {"type", "string", "required", "optional"}}}
$mapping->{"get_an_episode"}{"param"}
Truth table0%0/2
A
A= $mapping->{"get_an_episode"}{"param"}
Aresult
11
00
103 'Authorization' => {
104 type => 'string',
105 required => 'required',
106 },
107 },
108 path_parameter => {
109 'id' => {
110 type => 'string',
111 required => 'required',
112 },
113 },
114 query_parameter => {
115 'market' => {
116 type => 'string',
117 required => 'optional',
118 },
119 },
120 };
121 my $response_objs = $mapping->{get_an_episode}{response} // [
122 0 ▶ 'episode object',
Condition0%0/2
$mapping->{"get_an_episode"}{"response"} // ["episode object"]
l!l
00
MC/DC0%0/1
$mapping->{"get_an_episode"}{"response"} // ["episode object"]
$mapping->{"get_an_episode"}{"response"}
Truth table0%0/2
A
A= $mapping->{"get_an_episode"}{"response"}
Aresult
11
00
123  
124 ];
125  
126 0 await $self->call_api($request, $response_objs, %args);
127 2 }
128  
129 =head2 get_multiple_episodes
130  
131 get_multiple_episodes - Get Multiple Episodes
132  
133 Get Spotify catalog information for several episodes based on their Spotify IDs.
134  
135 with Request details being:
136  
137 =head3 header
138  
139 =over 4
140  
141 =item Authorization
142  
143 Type: string | Required: required
144 A valid access token from the Spotify Accounts service:
145 see the Web API Authorization Guide
146 for details.
147  
148 =back
149  
150 =head3 query_parameter
151  
152 =over 4
153  
154 =item ids
155  
156 Type: string | Required: required
157 A comma-separated list of the Spotify IDs for the episodes. Maximum: 50 IDs.
158  
159 =item market
160  
161 Type: string | Required: optional
162 An ISO 3166-1 alpha-2 country code.
163 If a country code is specified, only shows and episodes that are available in that market will be returned.
164 If a valid user access token is specified in the request header, the country associated with
165 the user account will take priority over this parameter.
166 Note: If neither market or user country are provided, the content is considered unavailable for the client.
167 Users can view the country that is associated with their account in the account settings.
168  
169 =back
170  
171 and Response Objects being:
172  
173 - an object
174 - an object
175  
176  
177 On success, the HTTP status code in the response header is 200
178 OK and the response body contains an object whose key is episodes and whose
179 value is an array of episode objects
180 in JSON format.Objects are returned in the order requested. If an object is not found, a null value is returned in the appropriate position.
181 Duplicate ids in the query will result in duplicate objects in the response. If an episode is unavailable in the given market, a null value is returned.
182 On error, the header status code is an error code and the response body contains an error object.Try in our Web Console
183  
184 =cut
185  
186 0 ▶async sub get_multiple_episodes {
Subroutine get_multiple_episodes: not called CC=5 SCAR=34.0
Pod documented
187 0 my ($self, %args) = @_;
188  
189 0 my $mapping = $self->mapping;
190 0 ▶ my $request->{method} = $mapping->{get_multiple_episodes}{method} // 'GET';
Condition0%0/2
$mapping->{"get_multiple_episodes"}{"method"} // "GET"
l!l
00
MC/DC0%0/1
$mapping->{"get_multiple_episodes"}{"method"} // "GET"
$mapping->{"get_multiple_episodes"}{"method"}
Truth table0%0/2
A
A= $mapping->{"get_multiple_episodes"}{"method"}
Aresult
11
00
191 0 ▶ $request->{uri} = $mapping->{get_multiple_episodes}{uri} // 'https://api.spotify.com/v1/episodes';
Condition0%0/2
$mapping->{"get_multiple_episodes"}{"uri"} // "https://api.spotify.com/v1/episodes"
l!l
00
MC/DC0%0/1
$mapping->{"get_multiple_episodes"}{"uri"} // "https://api.spotify.com/v1/episodes"
$mapping->{"get_multiple_episodes"}{"uri"}
Truth table0%0/2
A
A= $mapping->{"get_multiple_episodes"}{"uri"}
Aresult
11
00
192 $request->{param} = $mapping->{get_multiple_episodes}{param} // {
193 0 ▶ header => {
Condition0%0/2
$mapping->{"get_multiple_episodes"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "query_parameter", {"ids", {"type", "string", "required", "required"}, "market", {"type", "string", "required", "optional"}}}
l!l
00
MC/DC0%0/1
$mapping->{"get_multiple_episodes"}{"param"} // {"header", {"Authorization", {"type", "string", "required", "required"}}, "query_parameter", {"ids", {"type", "string", "required", "required"}, "market", {"type", "string", "required", "optional"}}}
$mapping->{"get_multiple_episodes"}{"param"}
Truth table0%0/2
A
A= $mapping->{"get_multiple_episodes"}{"param"}
Aresult
11
00
194 'Authorization' => {
195 type => 'string',
196 required => 'required',
197 },
198 },
199 query_parameter => {
200 'ids' => {
201 type => 'string',
202 required => 'required',
203 },
204 'market' => {
205 type => 'string',
206 required => 'optional',
207 },
208 },
209 };
210 my $response_objs = $mapping->{get_multiple_episodes}{response} // [
211 0 ▶ 'an object',
Condition0%0/2
$mapping->{"get_multiple_episodes"}{"response"} // ["an object", "an object"]
l!l
00
MC/DC0%0/1
$mapping->{"get_multiple_episodes"}{"response"} // ["an object", "an object"]
$mapping->{"get_multiple_episodes"}{"response"}
Truth table0%0/2
A
A= $mapping->{"get_multiple_episodes"}{"response"}
Aresult
11
00
212 'an object',
213  
214 ];
215  
216 0 await $self->call_api($request, $response_objs, %args);
217 2 }
218  
219 2 1;
« lib/Net/Async/Spotify/API/Generated/Shows.pm ↑ Summary lib/Net/Async/Spotify/API/Generated/Users.pm »