blib/lib/Paws/Polly.pm

filter: Statementstmt 25.0% 24 / 96 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.0% 9 / 20 Podpod 70.5% 12 / 17 totaltotal 28.6% 45 / 157 CC 19 SCAR 34.5
CC
19
Cov
20%
DescribeAllVoices
56.0
ListAllLexicons
56.0
ListAllSpeechSynthesisTasks
56.0
CRAP 31.6
« lib/Paws/EMR.pm ↑ Summary blib/lib/Paws/SNS.pm »
1 package Paws::Polly;
2 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶ sub service { 'polly' }
Subroutine service: called CC=1 SCAR=0.0
Pod undocumented
4 5 ▶ sub signing_name { 'polly' }
Subroutine signing_name: called CC=1 SCAR=0.0
Pod undocumented
5 0 ▶ sub version { '2016-06-10' }
Subroutine version: not called CC=1 SCAR=6.9
Pod undocumented
6 0 ▶ sub flattened_arrays { 0 }
Subroutine flattened_arrays: not called CC=1 SCAR=6.9
Pod undocumented
7 1 has max_attempts => (is => 'ro', isa => 'Int', default => 5);
8 5 ▶ has retry => (is => 'ro', isa => 'HashRef', default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
9 5 { base => 'rand', type => 'exponential', growth_factor => 2 }
10 1 });
11 5 ▶ has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
Subroutine __ANON__: called CC=1 SCAR=0.0
12 5 ] });
13  
14 1 with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::RestJsonCaller';
15  
16
17 0 ▶ sub DeleteLexicon {
Subroutine DeleteLexicon: not called CC=1 SCAR=6.9
Pod documented
18 0 my $self = shift;
19 0 my $call_object = $self->new_with_coercions('Paws::Polly::DeleteLexicon', @_);
20 0 return $self->caller->do_call($self, $call_object);
21 }
22 1 ▶ sub DescribeVoices {
Subroutine DescribeVoices: called CC=1 SCAR=0.0
Pod documented
23 1 my $self = shift;
24 1 my $call_object = $self->new_with_coercions('Paws::Polly::DescribeVoices', @_);
25 1 return $self->caller->do_call($self, $call_object);
26 }
27 0 ▶ sub GetLexicon {
Subroutine GetLexicon: not called CC=1 SCAR=6.9
Pod documented
28 0 my $self = shift;
29 0 my $call_object = $self->new_with_coercions('Paws::Polly::GetLexicon', @_);
30 0 return $self->caller->do_call($self, $call_object);
31 }
32 0 ▶ sub GetSpeechSynthesisTask {
Subroutine GetSpeechSynthesisTask: not called CC=1 SCAR=6.9
Pod documented
33 0 my $self = shift;
34 0 my $call_object = $self->new_with_coercions('Paws::Polly::GetSpeechSynthesisTask', @_);
35 0 return $self->caller->do_call($self, $call_object);
36 }
37 2 ▶ sub ListLexicons {
Subroutine ListLexicons: called CC=1 SCAR=0.0
Pod documented
38 2 my $self = shift;
39 2 my $call_object = $self->new_with_coercions('Paws::Polly::ListLexicons', @_);
40 2 return $self->caller->do_call($self, $call_object);
41 }
42 0 ▶ sub ListSpeechSynthesisTasks {
Subroutine ListSpeechSynthesisTasks: not called CC=1 SCAR=6.9
Pod documented
43 0 my $self = shift;
44 0 my $call_object = $self->new_with_coercions('Paws::Polly::ListSpeechSynthesisTasks', @_);
45 0 return $self->caller->do_call($self, $call_object);
46 }
47 1 ▶ sub PutLexicon {
Subroutine PutLexicon: called CC=1 SCAR=0.0
Pod documented
48 1 my $self = shift;
49 1 my $call_object = $self->new_with_coercions('Paws::Polly::PutLexicon', @_);
50 1 return $self->caller->do_call($self, $call_object);
51 }
52 0 ▶ sub StartSpeechSynthesisTask {
Subroutine StartSpeechSynthesisTask: not called CC=1 SCAR=6.9
Pod documented
53 0 my $self = shift;
54 0 my $call_object = $self->new_with_coercions('Paws::Polly::StartSpeechSynthesisTask', @_);
55 0 return $self->caller->do_call($self, $call_object);
56 }
57 1 ▶ sub SynthesizeSpeech {
Subroutine SynthesizeSpeech: called CC=1 SCAR=0.0
Pod documented
58 1 my $self = shift;
59 1 my $call_object = $self->new_with_coercions('Paws::Polly::SynthesizeSpeech', @_);
60 1 return $self->caller->do_call($self, $call_object);
61 }
62
63 0 ▶ sub DescribeAllVoices {
Subroutine DescribeAllVoices: not called CC=7 SCAR=40.3
Pod documented
64 0 my $self = shift;
65  
66 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
67 0 my $result = $self->DescribeVoices(@_);
68 0 my $next_result = $result;
69  
70 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
71 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
72 0 $next_result = $self->DescribeVoices(@_, NextToken => $next_result->NextToken);
73 0 push @{ $result->Voices }, @{ $next_result->Voices };
74 }
75 0 return $result;
76 } else {
77 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
78 0 $callback->($_ => 'Voices') foreach (@{ $result->Voices });
79 0 $result = $self->DescribeVoices(@_, NextToken => $result->NextToken);
80 }
81 0 $callback->($_ => 'Voices') foreach (@{ $result->Voices });
82 }
83  
84 return undef
85 0 }
86 0 ▶ sub ListAllLexicons {
Subroutine ListAllLexicons: not called CC=7 SCAR=40.3
Pod documented
87 0 my $self = shift;
88  
89 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
90 0 my $result = $self->ListLexicons(@_);
91 0 my $next_result = $result;
92  
93 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
94 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
95 0 $next_result = $self->ListLexicons(@_, NextToken => $next_result->NextToken);
96 0 push @{ $result->Lexicons }, @{ $next_result->Lexicons };
97 }
98 0 return $result;
99 } else {
100 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
101 0 $callback->($_ => 'Lexicons') foreach (@{ $result->Lexicons });
102 0 $result = $self->ListLexicons(@_, NextToken => $result->NextToken);
103 }
104 0 $callback->($_ => 'Lexicons') foreach (@{ $result->Lexicons });
105 }
106  
107 return undef
108 0 }
109 0 ▶ sub ListAllSpeechSynthesisTasks {
Subroutine ListAllSpeechSynthesisTasks: not called CC=7 SCAR=40.3
Pod documented
110 0 my $self = shift;
111  
112 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
113 0 my $result = $self->ListSpeechSynthesisTasks(@_);
114 0 my $next_result = $result;
115  
116 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
117 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
118 0 $next_result = $self->ListSpeechSynthesisTasks(@_, NextToken => $next_result->NextToken);
119 0 push @{ $result->SynthesisTasks }, @{ $next_result->SynthesisTasks };
120 }
121 0 return $result;
122 } else {
123 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
124 0 $callback->($_ => 'SynthesisTasks') foreach (@{ $result->SynthesisTasks });
125 0 $result = $self->ListSpeechSynthesisTasks(@_, NextToken => $result->NextToken);
126 }
127 0 $callback->($_ => 'SynthesisTasks') foreach (@{ $result->SynthesisTasks });
128 }
129  
130 return undef
131 0 }
132  
133  
134 0 ▶ sub operations { qw/DeleteLexicon DescribeVoices GetLexicon GetSpeechSynthesisTask ListLexicons ListSpeechSynthesisTasks PutLexicon StartSpeechSynthesisTask SynthesizeSpeech / }
Subroutine operations: not called CC=1 SCAR=6.9
Pod undocumented
135  
136 1 1;
137  
138 ### main pod documentation begin ###
139  
140 =head1 NAME
141  
142 Paws::Polly - Perl Interface to AWS Amazon Polly
143  
144 =head1 SYNOPSIS
145  
146 use Paws;
147  
148 my $obj = Paws->service('Polly');
149 my $res = $obj->Method(
150 Arg1 => $val1,
151 Arg2 => [ 'V1', 'V2' ],
152 # if Arg3 is an object, the HashRef will be used as arguments to the constructor
153 # of the arguments type
154 Arg3 => { Att1 => 'Val1' },
155 # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
156 # the constructor of the arguments type
157 Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
158 );
159  
160 =head1 DESCRIPTION
161  
162 Amazon Polly is a web service that makes it easy to synthesize speech
163 from text.
164  
165 The Amazon Polly service provides API operations for synthesizing
166 high-quality speech from plain text and Speech Synthesis Markup
167 Language (SSML), along with managing pronunciations lexicons that
168 enable you to get the best results for your application domain.
169  
170 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10>
171  
172  
173 =head1 METHODS
174  
175 =head2 DeleteLexicon
176  
177 =over
178  
179 =item Name => Str
180  
181  
182 =back
183  
184 Each argument is described in detail in: L<Paws::Polly::DeleteLexicon>
185  
186 Returns: a L<Paws::Polly::DeleteLexiconOutput> instance
187  
188 Deletes the specified pronunciation lexicon stored in an AWS Region. A
189 lexicon which has been deleted is not available for speech synthesis,
190 nor is it possible to retrieve it using either the C<GetLexicon> or
191 C<ListLexicon> APIs.
192  
193 For more information, see Managing Lexicons
194 (https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).
195  
196  
197 =head2 DescribeVoices
198  
199 =over
200  
201 =item [Engine => Str]
202  
203 =item [IncludeAdditionalLanguageCodes => Bool]
204  
205 =item [LanguageCode => Str]
206  
207 =item [NextToken => Str]
208  
209  
210 =back
211  
212 Each argument is described in detail in: L<Paws::Polly::DescribeVoices>
213  
214 Returns: a L<Paws::Polly::DescribeVoicesOutput> instance
215  
216 Returns the list of voices that are available for use when requesting
217 speech synthesis. Each voice speaks a specified language, is either
218 male or female, and is identified by an ID, which is the ASCII version
219 of the voice name.
220  
221 When synthesizing speech ( C<SynthesizeSpeech> ), you provide the voice
222 ID for the voice you want from the list of voices returned by
223 C<DescribeVoices>.
224  
225 For example, you want your news reader application to read news in a
226 specific language, but giving a user the option to choose the voice.
227 Using the C<DescribeVoices> operation you can provide the user with a
228 list of available voices to select from.
229  
230 You can optionally specify a language code to filter the available
231 voices. For example, if you specify C<en-US>, the operation returns a
232 list of all available US English voices.
233  
234 This operation requires permissions to perform the
235 C<polly:DescribeVoices> action.
236  
237  
238 =head2 GetLexicon
239  
240 =over
241  
242 =item Name => Str
243  
244  
245 =back
246  
247 Each argument is described in detail in: L<Paws::Polly::GetLexicon>
248  
249 Returns: a L<Paws::Polly::GetLexiconOutput> instance
250  
251 Returns the content of the specified pronunciation lexicon stored in an
252 AWS Region. For more information, see Managing Lexicons
253 (https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).
254  
255  
256 =head2 GetSpeechSynthesisTask
257  
258 =over
259  
260 =item TaskId => Str
261  
262  
263 =back
264  
265 Each argument is described in detail in: L<Paws::Polly::GetSpeechSynthesisTask>
266  
267 Returns: a L<Paws::Polly::GetSpeechSynthesisTaskOutput> instance
268  
269 Retrieves a specific SpeechSynthesisTask object based on its TaskID.
270 This object contains information about the given speech synthesis task,
271 including the status of the task, and a link to the S3 bucket
272 containing the output of the task.
273  
274  
275 =head2 ListLexicons
276  
277 =over
278  
279 =item [NextToken => Str]
280  
281  
282 =back
283  
284 Each argument is described in detail in: L<Paws::Polly::ListLexicons>
285  
286 Returns: a L<Paws::Polly::ListLexiconsOutput> instance
287  
288 Returns a list of pronunciation lexicons stored in an AWS Region. For
289 more information, see Managing Lexicons
290 (https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).
291  
292  
293 =head2 ListSpeechSynthesisTasks
294  
295 =over
296  
297 =item [MaxResults => Int]
298  
299 =item [NextToken => Str]
300  
301 =item [Status => Str]
302  
303  
304 =back
305  
306 Each argument is described in detail in: L<Paws::Polly::ListSpeechSynthesisTasks>
307  
308 Returns: a L<Paws::Polly::ListSpeechSynthesisTasksOutput> instance
309  
310 Returns a list of SpeechSynthesisTask objects ordered by their creation
311 date. This operation can filter the tasks by their status, for example,
312 allowing users to list only tasks that are completed.
313  
314  
315 =head2 PutLexicon
316  
317 =over
318  
319 =item Content => Str
320  
321 =item Name => Str
322  
323  
324 =back
325  
326 Each argument is described in detail in: L<Paws::Polly::PutLexicon>
327  
328 Returns: a L<Paws::Polly::PutLexiconOutput> instance
329  
330 Stores a pronunciation lexicon in an AWS Region. If a lexicon with the
331 same name already exists in the region, it is overwritten by the new
332 lexicon. Lexicon operations have eventual consistency, therefore, it
333 might take some time before the lexicon is available to the
334 SynthesizeSpeech operation.
335  
336 For more information, see Managing Lexicons
337 (https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html).
338  
339  
340 =head2 StartSpeechSynthesisTask
341  
342 =over
343  
344 =item OutputFormat => Str
345  
346 =item OutputS3BucketName => Str
347  
348 =item Text => Str
349  
350 =item VoiceId => Str
351  
352 =item [Engine => Str]
353  
354 =item [LanguageCode => Str]
355  
356 =item [LexiconNames => ArrayRef[Str|Undef]]
357  
358 =item [OutputS3KeyPrefix => Str]
359  
360 =item [SampleRate => Str]
361  
362 =item [SnsTopicArn => Str]
363  
364 =item [SpeechMarkTypes => ArrayRef[Str|Undef]]
365  
366 =item [TextType => Str]
367  
368  
369 =back
370  
371 Each argument is described in detail in: L<Paws::Polly::StartSpeechSynthesisTask>
372  
373 Returns: a L<Paws::Polly::StartSpeechSynthesisTaskOutput> instance
374  
375 Allows the creation of an asynchronous synthesis task, by starting a
376 new C<SpeechSynthesisTask>. This operation requires all the standard
377 information needed for speech synthesis, plus the name of an Amazon S3
378 bucket for the service to store the output of the synthesis task and
379 two optional parameters (OutputS3KeyPrefix and SnsTopicArn). Once the
380 synthesis task is created, this operation will return a
381 SpeechSynthesisTask object, which will include an identifier of this
382 task as well as the current status.
383  
384  
385 =head2 SynthesizeSpeech
386  
387 =over
388  
389 =item OutputFormat => Str
390  
391 =item Text => Str
392  
393 =item VoiceId => Str
394  
395 =item [Engine => Str]
396  
397 =item [LanguageCode => Str]
398  
399 =item [LexiconNames => ArrayRef[Str|Undef]]
400  
401 =item [SampleRate => Str]
402  
403 =item [SpeechMarkTypes => ArrayRef[Str|Undef]]
404  
405 =item [TextType => Str]
406  
407  
408 =back
409  
410 Each argument is described in detail in: L<Paws::Polly::SynthesizeSpeech>
411  
412 Returns: a L<Paws::Polly::SynthesizeSpeechOutput> instance
413  
414 Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML
415 input must be valid, well-formed SSML. Some alphabets might not be
416 available with all the voices (for example, Cyrillic might not be read
417 at all by English voices) unless phoneme mapping is used. For more
418 information, see How it Works
419 (https://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html).
420  
421  
422  
423  
424 =head1 PAGINATORS
425  
426 Paginator methods are helpers that repetively call methods that return partial results
427  
428 =head2 DescribeAllVoices(sub { },[Engine => Str, IncludeAdditionalLanguageCodes => Bool, LanguageCode => Str, NextToken => Str])
429  
430 =head2 DescribeAllVoices([Engine => Str, IncludeAdditionalLanguageCodes => Bool, LanguageCode => Str, NextToken => Str])
431  
432  
433 If passed a sub as first parameter, it will call the sub for each element found in :
434  
435 - Voices, passing the object as the first parameter, and the string 'Voices' as the second parameter
436  
437 If not, it will return a a L<Paws::Polly::DescribeVoicesOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
438  
439  
440 =head2 ListAllLexicons(sub { },[NextToken => Str])
441  
442 =head2 ListAllLexicons([NextToken => Str])
443  
444  
445 If passed a sub as first parameter, it will call the sub for each element found in :
446  
447 - Lexicons, passing the object as the first parameter, and the string 'Lexicons' as the second parameter
448  
449 If not, it will return a a L<Paws::Polly::ListLexiconsOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
450  
451  
452 =head2 ListAllSpeechSynthesisTasks(sub { },[MaxResults => Int, NextToken => Str, Status => Str])
453  
454 =head2 ListAllSpeechSynthesisTasks([MaxResults => Int, NextToken => Str, Status => Str])
455  
456  
457 If passed a sub as first parameter, it will call the sub for each element found in :
458  
459 - SynthesisTasks, passing the object as the first parameter, and the string 'SynthesisTasks' as the second parameter
460  
461 If not, it will return a a L<Paws::Polly::ListSpeechSynthesisTasksOutput> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
462  
463  
464  
465  
466  
467 =head1 SEE ALSO
468  
469 This service class forms part of L<Paws>
470  
471 =head1 BUGS and CONTRIBUTIONS
472  
473 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
474  
475 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
476  
477 =cut
478  
« lib/Paws/EMR.pm ↑ Summary blib/lib/Paws/SNS.pm »