blib/lib/Paws/RedshiftData.pm untested

filter: Statementstmt 0.0% 0 / 162 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 22 Podpod 0.0% 0 / 21 totaltotal 0.0% 0 / 229 CC 13 SCAR 19.9
CC
13
Cov
0%
DescribeAllTable
12.0
GetAllStatementResult
12.0
ListAllDatabases
12.0
CRAP 7.3
1 package Paws::RedshiftData;
2 use Moose;
3 sub service { 'redshift-data' }
4 sub signing_name { 'redshift-data' }
5 sub version { '2019-12-20' }
6 sub target_prefix { 'RedshiftData' }
7 sub json_version { "1.1" }
8 has max_attempts => (is => 'ro', isa => 'Int', default => 5);
9 has retry => (is => 'ro', isa => 'HashRef', default => sub {
10 { base => 'rand', type => 'exponential', growth_factor => 2 }
11 });
12 has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
13 ] });
14  
15 with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller';
16  
17
18 sub CancelStatement {
19 my $self = shift;
20 my $call_object = $self->new_with_coercions('Paws::RedshiftData::CancelStatement', @_);
21 return $self->caller->do_call($self, $call_object);
22 }
23 sub DescribeStatement {
24 my $self = shift;
25 my $call_object = $self->new_with_coercions('Paws::RedshiftData::DescribeStatement', @_);
26 return $self->caller->do_call($self, $call_object);
27 }
28 sub DescribeTable {
29 my $self = shift;
30 my $call_object = $self->new_with_coercions('Paws::RedshiftData::DescribeTable', @_);
31 return $self->caller->do_call($self, $call_object);
32 }
33 sub ExecuteStatement {
34 my $self = shift;
35 my $call_object = $self->new_with_coercions('Paws::RedshiftData::ExecuteStatement', @_);
36 return $self->caller->do_call($self, $call_object);
37 }
38 sub GetStatementResult {
39 my $self = shift;
40 my $call_object = $self->new_with_coercions('Paws::RedshiftData::GetStatementResult', @_);
41 return $self->caller->do_call($self, $call_object);
42 }
43 sub ListDatabases {
44 my $self = shift;
45 my $call_object = $self->new_with_coercions('Paws::RedshiftData::ListDatabases', @_);
46 return $self->caller->do_call($self, $call_object);
47 }
48 sub ListSchemas {
49 my $self = shift;
50 my $call_object = $self->new_with_coercions('Paws::RedshiftData::ListSchemas', @_);
51 return $self->caller->do_call($self, $call_object);
52 }
53 sub ListStatements {
54 my $self = shift;
55 my $call_object = $self->new_with_coercions('Paws::RedshiftData::ListStatements', @_);
56 return $self->caller->do_call($self, $call_object);
57 }
58 sub ListTables {
59 my $self = shift;
60 my $call_object = $self->new_with_coercions('Paws::RedshiftData::ListTables', @_);
61 return $self->caller->do_call($self, $call_object);
62 }
63
64 sub DescribeAllTable {
65 my $self = shift;
66  
67 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
68 my $result = $self->DescribeTable(@_);
69 my $next_result = $result;
70  
71 if (not defined $callback) {
72 while ($next_result->NextToken) {
73 $next_result = $self->DescribeTable(@_, NextToken => $next_result->NextToken);
74 push @{ $result->ColumnList }, @{ $next_result->ColumnList };
75 }
76 return $result;
77 } else {
78 while ($result->NextToken) {
79 $callback->($_ => 'ColumnList') foreach (@{ $result->ColumnList });
80 $result = $self->DescribeTable(@_, NextToken => $result->NextToken);
81 }
82 $callback->($_ => 'ColumnList') foreach (@{ $result->ColumnList });
83 }
84  
85 return undef
86 }
87 sub GetAllStatementResult {
88 my $self = shift;
89  
90 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
91 my $result = $self->GetStatementResult(@_);
92 my $next_result = $result;
93  
94 if (not defined $callback) {
95 while ($next_result->NextToken) {
96 $next_result = $self->GetStatementResult(@_, NextToken => $next_result->NextToken);
97 push @{ $result->Records }, @{ $next_result->Records };
98 }
99 return $result;
100 } else {
101 while ($result->NextToken) {
102 $callback->($_ => 'Records') foreach (@{ $result->Records });
103 $result = $self->GetStatementResult(@_, NextToken => $result->NextToken);
104 }
105 $callback->($_ => 'Records') foreach (@{ $result->Records });
106 }
107  
108 return undef
109 }
110 sub ListAllDatabases {
111 my $self = shift;
112  
113 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
114 my $result = $self->ListDatabases(@_);
115 my $next_result = $result;
116  
117 if (not defined $callback) {
118 while ($next_result->NextToken) {
119 $next_result = $self->ListDatabases(@_, NextToken => $next_result->NextToken);
120 push @{ $result->Databases }, @{ $next_result->Databases };
121 }
122 return $result;
123 } else {
124 while ($result->NextToken) {
125 $callback->($_ => 'Databases') foreach (@{ $result->Databases });
126 $result = $self->ListDatabases(@_, NextToken => $result->NextToken);
127 }
128 $callback->($_ => 'Databases') foreach (@{ $result->Databases });
129 }
130  
131 return undef
132 }
133 sub ListAllSchemas {
134 my $self = shift;
135  
136 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
137 my $result = $self->ListSchemas(@_);
138 my $next_result = $result;
139  
140 if (not defined $callback) {
141 while ($next_result->NextToken) {
142 $next_result = $self->ListSchemas(@_, NextToken => $next_result->NextToken);
143 push @{ $result->Schemas }, @{ $next_result->Schemas };
144 }
145 return $result;
146 } else {
147 while ($result->NextToken) {
148 $callback->($_ => 'Schemas') foreach (@{ $result->Schemas });
149 $result = $self->ListSchemas(@_, NextToken => $result->NextToken);
150 }
151 $callback->($_ => 'Schemas') foreach (@{ $result->Schemas });
152 }
153  
154 return undef
155 }
156 sub ListAllStatements {
157 my $self = shift;
158  
159 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
160 my $result = $self->ListStatements(@_);
161 my $next_result = $result;
162  
163 if (not defined $callback) {
164 while ($next_result->NextToken) {
165 $next_result = $self->ListStatements(@_, NextToken => $next_result->NextToken);
166 push @{ $result->Statements }, @{ $next_result->Statements };
167 }
168 return $result;
169 } else {
170 while ($result->NextToken) {
171 $callback->($_ => 'Statements') foreach (@{ $result->Statements });
172 $result = $self->ListStatements(@_, NextToken => $result->NextToken);
173 }
174 $callback->($_ => 'Statements') foreach (@{ $result->Statements });
175 }
176  
177 return undef
178 }
179 sub ListAllTables {
180 my $self = shift;
181  
182 my $callback = shift @_ if (ref($_[0]) eq 'CODE');
183 my $result = $self->ListTables(@_);
184 my $next_result = $result;
185  
186 if (not defined $callback) {
187 while ($next_result->NextToken) {
188 $next_result = $self->ListTables(@_, NextToken => $next_result->NextToken);
189 push @{ $result->Tables }, @{ $next_result->Tables };
190 }
191 return $result;
192 } else {
193 while ($result->NextToken) {
194 $callback->($_ => 'Tables') foreach (@{ $result->Tables });
195 $result = $self->ListTables(@_, NextToken => $result->NextToken);
196 }
197 $callback->($_ => 'Tables') foreach (@{ $result->Tables });
198 }
199  
200 return undef
201 }
202  
203  
204 sub operations { qw/CancelStatement DescribeStatement DescribeTable ExecuteStatement GetStatementResult ListDatabases ListSchemas ListStatements ListTables / }
205  
206 1;
207  
208 ### main pod documentation begin ###
209  
210 =head1 NAME
211  
212 Paws::RedshiftData - Perl Interface to AWS Redshift Data API Service
213  
214 =head1 SYNOPSIS
215  
216 use Paws;
217  
218 my $obj = Paws->service('RedshiftData');
219 my $res = $obj->Method(
220 Arg1 => $val1,
221 Arg2 => [ 'V1', 'V2' ],
222 # if Arg3 is an object, the HashRef will be used as arguments to the constructor
223 # of the arguments type
224 Arg3 => { Att1 => 'Val1' },
225 # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
226 # the constructor of the arguments type
227 Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
228 );
229  
230 =head1 DESCRIPTION
231  
232 You can use the Amazon Redshift Data API to run queries on Amazon
233 Redshift tables. You can run individual SQL statements, which are
234 committed if the statement succeeds.
235  
236 For more information about the Amazon Redshift Data API, see Using the
237 Amazon Redshift Data API
238 (https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the
239 I<Amazon Redshift Cluster Management Guide>.
240  
241 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/redshift-data-2019-12-20>
242  
243  
244 =head1 METHODS
245  
246 =head2 CancelStatement
247  
248 =over
249  
250 =item Id => Str
251  
252  
253 =back
254  
255 Each argument is described in detail in: L<Paws::RedshiftData::CancelStatement>
256  
257 Returns: a L<Paws::RedshiftData::CancelStatementResponse> instance
258  
259 Cancels a running query. To be canceled, a query must be running.
260  
261  
262 =head2 DescribeStatement
263  
264 =over
265  
266 =item Id => Str
267  
268  
269 =back
270  
271 Each argument is described in detail in: L<Paws::RedshiftData::DescribeStatement>
272  
273 Returns: a L<Paws::RedshiftData::DescribeStatementResponse> instance
274  
275 Describes the details about a specific instance when a query was run by
276 the Amazon Redshift Data API. The information includes when the query
277 started, when it finished, the query status, the number of rows
278 returned, and the SQL statement.
279  
280  
281 =head2 DescribeTable
282  
283 =over
284  
285 =item ClusterIdentifier => Str
286  
287 =item Database => Str
288  
289 =item [ConnectedDatabase => Str]
290  
291 =item [DbUser => Str]
292  
293 =item [MaxResults => Int]
294  
295 =item [NextToken => Str]
296  
297 =item [Schema => Str]
298  
299 =item [SecretArn => Str]
300  
301 =item [Table => Str]
302  
303  
304 =back
305  
306 Each argument is described in detail in: L<Paws::RedshiftData::DescribeTable>
307  
308 Returns: a L<Paws::RedshiftData::DescribeTableResponse> instance
309  
310 Describes the detailed information about a table from metadata in the
311 cluster. The information includes its columns. A token is returned to
312 page through the column list. Depending on the authorization method,
313 use one of the following combinations of request parameters:
314  
315 =over
316  
317 =item *
318  
319 AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the
320 secret and the cluster identifier that matches the cluster in the
321 secret.
322  
323 =item *
324  
325 Temporary credentials - specify the cluster identifier, the database
326 name, and the database user name. Permission to call the
327 C<redshift:GetClusterCredentials> operation is required to use this
328 method.
329  
330 =back
331  
332  
333  
334 =head2 ExecuteStatement
335  
336 =over
337  
338 =item ClusterIdentifier => Str
339  
340 =item Sql => Str
341  
342 =item [Database => Str]
343  
344 =item [DbUser => Str]
345  
346 =item [Parameters => ArrayRef[L<Paws::RedshiftData::SqlParameter>]]
347  
348 =item [SecretArn => Str]
349  
350 =item [StatementName => Str]
351  
352 =item [WithEvent => Bool]
353  
354  
355 =back
356  
357 Each argument is described in detail in: L<Paws::RedshiftData::ExecuteStatement>
358  
359 Returns: a L<Paws::RedshiftData::ExecuteStatementOutput> instance
360  
361 Runs an SQL statement, which can be data manipulation language (DML) or
362 data definition language (DDL). This statement must be a single SQL
363 statement. Depending on the authorization method, use one of the
364 following combinations of request parameters:
365  
366 =over
367  
368 =item *
369  
370 AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the
371 secret and the cluster identifier that matches the cluster in the
372 secret.
373  
374 =item *
375  
376 Temporary credentials - specify the cluster identifier, the database
377 name, and the database user name. Permission to call the
378 C<redshift:GetClusterCredentials> operation is required to use this
379 method.
380  
381 =back
382  
383  
384  
385 =head2 GetStatementResult
386  
387 =over
388  
389 =item Id => Str
390  
391 =item [NextToken => Str]
392  
393  
394 =back
395  
396 Each argument is described in detail in: L<Paws::RedshiftData::GetStatementResult>
397  
398 Returns: a L<Paws::RedshiftData::GetStatementResultResponse> instance
399  
400 Fetches the temporarily cached result of an SQL statement. A token is
401 returned to page through the statement results.
402  
403  
404 =head2 ListDatabases
405  
406 =over
407  
408 =item ClusterIdentifier => Str
409  
410 =item [Database => Str]
411  
412 =item [DbUser => Str]
413  
414 =item [MaxResults => Int]
415  
416 =item [NextToken => Str]
417  
418 =item [SecretArn => Str]
419  
420  
421 =back
422  
423 Each argument is described in detail in: L<Paws::RedshiftData::ListDatabases>
424  
425 Returns: a L<Paws::RedshiftData::ListDatabasesResponse> instance
426  
427 List the databases in a cluster. A token is returned to page through
428 the database list. Depending on the authorization method, use one of
429 the following combinations of request parameters:
430  
431 =over
432  
433 =item *
434  
435 AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the
436 secret and the cluster identifier that matches the cluster in the
437 secret.
438  
439 =item *
440  
441 Temporary credentials - specify the cluster identifier, the database
442 name, and the database user name. Permission to call the
443 C<redshift:GetClusterCredentials> operation is required to use this
444 method.
445  
446 =back
447  
448  
449  
450 =head2 ListSchemas
451  
452 =over
453  
454 =item ClusterIdentifier => Str
455  
456 =item Database => Str
457  
458 =item [ConnectedDatabase => Str]
459  
460 =item [DbUser => Str]
461  
462 =item [MaxResults => Int]
463  
464 =item [NextToken => Str]
465  
466 =item [SchemaPattern => Str]
467  
468 =item [SecretArn => Str]
469  
470  
471 =back
472  
473 Each argument is described in detail in: L<Paws::RedshiftData::ListSchemas>
474  
475 Returns: a L<Paws::RedshiftData::ListSchemasResponse> instance
476  
477 Lists the schemas in a database. A token is returned to page through
478 the schema list. Depending on the authorization method, use one of the
479 following combinations of request parameters:
480  
481 =over
482  
483 =item *
484  
485 AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the
486 secret and the cluster identifier that matches the cluster in the
487 secret.
488  
489 =item *
490  
491 Temporary credentials - specify the cluster identifier, the database
492 name, and the database user name. Permission to call the
493 C<redshift:GetClusterCredentials> operation is required to use this
494 method.
495  
496 =back
497  
498  
499  
500 =head2 ListStatements
501  
502 =over
503  
504 =item [MaxResults => Int]
505  
506 =item [NextToken => Str]
507  
508 =item [RoleLevel => Bool]
509  
510 =item [StatementName => Str]
511  
512 =item [Status => Str]
513  
514  
515 =back
516  
517 Each argument is described in detail in: L<Paws::RedshiftData::ListStatements>
518  
519 Returns: a L<Paws::RedshiftData::ListStatementsResponse> instance
520  
521 List of SQL statements. By default, only finished statements are shown.
522 A token is returned to page through the statement list.
523  
524  
525 =head2 ListTables
526  
527 =over
528  
529 =item ClusterIdentifier => Str
530  
531 =item Database => Str
532  
533 =item [ConnectedDatabase => Str]
534  
535 =item [DbUser => Str]
536  
537 =item [MaxResults => Int]
538  
539 =item [NextToken => Str]
540  
541 =item [SchemaPattern => Str]
542  
543 =item [SecretArn => Str]
544  
545 =item [TablePattern => Str]
546  
547  
548 =back
549  
550 Each argument is described in detail in: L<Paws::RedshiftData::ListTables>
551  
552 Returns: a L<Paws::RedshiftData::ListTablesResponse> instance
553  
554 List the tables in a database. If neither C<SchemaPattern> nor
555 C<TablePattern> are specified, then all tables in the database are
556 returned. A token is returned to page through the table list. Depending
557 on the authorization method, use one of the following combinations of
558 request parameters:
559  
560 =over
561  
562 =item *
563  
564 AWS Secrets Manager - specify the Amazon Resource Name (ARN) of the
565 secret and the cluster identifier that matches the cluster in the
566 secret.
567  
568 =item *
569  
570 Temporary credentials - specify the cluster identifier, the database
571 name, and the database user name. Permission to call the
572 C<redshift:GetClusterCredentials> operation is required to use this
573 method.
574  
575 =back
576  
577  
578  
579  
580  
581 =head1 PAGINATORS
582  
583 Paginator methods are helpers that repetively call methods that return partial results
584  
585 =head2 DescribeAllTable(sub { },ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, Schema => Str, SecretArn => Str, Table => Str])
586  
587 =head2 DescribeAllTable(ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, Schema => Str, SecretArn => Str, Table => Str])
588  
589  
590 If passed a sub as first parameter, it will call the sub for each element found in :
591  
592 - ColumnList, passing the object as the first parameter, and the string 'ColumnList' as the second parameter
593  
594 If not, it will return a a L<Paws::RedshiftData::DescribeTableResponse> 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.
595  
596  
597 =head2 GetAllStatementResult(sub { },Id => Str, [NextToken => Str])
598  
599 =head2 GetAllStatementResult(Id => Str, [NextToken => Str])
600  
601  
602 If passed a sub as first parameter, it will call the sub for each element found in :
603  
604 - Records, passing the object as the first parameter, and the string 'Records' as the second parameter
605  
606 If not, it will return a a L<Paws::RedshiftData::GetStatementResultResponse> 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.
607  
608  
609 =head2 ListAllDatabases(sub { },ClusterIdentifier => Str, [Database => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SecretArn => Str])
610  
611 =head2 ListAllDatabases(ClusterIdentifier => Str, [Database => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SecretArn => Str])
612  
613  
614 If passed a sub as first parameter, it will call the sub for each element found in :
615  
616 - Databases, passing the object as the first parameter, and the string 'Databases' as the second parameter
617  
618 If not, it will return a a L<Paws::RedshiftData::ListDatabasesResponse> 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.
619  
620  
621 =head2 ListAllSchemas(sub { },ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SchemaPattern => Str, SecretArn => Str])
622  
623 =head2 ListAllSchemas(ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SchemaPattern => Str, SecretArn => Str])
624  
625  
626 If passed a sub as first parameter, it will call the sub for each element found in :
627  
628 - Schemas, passing the object as the first parameter, and the string 'Schemas' as the second parameter
629  
630 If not, it will return a a L<Paws::RedshiftData::ListSchemasResponse> 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.
631  
632  
633 =head2 ListAllStatements(sub { },[MaxResults => Int, NextToken => Str, RoleLevel => Bool, StatementName => Str, Status => Str])
634  
635 =head2 ListAllStatements([MaxResults => Int, NextToken => Str, RoleLevel => Bool, StatementName => Str, Status => Str])
636  
637  
638 If passed a sub as first parameter, it will call the sub for each element found in :
639  
640 - Statements, passing the object as the first parameter, and the string 'Statements' as the second parameter
641  
642 If not, it will return a a L<Paws::RedshiftData::ListStatementsResponse> 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.
643  
644  
645 =head2 ListAllTables(sub { },ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SchemaPattern => Str, SecretArn => Str, TablePattern => Str])
646  
647 =head2 ListAllTables(ClusterIdentifier => Str, Database => Str, [ConnectedDatabase => Str, DbUser => Str, MaxResults => Int, NextToken => Str, SchemaPattern => Str, SecretArn => Str, TablePattern => Str])
648  
649  
650 If passed a sub as first parameter, it will call the sub for each element found in :
651  
652 - Tables, passing the object as the first parameter, and the string 'Tables' as the second parameter
653  
654 If not, it will return a a L<Paws::RedshiftData::ListTablesResponse> 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.
655  
656  
657  
658  
659  
660 =head1 SEE ALSO
661  
662 This service class forms part of L<Paws>
663  
664 =head1 BUGS and CONTRIBUTIONS
665  
666 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
667  
668 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
669  
670 =cut
671