|
44 | 44 | use Google\Cloud\PubSub\V1\DetachSubscriptionRequest;
|
45 | 45 | use Google\Cloud\PubSub\V1\DetachSubscriptionResponse;
|
46 | 46 | use Google\Cloud\PubSub\V1\GetTopicRequest;
|
| 47 | +use Google\Cloud\PubSub\V1\IngestionDataSourceSettings; |
47 | 48 | use Google\Cloud\PubSub\V1\ListTopicSnapshotsRequest;
|
48 | 49 | use Google\Cloud\PubSub\V1\ListTopicSnapshotsResponse;
|
49 | 50 | use Google\Cloud\PubSub\V1\ListTopicSubscriptionsRequest;
|
|
56 | 57 | use Google\Cloud\PubSub\V1\PubsubMessage;
|
57 | 58 | use Google\Cloud\PubSub\V1\SchemaSettings;
|
58 | 59 | use Google\Cloud\PubSub\V1\Topic;
|
| 60 | +use Google\Cloud\PubSub\V1\Topic\State; |
59 | 61 | use Google\Cloud\PubSub\V1\UpdateTopicRequest;
|
60 | 62 | use Google\Protobuf\Duration;
|
61 | 63 | use Google\Protobuf\FieldMask;
|
@@ -467,6 +469,12 @@ public function __construct(array $options = [])
|
467 | 469 | * that is up to `message_retention_duration` in the past. If this field is
|
468 | 470 | * not set, message retention is controlled by settings on individual
|
469 | 471 | * subscriptions. Cannot be more than 31 days or less than 10 minutes.
|
| 472 | + * @type int $state |
| 473 | + * Output only. An output-only field indicating the state of the topic. |
| 474 | + * For allowed values, use constants defined on {@see \Google\Cloud\PubSub\V1\Topic\State} |
| 475 | + * @type IngestionDataSourceSettings $ingestionDataSourceSettings |
| 476 | + * Optional. Settings for managed ingestion from a data source into this |
| 477 | + * topic. |
470 | 478 | * @type RetrySettings|array $retrySettings
|
471 | 479 | * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
|
472 | 480 | * associative array of retry settings parameters. See the documentation on
|
@@ -507,6 +515,14 @@ public function createTopic($name, array $optionalArgs = [])
|
507 | 515 | $request->setMessageRetentionDuration($optionalArgs['messageRetentionDuration']);
|
508 | 516 | }
|
509 | 517 |
|
| 518 | + if (isset($optionalArgs['state'])) { |
| 519 | + $request->setState($optionalArgs['state']); |
| 520 | + } |
| 521 | + |
| 522 | + if (isset($optionalArgs['ingestionDataSourceSettings'])) { |
| 523 | + $request->setIngestionDataSourceSettings($optionalArgs['ingestionDataSourceSettings']); |
| 524 | + } |
| 525 | + |
510 | 526 | $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
|
511 | 527 | $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
|
512 | 528 | return $this->startCall('CreateTopic', Topic::class, $optionalArgs, $request)->wait();
|
|
0 commit comments