Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions builder-lib/Paws/API/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ package Paws::API::Builder {
has service_full_name => (is => 'ro', lazy => 1, default => sub { $_[0]->api_struct->{metadata}->{ serviceFullName } });
has service => (is => 'ro', lazy => 1, default => sub { $_[0]->api_struct->{metadata}->{ endpointPrefix } });
has signing_name => (is => 'ro', lazy => 1, default => sub { $_[0]->api_struct->{metadata}->{ signingName } // $_[0]->api_struct->{metadata}->{ endpointPrefix } });
has service_short => (is => 'ro', lazy => 1, default => sub {
my $service = $_[0]->service;
if ( index($service, '.') != -1 ) {
return (split(/\./, $service))[1];
}
return $service;
});
has version => (is => 'ro', lazy => 1, default => sub { $_[0]->api_struct->{metadata}->{ apiVersion } });
has endpoint_role => (is => 'ro', lazy => 1, default => 'Paws::API::EndpointResolver' );

Expand Down Expand Up @@ -637,10 +644,10 @@ package Paws::API::Builder {
my $inputs = $self->input_for_operation($op_name);

my $example_str = '';
if ($out_shape) {
if ($out_shape) {
$example_str .= "my \$${out_shape} = ";
}
$example_str .= "\$" . $self->service . "->" . $op_name . "(";
$example_str .= "\$" . $self->service_short . "->" . $op_name . "(";

my @args = ();
my $shape_cache = {};
Expand Down
2 changes: 1 addition & 1 deletion templates/default/callclass_documentation.tt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You shouldn't make instances of this class. Each attribute should be used as a n

=head1 SYNOPSIS

my $[% c.service %] = Paws->service('[% c.api_ns %]');
my $[% c.service_short %] = Paws->service('[% c.api_ns %]');
[% synopsis %]

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
Expand Down
3 changes: 0 additions & 3 deletions templates/json/map_enum.tt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[%- -%]
package [% inner_class %];
use Moose;
with 'Paws::API::MapParser';

use MooseX::ClassAttribute;
class_has xml_keys =>(is => 'ro', default => '[% iclass.key.locationName || 'key' %]');
class_has xml_values =>(is => 'ro', default => '[% iclass.value.locationName || 'value' %]');

[% FOREACH param_name=keys_shape.enum.sort -%]
has [% param_name %] => (is => 'ro', isa => '[% c.get_caller_class_type(iclass.value.shape) %]');
Expand Down
3 changes: 0 additions & 3 deletions templates/restjson/map_enum.tt
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[%- -%]
package [% inner_class %];
use Moose;
with 'Paws::API::MapParser';

use MooseX::ClassAttribute;
class_has xml_keys =>(is => 'ro', default => '[% iclass.key.locationName || 'key' %]');
class_has xml_values =>(is => 'ro', default => '[% iclass.value.locationName || 'value' %]');

[% FOREACH param_name=keys_shape.enum.sort -%]
has [% param_name %] => (is => 'ro', isa => '[% c.get_caller_class_type(iclass.value.shape) %]');
Expand Down