$members
$required
INPUT }
if ($output) { my $members = $EMPTY; my $output_shape = $shapes->{$output}; my %shape_members = %{ $output_shape->{members} }; foreach my $m ( sort keys %shape_members ) { $members .= sprintf "\n=item %s\n", $m; $members .= html2pod $shape_members{$m}->{documentation}; } $output = <<"OUTPUT";
OUTPUT }
my @error_items; if ( @{$errors} ) { foreach my $e ( @{$errors} ) { my $shape = $shapes->{$e}; push @error_items, '=over 5'; push @error_items, sprintf "=item %s\n%s", $e, html2pod $shape->{documentation}; if ( $shape->{error} ) { push @error_items, '=over 5'; foreach my $k ( sort keys %{ $shape->{error} } ) { push @error_items, sprintf "=item %s\n\n%s", $k, $shape->{error}->{$k}; } push @error_items, "=back\n"; } push @error_items, "=back\n"; } local $LIST_SEPARATOR = "\n\n"; my $error_str = "@error_items"; $errors = <<"ERRORS";
$error_str
ERRORS } else { $errors = $EMPTY; }
my $none = "=over 5\n\n=item NONE\n\n=back\n\n"; $output = $output || $none; $errors = $errors || $none; $input = $input || $none; my $method_pod = <<'END_OF_POD';
@documentation@
@input@
@output@
@errors@
END_OF_POD
my $http = $methods{$method}->{http}; my $http_method = $EMPTY; my $request_uri = $EMPTY; if ($http) { $http_method = $http->{method} // $EMPTY; $request_uri = $http->{requestUri} // $EMPTY; my ( $request_uri_tpl, $args ) = parse_request_uri($request_uri); $operations->{$method}->{http}->{parsed_request_uri} = { request_uri_tpl => $request_uri_tpl, parameters => $args }; $method_pod .= <<'END_OF_POD';
@http_method@
@request_uri@ END_OF_POD }
$method_pod .= <<'END_OF_POD';
my @see_also; push @see_also, $methods{$method}->{input} || (); push @see_also, $methods{$method}->{output} || (); push @see_also, map { $_->{shape} } @{ $operations->{$method}->{errors} }; $parameters->{ to_template_var('see_also') } = join "\n", map { sprintf 'L<%s::%s>', $parameters->{ to_template_var('package_name') }, $_ } @see_also; $parameters->{ to_template_var('method') } = $method; $parameters->{ to_template_var('errors') } = $errors; $parameters->{ to_template_var('input') } = $input; $parameters->{ to_template_var('output') } = $output; $parameters->{ to_template_var('http_method') } = $http_method; $parameters->{ to_template_var('request_uri') } = $request_uri; $parameters->{ to_template_var('documentation') } = $documentation; my $package_name = $parameters->{ to_template_var('package_name') }; $package_name =~ s/::/\//gxsm; push @pod, render_template $method_pod, $parameters; my $pod_stub = <<'END_OF_POD'; =pod
@method@
my $service = @package_name@->new; my $rsp = $service->@method@($parameters);
Method: @http_method@
Request URI: @request_uri@
@see_also@
Autogenerate by @program_name@ on @timestamp@
This module is free software it may be used, redistributed and/or modified under the same terms as Perl itself.
@service@
@available_commands@
@package_name@
@description@
Version @program_version@
@methods@
Autogenerated by @program_name@ at @timestamp@
To install Amazon::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amazon::API
CPAN shell
perl -MCPAN -e shell install Amazon::API
For more information on module installation, please visit the detailed CPAN module installation guide.