Google-Cloud-Pubsub-V1
view release on metacpan or search on metacpan
lib/Google/Pubsub/V1/Schema.pm view on Meta::CPAN
=item * B<schema>
Type: Message (.google.pubsub.v1.Schema)
=item * B<message>
Type: Bytes
=item * B<encoding>
Type: Enum (.google.pubsub.v1.Encoding)
=back
=cut
# === Message: Google::Pubsub::V1::Schema::ValidateMessageResponse ===
# Fields for ValidateMessageResponse
=pod
=head1 NAME
Google::Pubsub::V1::Schema::ValidateMessageResponse - Compiled Protocol Buffers message class
=head1 SYNOPSIS
use Google::Pubsub::V1::Schema;
my $msg = Google::Pubsub::V1::Schema::ValidateMessageResponse->new(
);
=head1 FIELDS
=over 4
=back
=cut
# === Service Client: Google::Pubsub::V1::Schema::SchemaServiceClient ===
package Google::Pubsub::V1::Schema::SchemaServiceClient;
=pod
=head1 NAME
Google::Pubsub::V1::Schema::SchemaServiceClient - Client stub representing the remote SchemaService service
=head1 DESCRIPTION
This class acts as a local client stub for the remote gRPC service.
It delegates call dispatching to an underlying L<Google::gRPC::Client>
instance, ensuring type-safe request parsing and response mapping.
=head1 CONFIGURATION AND ENVIRONMENT
=head2 target
The endpoint target address. Defaults to C<pubsub.googleapis.com:443>.
=head2 credentials
The authentication credentials provider. Defaults to application default credentials via L<Google::Auth>.
=cut
use Moo;
use Google::Auth;
use Google::gRPC::Client;
has credentials => ( is => 'ro', default => sub { Google::Auth->default() } );
has target => ( is => 'ro', default => 'pubsub.googleapis.com:443' );
has _grpc_client => (
is => 'ro',
lazy => 1,
builder => sub {
my $self = shift;
return Google::gRPC::Client->new(
target => $self->target,
auth_token => $self->credentials->get_token(),
);
}
);
sub create_schema {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Pubsub::V1::Schema::CreateSchemaRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.pubsub.v1.SchemaService',
method => 'CreateSchema',
request => $req,
response_class => 'Google::Pubsub::V1::Schema::Schema',
});
}
sub get_schema {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Pubsub::V1::Schema::GetSchemaRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.pubsub.v1.SchemaService',
method => 'GetSchema',
request => $req,
response_class => 'Google::Pubsub::V1::Schema::Schema',
});
}
sub list_schemas {
my ($self, $args) = @_;
my $req = ref($args) eq 'HASH'
? Google::Pubsub::V1::Schema::ListSchemasRequest->new($args)
: $args;
return $self->_grpc_client->call({
service => 'google.pubsub.v1.SchemaService',
method => 'ListSchemas',
( run in 0.551 second using v1.01-cache-2.11-cpan-81fc1098f69 )