From e3a138c9f90b3439a9577ad0e9e308a392e78f96 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:44:05 -0700 Subject: [PATCH] feat: add ingestion Cloud Storage fields and Platform Logging fields to Topic (#7699) PiperOrigin-RevId: 678307181 Source-Link: https://github.com/googleapis/googleapis/commit/69e9dff10df4fa1e338712d38dc26b46791a6e94 Source-Link: https://github.com/googleapis/googleapis-gen/commit/11a52e52723227d3b6120f88f1a580e3958e0cd5 Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiIxMWE1MmU1MjcyMzIyN2QzYjYxMjBmODhmMWE1ODBlMzk1OGUwY2Q1In0= --- PubSub/metadata/V1/Pubsub.php | Bin 15936 -> 17089 bytes PubSub/src/V1/IngestionDataSourceSettings.php | 81 +++++ .../CloudStorage.php | 318 ++++++++++++++++++ .../CloudStorage/AvroFormat.php | 36 ++ .../CloudStorage/PubSubAvroFormat.php | 37 ++ .../CloudStorage/State.php | 92 +++++ .../CloudStorage/TextFormat.php | 80 +++++ PubSub/src/V1/PlatformLogsSettings.php | 67 ++++ .../src/V1/PlatformLogsSettings/Severity.php | 83 +++++ 9 files changed, 794 insertions(+) create mode 100644 PubSub/src/V1/IngestionDataSourceSettings/CloudStorage.php create mode 100644 PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php create mode 100644 PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php create mode 100644 PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/State.php create mode 100644 PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php create mode 100644 PubSub/src/V1/PlatformLogsSettings.php create mode 100644 PubSub/src/V1/PlatformLogsSettings/Severity.php diff --git a/PubSub/metadata/V1/Pubsub.php b/PubSub/metadata/V1/Pubsub.php index 9e49363c323964924dd1b54fb00f6b2bd7f44838..c4ea74873bcf3acd5b572450f5916b8e0ce46111 100644 GIT binary patch delta 859 zcmZuvJ#W)M7>?t7z6q7NM$}CPs<3n+K!#RALc)%nG$hy|b_$(Nc6tOu97p!K0twU! zsRNr~VPj-N%E$oxfQrAsKLOiGNCO@3p0D?L@4mnO@s{~=&L%&-nf+v?Wa@JPD#3Za z64Wz?+vo{g8IB$Q7<<%ljS=CKJIrpOemD4Ox~#9kCLUe znx?I zmGs`aR0vt?(g~ocZ+gCoFFK@ShfWkOuRHX7Q}fOLeHu`aI!K%`j93J~ zf6;PyS`Ac2!2LU9^&@V#CTCv47ue6;-RF;hjPEIAK`(b_2fpo*_I_Pfr^lm+L|DC!xMw@ rkd|a|(BhIP2dTEwR5=zEAp2P8D{Z9}77H12zpt`=EgEO> GM>7D%0}wO- diff --git a/PubSub/src/V1/IngestionDataSourceSettings.php b/PubSub/src/V1/IngestionDataSourceSettings.php index c8f3bd1a0e80..51f4de1f3c71 100644 --- a/PubSub/src/V1/IngestionDataSourceSettings.php +++ b/PubSub/src/V1/IngestionDataSourceSettings.php @@ -15,6 +15,13 @@ */ class IngestionDataSourceSettings extends \Google\Protobuf\Internal\Message { + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $platform_logs_settings = null; protected $source; /** @@ -25,6 +32,11 @@ class IngestionDataSourceSettings extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\AwsKinesis $aws_kinesis * Optional. Amazon Kinesis Data Streams. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $cloud_storage + * Optional. Cloud Storage. + * @type \Google\Cloud\PubSub\V1\PlatformLogsSettings $platform_logs_settings + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. * } */ public function __construct($data = NULL) { @@ -63,6 +75,75 @@ public function setAwsKinesis($var) return $this; } + /** + * Optional. Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage|null + */ + public function getCloudStorage() + { + return $this->readOneof(2); + } + + public function hasCloudStorage() + { + return $this->hasOneof(2); + } + + /** + * Optional. Cloud Storage. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage cloud_storage = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage $var + * @return $this + */ + public function setCloudStorage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\PlatformLogsSettings|null + */ + public function getPlatformLogsSettings() + { + return $this->platform_logs_settings; + } + + public function hasPlatformLogsSettings() + { + return isset($this->platform_logs_settings); + } + + public function clearPlatformLogsSettings() + { + unset($this->platform_logs_settings); + } + + /** + * Optional. Platform Logs settings. If unset, no Platform Logs will be + * generated. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings platform_logs_settings = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\PlatformLogsSettings $var + * @return $this + */ + public function setPlatformLogsSettings($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings::class); + $this->platform_logs_settings = $var; + + return $this; + } + /** * @return string */ diff --git a/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage.php b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage.php new file mode 100644 index 000000000000..8e659d7440e0 --- /dev/null +++ b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage.php @@ -0,0 +1,318 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage + */ +class CloudStorage extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $bucket = ''; + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $minimum_object_create_time = null; + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $match_glob = ''; + protected $input_format; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * @type string $bucket + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $text_format + * Optional. Data from Cloud Storage will be interpreted as text. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $avro_format + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * @type \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $pubsub_avro_format + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * @type \Google\Protobuf\Timestamp $minimum_object_create_time + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * @type string $match_glob + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. An output-only field that indicates the state of the Cloud + * Storage ingestion source. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\State::class); + $this->state = $var; + + return $this; + } + + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + + /** + * Optional. Cloud Storage bucket. The bucket name must be without any + * prefix like "gs://". See the [bucket naming requirements] + * (https://cloud.google.com/storage/docs/buckets#naming). + * + * Generated from protobuf field string bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setBucket($var) + { + GPBUtil::checkString($var, True); + $this->bucket = $var; + + return $this; + } + + /** + * Optional. Data from Cloud Storage will be interpreted as text. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat|null + */ + public function getTextFormat() + { + return $this->readOneof(3); + } + + public function hasTextFormat() + { + return $this->hasOneof(3); + } + + /** + * Optional. Data from Cloud Storage will be interpreted as text. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat text_format = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat $var + * @return $this + */ + public function setTextFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\TextFormat::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat|null + */ + public function getAvroFormat() + { + return $this->readOneof(4); + } + + public function hasAvroFormat() + { + return $this->hasOneof(4); + } + + /** + * Optional. Data from Cloud Storage will be interpreted in Avro format. + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat avro_format = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat $var + * @return $this + */ + public function setAvroFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\AvroFormat::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat|null + */ + public function getPubsubAvroFormat() + { + return $this->readOneof(5); + } + + public function hasPubsubAvroFormat() + { + return $this->hasOneof(5); + } + + /** + * Optional. It will be assumed data from Cloud Storage was written via + * [Cloud Storage + * subscriptions](https://cloud.google.com/pubsub/docs/cloudstorage). + * + * Generated from protobuf field .google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat pubsub_avro_format = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat $var + * @return $this + */ + public function setPubsubAvroFormat($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\PubSub\V1\IngestionDataSourceSettings\CloudStorage\PubSubAvroFormat::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getMinimumObjectCreateTime() + { + return $this->minimum_object_create_time; + } + + public function hasMinimumObjectCreateTime() + { + return isset($this->minimum_object_create_time); + } + + public function clearMinimumObjectCreateTime() + { + unset($this->minimum_object_create_time); + } + + /** + * Optional. Only objects with a larger or equal creation timestamp will be + * ingested. + * + * Generated from protobuf field .google.protobuf.Timestamp minimum_object_create_time = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setMinimumObjectCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->minimum_object_create_time = $var; + + return $this; + } + + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMatchGlob() + { + return $this->match_glob; + } + + /** + * Optional. Glob pattern used to match objects that will be ingested. If + * unset, all objects will be ingested. See the [supported + * patterns](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob). + * + * Generated from protobuf field string match_glob = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMatchGlob($var) + { + GPBUtil::checkString($var, True); + $this->match_glob = $var; + + return $this; + } + + /** + * @return string + */ + public function getInputFormat() + { + return $this->whichOneof("input_format"); + } + +} + + diff --git a/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php new file mode 100644 index 000000000000..397f70eea725 --- /dev/null +++ b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/AvroFormat.php @@ -0,0 +1,36 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.AvroFormat + */ +class AvroFormat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php new file mode 100644 index 000000000000..3e0b2fc2a3e8 --- /dev/null +++ b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/PubSubAvroFormat.php @@ -0,0 +1,37 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.PubSubAvroFormat + */ +class PubSubAvroFormat extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + +} + + diff --git a/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/State.php b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/State.php new file mode 100644 index 000000000000..fc70907d5ea8 --- /dev/null +++ b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/State.php @@ -0,0 +1,92 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Ingestion is active. + * + * Generated from protobuf enum ACTIVE = 1; + */ + const ACTIVE = 1; + /** + * Permission denied encountered while calling the Cloud Storage API. This + * can happen if the Pub/Sub SA has not been granted the + * [appropriate + * permissions](https://cloud.google.com/storage/docs/access-control/iam-permissions): + * - storage.objects.list: to list the objects in a bucket. + * - storage.objects.get: to read the objects in a bucket. + * - storage.buckets.get: to verify the bucket exists. + * + * Generated from protobuf enum CLOUD_STORAGE_PERMISSION_DENIED = 2; + */ + const CLOUD_STORAGE_PERMISSION_DENIED = 2; + /** + * Permission denied encountered while publishing to the topic. This can + * happen if the Pub/Sub SA has not been granted the [appropriate publish + * permissions](https://cloud.google.com/pubsub/docs/access-control#pubsub.publisher) + * + * Generated from protobuf enum PUBLISH_PERMISSION_DENIED = 3; + */ + const PUBLISH_PERMISSION_DENIED = 3; + /** + * The provided Cloud Storage bucket doesn't exist. + * + * Generated from protobuf enum BUCKET_NOT_FOUND = 4; + */ + const BUCKET_NOT_FOUND = 4; + /** + * The Cloud Storage bucket has too many objects, ingestion will be + * paused. + * + * Generated from protobuf enum TOO_MANY_OBJECTS = 5; + */ + const TOO_MANY_OBJECTS = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::ACTIVE => 'ACTIVE', + self::CLOUD_STORAGE_PERMISSION_DENIED => 'CLOUD_STORAGE_PERMISSION_DENIED', + self::PUBLISH_PERMISSION_DENIED => 'PUBLISH_PERMISSION_DENIED', + self::BUCKET_NOT_FOUND => 'BUCKET_NOT_FOUND', + self::TOO_MANY_OBJECTS => 'TOO_MANY_OBJECTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php new file mode 100644 index 000000000000..cb100a7be02c --- /dev/null +++ b/PubSub/src/V1/IngestionDataSourceSettings/CloudStorage/TextFormat.php @@ -0,0 +1,80 @@ +google.pubsub.v1.IngestionDataSourceSettings.CloudStorage.TextFormat + */ +class TextFormat extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $delimiter = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $delimiter + * Optional. When unset, '\n' is used. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDelimiter() + { + return isset($this->delimiter) ? $this->delimiter : ''; + } + + public function hasDelimiter() + { + return isset($this->delimiter); + } + + public function clearDelimiter() + { + unset($this->delimiter); + } + + /** + * Optional. When unset, '\n' is used. + * + * Generated from protobuf field optional string delimiter = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDelimiter($var) + { + GPBUtil::checkString($var, True); + $this->delimiter = $var; + + return $this; + } + +} + + diff --git a/PubSub/src/V1/PlatformLogsSettings.php b/PubSub/src/V1/PlatformLogsSettings.php new file mode 100644 index 000000000000..685659aab94f --- /dev/null +++ b/PubSub/src/V1/PlatformLogsSettings.php @@ -0,0 +1,67 @@ +google.pubsub.v1.PlatformLogsSettings + */ +class PlatformLogsSettings extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $severity = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $severity + * Optional. The minimum severity level of Platform Logs that will be written. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSeverity() + { + return $this->severity; + } + + /** + * Optional. The minimum severity level of Platform Logs that will be written. + * + * Generated from protobuf field .google.pubsub.v1.PlatformLogsSettings.Severity severity = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSeverity($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\PubSub\V1\PlatformLogsSettings\Severity::class); + $this->severity = $var; + + return $this; + } + +} + diff --git a/PubSub/src/V1/PlatformLogsSettings/Severity.php b/PubSub/src/V1/PlatformLogsSettings/Severity.php new file mode 100644 index 000000000000..1cfb79b51bc6 --- /dev/null +++ b/PubSub/src/V1/PlatformLogsSettings/Severity.php @@ -0,0 +1,83 @@ +google.pubsub.v1.PlatformLogsSettings.Severity + */ +class Severity +{ + /** + * Default value. Logs level is unspecified. Logs will be disabled. + * + * Generated from protobuf enum SEVERITY_UNSPECIFIED = 0; + */ + const SEVERITY_UNSPECIFIED = 0; + /** + * Logs will be disabled. + * + * Generated from protobuf enum DISABLED = 1; + */ + const DISABLED = 1; + /** + * Debug logs and higher-severity logs will be written. + * + * Generated from protobuf enum DEBUG = 2; + */ + const DEBUG = 2; + /** + * Info logs and higher-severity logs will be written. + * + * Generated from protobuf enum INFO = 3; + */ + const INFO = 3; + /** + * Warning logs and higher-severity logs will be written. + * + * Generated from protobuf enum WARNING = 4; + */ + const WARNING = 4; + /** + * Only error logs will be written. + * + * Generated from protobuf enum ERROR = 5; + */ + const ERROR = 5; + + private static $valueToName = [ + self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED', + self::DISABLED => 'DISABLED', + self::DEBUG => 'DEBUG', + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +