NAME
Google::Cloud::Pubsub::V1beta2::PublisherClient - Client library for Google Cloud Services
SYNOPSIS
use Google::Cloud::Pubsub::V1beta2::PublisherClient;
use Google::Auth;
my $auth = Google::Auth->default();
# 1. High-performance gRPC Transport (Default)
my $grpc_client = Google::Cloud::Pubsub::V1beta2::PublisherClient->new(
credentials => $auth,
transport => 'grpc', # Optional: 'grpc' is default
);
# 2. HTTP/REST Transport
my $rest_client = Google::Cloud::Pubsub::V1beta2::PublisherClient->new(
credentials => $auth,
transport => 'rest',
);
# Execute service methods
my $res = $grpc_client->some_method( %params );
DESCRIPTION
Google::Cloud::Pubsub::V1beta2::PublisherClient is an auto-generated client library for Google Cloud Services.
It provides a unified client interface supporting both high-performance HTTP/2 gRPC and HTTP/REST transports, with automatic Google Cloud Application Default Credentials (ADC) resolution and typed Protocol Buffers message handling.
SOURCE
Generated from the following Protocol Buffers schemas:
googleapis/google/pubsub/v1beta2/pubsub.proto
CONSTRUCTOR
new
my $client = Google::Cloud::Pubsub::V1beta2::PublisherClient->new(
credentials => $auth, # Optional: Google::Auth object (defaults to ADC)
transport => 'grpc', # Optional: 'grpc' (default) or 'rest'
);
ATTRIBUTES
credentials
Returns or accepts the Google::Auth credentials object.
transport
Returns or accepts the active transport object (Google::gRPC::Client or Google::Cloud::REST::Client).
METHODS
METHODS
The following RPC methods are available in this client:
create_topic
my $response = $client->create_topic( name => $name, );Calls the RPC method
CreateTopicongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::Topic
Returns: Google::Pubsub::V1beta2::Pubsub::Topic
Parameters:
name-string
publish
my $response = $client->publish( topic => $topic, messages => [ ... ], );Calls the RPC method
Publishongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::PublishRequest
Returns: Google::Pubsub::V1beta2::Pubsub::PublishResponse
Parameters:
topic-stringmessages- ArrayRef of Google::Pubsub::V1beta2::Pubsub::PubsubMessage
get_topic
my $response = $client->get_topic( topic => $topic, );Calls the RPC method
GetTopicongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::GetTopicRequest
Returns: Google::Pubsub::V1beta2::Pubsub::Topic
Parameters:
topic-string
list_topics
my $response = $client->list_topics( project => $project, page_size => $page_size, page_token => $page_token, );Calls the RPC method
ListTopicsongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::ListTopicsRequest
Returns: Google::Pubsub::V1beta2::Pubsub::ListTopicsResponse
Parameters:
project-stringpage_size-int32page_token-string
list_topic_subscriptions
my $response = $client->list_topic_subscriptions( topic => $topic, page_size => $page_size, page_token => $page_token, );Calls the RPC method
ListTopicSubscriptionsongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::ListTopicSubscriptionsRequest
Returns: Google::Pubsub::V1beta2::Pubsub::ListTopicSubscriptionsResponse
Parameters:
topic-stringpage_size-int32page_token-string
delete_topic
my $response = $client->delete_topic( topic => $topic, );Calls the RPC method
DeleteTopicongoogle.pubsub.v1beta2.Publisher.Request: Google::Pubsub::V1beta2::Pubsub::DeleteTopicRequest
Returns: Google::Protobuf::Empty::Empty
Parameters:
topic-string
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.