Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add DeadLetterPolicy support. #2260

Merged
merged 1 commit into from
Aug 26, 2019
Merged
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
421 changes: 213 additions & 208 deletions PubSub/metadata/V1/Pubsub.php

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions PubSub/src/V1/DeadLetterPolicy.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions PubSub/src/V1/Gapic/SubscriberGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\PubSub\V1\AcknowledgeRequest;
use Google\Cloud\PubSub\V1\CreateSnapshotRequest;
use Google\Cloud\PubSub\V1\DeadLetterPolicy;
use Google\Cloud\PubSub\V1\DeleteSnapshotRequest;
use Google\Cloud\PubSub\V1\DeleteSubscriptionRequest;
use Google\Cloud\PubSub\V1\ExpirationPolicy;
Expand Down Expand Up @@ -475,6 +476,18 @@ public function __construct(array $options = [])
* operations on the subscription. If `expiration_policy` is not set, a
* *default policy* with `ttl` of 31 days will be used. The minimum allowed
* value for `expiration_policy.ttl` is 1 day.
* @type DeadLetterPolicy $deadLetterPolicy
* A policy that specifies the conditions for dead lettering messages in
* this subscription. If dead_letter_policy is not set, dead lettering
* is disabled.
*
* The Cloud Pub/Sub service account associated with this subscriptions's
* parent project (i.e.,
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
* permission to Acknowledge() messages on this subscription.
* <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
* API might be changed in backward-incompatible ways and is not recommended
* for production use. It is not subject to any SLA or deprecation policy.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a
* {@see Google\ApiCore\RetrySettings} object, or an associative array
Expand Down Expand Up @@ -513,6 +526,9 @@ public function createSubscription($name, $topic, array $optionalArgs = [])
if (isset($optionalArgs['expirationPolicy'])) {
$request->setExpirationPolicy($optionalArgs['expirationPolicy']);
}
if (isset($optionalArgs['deadLetterPolicy'])) {
$request->setDeadLetterPolicy($optionalArgs['deadLetterPolicy']);
}

$requestParams = new RequestParamsHeaderDescriptor([
'name' => $request->getName(),
Expand Down Expand Up @@ -918,8 +934,9 @@ public function acknowledge($subscription, $ackIds, array $optionalArgs = [])
*
* @param string $subscription The subscription from which messages should be pulled.
* Format is `projects/{project}/subscriptions/{sub}`.
* @param int $maxMessages The maximum number of messages returned for this request. The Pub/Sub
* system may return fewer than the number specified.
* @param int $maxMessages The maximum number of messages to return for this request. Must be a
* positive integer. The Pub/Sub system may return fewer than the number
* specified.
* @param array $optionalArgs {
* Optional.
*
Expand Down
20 changes: 12 additions & 8 deletions PubSub/src/V1/PullRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions PubSub/src/V1/Subscription.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions PubSub/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2019-08-07T18:03:13.461076Z",
"updateTime": "2019-08-22T10:02:27.799418Z",
"sources": [
{
"generator": {
Expand All @@ -12,8 +12,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "3a1b46a6668194a527e532a2c355b404c79b0e6a",
"internalRef": "262167956"
"sha": "92bebf78345af8b2d3585220527115bda8bdedf8",
"internalRef": "264715111"
}
}
],
Expand Down