• %s

    Calls the RPC method %s on the service. Takes a hash of parameters representing the request.

    EOF } $methods_pod .= "=back\n\n";

    # Generate full gRPC service client wrapper
    $client_code = sprintf(<<'EOF', $module_name, $bridge_code, $use_statements, $grpc_target, $methods_code, $module_name, $module_name, $module_name, $module_name, $module_name, $methods_pod);
    package %s;

    use strict; use warnings; use Moo; use Google::gRPC::Client; use Google::Cloud::REST::Client; use Google::Auth; use Carp qw(croak); %s %s

    our $VERSION = '0.02';

    has credentials => ( is => 'ro', required => 0 ); has transport => ( is => 'rw' );

    sub BUILD { my ($self) = @_;

    # Resolve credentials: use passed credentials object if it implements get_token, or default to ADC
    my $auth = $self->credentials;
    if (!$auth || !eval { $auth->can('get_token') }) {
        $auth = Google::Auth->default();
    }
    my $token = $auth->get_token();
    
    my $target = '%s';
    my $t = $self->transport || 'grpc';
    
    if (ref($t) && eval { $t->can('call') }) {
        # Already a transport object
    } elsif (lc($t) eq 'rest') {
        my $client = Google::Cloud::REST::Client->new(
            target     => $target,
            auth_token => $token,
        );
        $self->transport($client);
    } else {
        # Default high-performance HTTP/2 gRPC client
        my $client = Google::gRPC::Client->new(
            target     => $target,
            auth_token => $token,
        );
        $self->transport($client);
    }
    }
    %s1; # End of %s

    __END__

NAME

%s - Auto-generated client library for Google Cloud Services

SYNOPSIS

use %s;
use Google::Auth;

# Initialize Application Default Credentials (ADC) or explicit Google Auth
my $auth = Google::Auth->default();
my $client = %s->new( credentials => $auth );

# Execute service methods
my $res = $client->some_method( %%params );

DESCRIPTION

This is an auto-generated Protocol Buffers client library for Google Cloud Services, built on top of high-performance gRPC and Protocol Buffers!

It provides seamless integration with Google Cloud Application Default Credentials (ADC), support for both HTTP/2 gRPC and REST transports, and fully typed RPC method dispatching.

CONSTRUCTOR

new

my $client = %s->new(
    credentials => $auth,       # Optional: Google::Auth object (defaults to ADC)
    transport   => 'grpc',     # Optional: 'grpc' (default) or 'rest'
);

METHODS

The following RPC methods are available in this client:

%s

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.

NAME

%s - Auto-generated Protocol Buffers schema container

DESCRIPTION

This is an auto-generated Protocol Buffers schema container module for Google Cloud Services.

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.

NAME

Module::Starter::Protobuf - A Module::Starter plugin for generating Protocol Buffers client libraries

VERSION

Version 0.01

SYNOPSIS

use Module::Starter qw(Module::Starter::Protobuf);

# Or from the command line:
# PROTOBUF_FILES=protos/my_service.proto module-starter --module=My::Client --plugin=Module::Starter::Protobuf

DESCRIPTION

This is a Module::Starter plugin that automates the generation of skeletal CPAN distributions from Protocol Buffers (proto3) schemas. It runs the protoc compiler to generate low-level serialization classes using the upb C/XS compiler plugin and automatically generates high-level client wrappers with idiomatic gRPC call methods.

METHODS

create_distro

Intercepts and validates the protobuf configuration parameters from arguments or environment variables.

create_modules

Generates the low-level protobuf serialization classes and the high-level client wrapper modules.

create_t

Generates the dynamic service integration tests (t/01-service.t) under the target directory, including a mock Google::gRPC::Client constructor that accepts both HashRef and list options.

Makefile_PL_guts

Injects the required dependencies (Moo, Net::Curl, Google::Auth, Google::gRPC::Client, Protobuf) into the generated Makefile.PL.

AUTHOR

C.J. Collier <cjac@google.com>

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 291:

'=item' outside of any '=over'

Around line 352:

You forgot a '=back' before '=head1'