Cloud PubSub Client - Class Snapshot (1.49.0)

Reference documentation and code samples for the Cloud PubSub Client class Snapshot.

Represents a Pub/Sub Snapshot

Example:

 use Google\Cloud\PubSub\PubSubClient;

$pubsub = new PubSubClient();

$snapshot = $pubsub->snapshot($snapshotName); 

Namespace

Google \ Cloud \ PubSub

Methods

__construct

Parameters
Name
Description
connection
Google\Cloud\PubSub\Connection\ConnectionInterface

A connection to Cloud Pub/Sub This object is created by PubSubClient, and should not be instantiated outside of this client.

projectId
string

The current Project ID.

name
string

The snapshot name.

encode
bool

Whether certain request arguments should be base64-encoded.

info
array

[optional] The snapshot data. When creating a Snapshot, this array mustcontain a $info.subscription argument with a fully-qualified subscription name.

clientConfig
array

[optional] Configuration options for the PubSub client used to handle processing of batch items through the daemon. For valid options please see Google\Cloud\PubSub\PubSubClient::__construct() . Defaults tothe options provided to the PubSub client associated with this instance.

name

Get the Snapshot name.

Example:

 echo $snapshot->name(); 
Returns
Type
Description
string

info

Get the snapshot info.

Example:

 $info = $snapshot->info(); 
Returns
Type
Description
array

create

Create a new Snapshot.

When creating a snapshot, a subscription name must be supplied at instantiation.

Please note that this method may not yet be available in your project.

Example:

 $info = $snapshot->create(); 
Parameter
Name
Description
options
array

[optional] Configuration options.

Returns
Type
Description
array

delete

Delete the snapshot.

Please note that this method may not yet be available in your project.

Example:

 $snapshot->delete(); 
Parameter
Name
Description
options
array

[optional] Configuration options.

Returns
Type
Description
void

topic

Get the Topic attached to the snapshot, if one exists.

Example:

 $topic = $snapshot->topic(); 
Returns
Type
Description

subscription

Get the Subscription attached to the snapshot, if one exists.

Example:

 $subscription = $snapshot->subscription(); 
Returns
Type
Description

__debugInfo

Create a Mobile Website
View Site in Mobile | Classic
Share by: