├── .gitattributes ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── VERSION ├── composer.json ├── metadata └── V2 │ ├── LogEntry.php │ ├── Logging.php │ ├── LoggingConfig.php │ └── LoggingMetrics.php └── src ├── Connection ├── ConnectionInterface.php ├── Grpc.php ├── Rest.php └── ServiceDefinition │ └── logging-v2.json ├── Entry.php ├── LogMessageProcessor ├── MonologMessageProcessor.php └── MonologV3MessageProcessor.php ├── LogMessageProcessorFactory.php ├── LogMessageProcessorInterface.php ├── Logger.php ├── LoggingClient.php ├── Metric.php ├── PsrLogger.php ├── Sink.php └── V2 ├── BigQueryDataset.php ├── BigQueryOptions.php ├── BucketMetadata.php ├── Client ├── ConfigServiceV2Client.php ├── LoggingServiceV2Client.php └── MetricsServiceV2Client.php ├── CmekSettings.php ├── ConfigServiceV2Client.php ├── ConfigServiceV2GrpcClient.php ├── CopyLogEntriesMetadata.php ├── CopyLogEntriesRequest.php ├── CopyLogEntriesResponse.php ├── CreateBucketRequest.php ├── CreateExclusionRequest.php ├── CreateLinkRequest.php ├── CreateLogMetricRequest.php ├── CreateSinkRequest.php ├── CreateViewRequest.php ├── DeleteBucketRequest.php ├── DeleteExclusionRequest.php ├── DeleteLinkRequest.php ├── DeleteLogMetricRequest.php ├── DeleteLogRequest.php ├── DeleteSinkRequest.php ├── DeleteViewRequest.php ├── Gapic ├── ConfigServiceV2GapicClient.php ├── LoggingServiceV2GapicClient.php └── MetricsServiceV2GapicClient.php ├── GetBucketRequest.php ├── GetCmekSettingsRequest.php ├── GetExclusionRequest.php ├── GetLinkRequest.php ├── GetLogMetricRequest.php ├── GetSettingsRequest.php ├── GetSinkRequest.php ├── GetViewRequest.php ├── IndexConfig.php ├── IndexType.php ├── LifecycleState.php ├── Link.php ├── LinkMetadata.php ├── ListBucketsRequest.php ├── ListBucketsResponse.php ├── ListExclusionsRequest.php ├── ListExclusionsResponse.php ├── ListLinksRequest.php ├── ListLinksResponse.php ├── ListLogEntriesRequest.php ├── ListLogEntriesResponse.php ├── ListLogMetricsRequest.php ├── ListLogMetricsResponse.php ├── ListLogsRequest.php ├── ListLogsResponse.php ├── ListMonitoredResourceDescriptorsRequest.php ├── ListMonitoredResourceDescriptorsResponse.php ├── ListSinksRequest.php ├── ListSinksResponse.php ├── ListViewsRequest.php ├── ListViewsResponse.php ├── LocationMetadata.php ├── LogBucket.php ├── LogEntry.php ├── LogEntryOperation.php ├── LogEntrySourceLocation.php ├── LogExclusion.php ├── LogMetric.php ├── LogMetric └── ApiVersion.php ├── LogMetric_ApiVersion.php ├── LogSink.php ├── LogSink └── VersionFormat.php ├── LogSink_VersionFormat.php ├── LogSplit.php ├── LogView.php ├── LoggingServiceV2Client.php ├── LoggingServiceV2GrpcClient.php ├── MetricsServiceV2Client.php ├── MetricsServiceV2GrpcClient.php ├── OperationState.php ├── README.md ├── Settings.php ├── TailLogEntriesRequest.php ├── TailLogEntriesResponse.php ├── TailLogEntriesResponse ├── SuppressionInfo.php └── SuppressionInfo │ └── Reason.php ├── TailLogEntriesResponse_SuppressionInfo.php ├── TailLogEntriesResponse_SuppressionInfo_Reason.php ├── UndeleteBucketRequest.php ├── UpdateBucketRequest.php ├── UpdateCmekSettingsRequest.php ├── UpdateExclusionRequest.php ├── UpdateLogMetricRequest.php ├── UpdateSettingsRequest.php ├── UpdateSinkRequest.php ├── UpdateViewRequest.php ├── WriteLogEntriesPartialErrors.php ├── WriteLogEntriesRequest.php ├── WriteLogEntriesResponse.php └── resources ├── config_service_v2_client_config.json ├── config_service_v2_descriptor_config.php ├── config_service_v2_rest_client_config.php ├── logging_service_v2_client_config.json ├── logging_service_v2_descriptor_config.php ├── logging_service_v2_rest_client_config.php ├── metrics_service_v2_client_config.json ├── metrics_service_v2_descriptor_config.php └── metrics_service_v2_rest_client_config.php /.gitattributes: -------------------------------------------------------------------------------- 1 | /*.xml.dist export-ignore 2 | /tests export-ignore 3 | /.github export-ignore 4 | /samples export-ignore 5 | /.OwlBot.yaml export-ignore 6 | /owlbot.py export-ignore 7 | /src/**/gapic_metadata.json export-ignore 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, 4 | and in the interest of fostering an open and welcoming community, 5 | we pledge to respect all people who contribute through reporting issues, 6 | posting feature requests, updating documentation, 7 | submitting pull requests or patches, and other activities. 8 | 9 | We are committed to making participation in this project 10 | a harassment-free experience for everyone, 11 | regardless of level of experience, gender, gender identity and expression, 12 | sexual orientation, disability, personal appearance, 13 | body size, race, ethnicity, age, religion, or nationality. 14 | 15 | Examples of unacceptable behavior by participants include: 16 | 17 | * The use of sexualized language or imagery 18 | * Personal attacks 19 | * Trolling or insulting/derogatory comments 20 | * Public or private harassment 21 | * Publishing other's private information, 22 | such as physical or electronic 23 | addresses, without explicit permission 24 | * Other unethical or unprofessional conduct. 25 | 26 | Project maintainers have the right and responsibility to remove, edit, or reject 27 | comments, commits, code, wiki edits, issues, and other contributions 28 | that are not aligned to this Code of Conduct. 29 | By adopting this Code of Conduct, 30 | project maintainers commit themselves to fairly and consistently 31 | applying these principles to every aspect of managing this project. 32 | Project maintainers who do not follow or enforce the Code of Conduct 33 | may be permanently removed from the project team. 34 | 35 | This code of conduct applies both within project spaces and in public spaces 36 | when an individual is representing the project or its community. 37 | 38 | Instances of abusive, harassing, or otherwise unacceptable behavior 39 | may be reported by opening an issue 40 | or contacting one or more of the project maintainers. 41 | 42 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, 43 | available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. We accept 4 | and review pull requests against the main 5 | [Google Cloud PHP](https://github.com/googleapis/google-cloud-php) 6 | repository, which contains all of our client libraries. You will also need to 7 | sign a Contributor License Agreement. For more details about how to contribute, 8 | see the 9 | [CONTRIBUTING.md](https://github.com/googleapis/google-cloud-php/blob/main/CONTRIBUTING.md) 10 | file in the main Google Cloud PHP repository. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stackdriver Logging for PHP 2 | 3 | > Idiomatic PHP client for [Stackdriver Logging](https://cloud.google.com/logging/). 4 | 5 | [![Latest Stable Version](https://poser.pugx.org/google/cloud-logging/v/stable)](https://packagist.org/packages/google/cloud-logging) [![Packagist](https://img.shields.io/packagist/dm/google/cloud-logging.svg)](https://packagist.org/packages/google/cloud-logging) 6 | 7 | * [API documentation](https://cloud.google.com/php/docs/reference/cloud-logging/latest) 8 | 9 | **NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any 10 | support requests, bug reports, or development contributions should be directed to 11 | that project. 12 | 13 | Allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon 14 | Web Services. 15 | 16 | ### Installation 17 | 18 | To begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/). 19 | 20 | Now install this component: 21 | 22 | ```sh 23 | $ composer require google/cloud-logging 24 | ``` 25 | 26 | This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) 27 | please see our [gRPC installation guide](https://cloud.google.com/php/grpc). 28 | 29 | ### Authentication 30 | 31 | Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information 32 | on authenticating your client. Once authenticated, you'll be ready to start making requests. 33 | 34 | ### Sample 35 | 36 | ```php 37 | require 'vendor/autoload.php'; 38 | 39 | use Google\Cloud\Logging\LoggingClient; 40 | 41 | $logging = new LoggingClient(); 42 | 43 | // Get a logger instance. 44 | $logger = $logging->logger('my_log'); 45 | 46 | // Write a log entry. 47 | $logger->write('my message'); 48 | 49 | // List log entries from a specific log. 50 | $entries = $logging->entries([ 51 | 'filter' => 'logName = projects/my_project/logs/my_log' 52 | ]); 53 | 54 | foreach ($entries as $entry) { 55 | echo $entry->info()['textPayload'] . "\n"; 56 | } 57 | ``` 58 | 59 | ### Debugging 60 | 61 | Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md) 62 | for more information about the debugging tools. 63 | 64 | ### Version 65 | 66 | This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in 67 | any minor or patch releases. We will address issues and requests with the highest priority. 68 | 69 | ### Next Steps 70 | 71 | 1. Understand the [official documentation](https://cloud.google.com/logging/docs/). 72 | 2. Take a look at [in-depth usage samples](https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/logging/). 73 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.32.2 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "google/cloud-logging", 3 | "description": "Stackdriver Logging Client for PHP", 4 | "license": "Apache-2.0", 5 | "minimum-stability": "stable", 6 | "require": { 7 | "php": "^8.0", 8 | "google/cloud-core": "^1.61", 9 | "google/gax": "^1.36.0" 10 | }, 11 | "require-dev": { 12 | "phpunit/phpunit": "^9.6", 13 | "phpspec/prophecy-phpunit": "^2.0", 14 | "squizlabs/php_codesniffer": "2.*", 15 | "phpdocumentor/reflection": "^5.3.3||^6.0", 16 | "phpdocumentor/reflection-docblock": "^5.3", 17 | "erusev/parsedown": "^1.6", 18 | "fig/log-test": "^1.1", 19 | "google/cloud-storage": "^1.3", 20 | "google/cloud-bigquery": "^1.0", 21 | "google/cloud-pubsub": "^2.0", 22 | "opis/closure": "^3", 23 | "monolog/monolog": "^3.8" 24 | }, 25 | "provide": { 26 | "psr/log-implementation": "2.0||3.0" 27 | }, 28 | "suggest": { 29 | "ext-grpc": "The gRPC extension enables use of the performant gRPC transport", 30 | "ext-protobuf": "Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.", 31 | "psr/log": "For using the PSR logger. Currently supports versions 1 and 2." 32 | }, 33 | "extra": { 34 | "component": { 35 | "id": "cloud-logging", 36 | "target": "googleapis/google-cloud-php-logging.git", 37 | "path": "Logging", 38 | "entry": "src/LoggingClient.php" 39 | } 40 | }, 41 | "autoload": { 42 | "psr-4": { 43 | "Google\\Cloud\\Logging\\": "src", 44 | "GPBMetadata\\Google\\Logging\\": "metadata" 45 | } 46 | }, 47 | "autoload-dev": { 48 | "psr-4": { 49 | "Google\\Cloud\\Logging\\Tests\\": "tests" 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /metadata/V2/LogEntry.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-logging/86a6b4d08a13c09cff7406c476f45e1898170a26/metadata/V2/LogEntry.php -------------------------------------------------------------------------------- /metadata/V2/Logging.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-logging/86a6b4d08a13c09cff7406c476f45e1898170a26/metadata/V2/Logging.php -------------------------------------------------------------------------------- /metadata/V2/LoggingConfig.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-logging/86a6b4d08a13c09cff7406c476f45e1898170a26/metadata/V2/LoggingConfig.php -------------------------------------------------------------------------------- /metadata/V2/LoggingMetrics.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/google-cloud-php-logging/86a6b4d08a13c09cff7406c476f45e1898170a26/metadata/V2/LoggingMetrics.php -------------------------------------------------------------------------------- /src/Connection/ConnectionInterface.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/ServiceDefinition/logging-v2.json', 46 | 'componentVersion' => LoggingClient::VERSION 47 | ]; 48 | 49 | $this->setRequestWrapper(new RequestWrapper($config)); 50 | $this->setRequestBuilder(new RequestBuilder( 51 | $config['serviceDefinitionPath'], 52 | $this->getApiEndpoint(self::BASE_URI, $config) 53 | )); 54 | } 55 | 56 | /** 57 | * @param array $args 58 | * @return array 59 | */ 60 | public function writeEntries(array $args = []) 61 | { 62 | return $this->send('entries', 'write', $args); 63 | } 64 | 65 | /** 66 | * @param array $args 67 | * @return array 68 | */ 69 | public function listEntries(array $args = []) 70 | { 71 | return $this->send('entries', 'list', $args); 72 | } 73 | 74 | /** 75 | * @param array $args 76 | * @return array 77 | */ 78 | public function createSink(array $args = []) 79 | { 80 | return $this->send('projects.resources.sinks', 'create', $args); 81 | } 82 | 83 | /** 84 | * @param array $args 85 | * @return array 86 | */ 87 | public function getSink(array $args = []) 88 | { 89 | return $this->send('projects.resources.sinks', 'get', $args); 90 | } 91 | 92 | /** 93 | * @param array $args 94 | * @return array 95 | */ 96 | public function listSinks(array $args = []) 97 | { 98 | return $this->send('projects.resources.sinks', 'list', $args); 99 | } 100 | 101 | /** 102 | * @param array $args 103 | * @return array 104 | */ 105 | public function updateSink(array $args = []) 106 | { 107 | return $this->send('projects.resources.sinks', 'update', $args); 108 | } 109 | 110 | /** 111 | * @param array $args 112 | * @return array 113 | */ 114 | public function deleteSink(array $args = []) 115 | { 116 | return $this->send('projects.resources.sinks', 'delete', $args); 117 | } 118 | 119 | /** 120 | * @param array $args 121 | * @return array 122 | */ 123 | public function createMetric(array $args = []) 124 | { 125 | return $this->send('projects.resources.metrics', 'create', $args); 126 | } 127 | 128 | /** 129 | * @param array $args 130 | * @return array 131 | */ 132 | public function getMetric(array $args = []) 133 | { 134 | return $this->send('projects.resources.metrics', 'get', $args); 135 | } 136 | 137 | /** 138 | * @param array $args 139 | * @return array 140 | */ 141 | public function listMetrics(array $args = []) 142 | { 143 | return $this->send('projects.resources.metrics', 'list', $args); 144 | } 145 | 146 | /** 147 | * @param array $args 148 | * @return array 149 | */ 150 | public function updateMetric(array $args = []) 151 | { 152 | return $this->send('projects.resources.metrics', 'update', $args); 153 | } 154 | 155 | /** 156 | * @param array $args 157 | * @return array 158 | */ 159 | public function deleteMetric(array $args = []) 160 | { 161 | return $this->send('projects.resources.metrics', 'delete', $args); 162 | } 163 | 164 | /** 165 | * @param array $args 166 | * @return array 167 | */ 168 | public function deleteLog(array $args = []) 169 | { 170 | return $this->send('projects.resources.logs', 'delete', $args); 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /src/Entry.php: -------------------------------------------------------------------------------- 1 | logger('my-log'); 30 | * 31 | * $entry = $logger->entry('my message'); 32 | * ``` 33 | */ 34 | class Entry 35 | { 36 | /** 37 | * @var array The entry's metadata. 38 | */ 39 | private $info; 40 | 41 | /** 42 | * @param array $info [optional] The entry's metadata. 43 | */ 44 | public function __construct(array $info = []) 45 | { 46 | $this->info = $info; 47 | } 48 | 49 | /** 50 | * Retrieves the entry's details. 51 | * 52 | * Example: 53 | * ``` 54 | * $info = $entry->info(); 55 | * echo $info['textPayload']; 56 | * ``` 57 | * 58 | * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry LogEntry resource documentation. 59 | * 60 | * @return array 61 | */ 62 | public function info() 63 | { 64 | return $this->info; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/LogMessageProcessor/MonologMessageProcessor.php: -------------------------------------------------------------------------------- 1 | formatter = new NormalizerFormatter(); 43 | $this->processor = new PsrLogMessageProcessor(); 44 | } 45 | 46 | /** 47 | * {@inheritdoc} 48 | */ 49 | public function processLogMessage($message, $context) 50 | { 51 | $processor = $this->processor; 52 | 53 | return $processor([ 54 | 'message' => (string) $message, 55 | 'context' => $this->formatter->format($context) 56 | ]); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/LogMessageProcessor/MonologV3MessageProcessor.php: -------------------------------------------------------------------------------- 1 | processor = new PsrLogMessageProcessor(); 39 | } 40 | 41 | /** 42 | * {@inheritdoc} 43 | */ 44 | public function processLogMessage($message, $context) 45 | { 46 | // The datetime, channel, and level are required but not relevant here 47 | $logRecord = new LogRecord( 48 | new \DateTimeImmutable(), 49 | 'channel', 50 | Level::Info, 51 | (string) $message, 52 | $context 53 | ); 54 | 55 | $processor = $this->processor; 56 | $processed = $processor($logRecord); 57 | 58 | return [ 59 | 'message' => $processed['message'], 60 | 'context' => $processed['context'], 61 | ]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/LogMessageProcessorFactory.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.BigQueryDataset 15 | */ 16 | class BigQueryDataset extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Output only. The full resource name of the BigQuery dataset. The DATASET_ID 20 | * will match the ID of the link, so the link must match the naming 21 | * restrictions of BigQuery datasets (alphanumeric characters and underscores 22 | * only). 23 | * The dataset will have a resource path of 24 | * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" 25 | * 26 | * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; 27 | */ 28 | private $dataset_id = ''; 29 | 30 | /** 31 | * Constructor. 32 | * 33 | * @param array $data { 34 | * Optional. Data for populating the Message object. 35 | * 36 | * @type string $dataset_id 37 | * Output only. The full resource name of the BigQuery dataset. The DATASET_ID 38 | * will match the ID of the link, so the link must match the naming 39 | * restrictions of BigQuery datasets (alphanumeric characters and underscores 40 | * only). 41 | * The dataset will have a resource path of 42 | * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" 43 | * } 44 | */ 45 | public function __construct($data = NULL) { 46 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 47 | parent::__construct($data); 48 | } 49 | 50 | /** 51 | * Output only. The full resource name of the BigQuery dataset. The DATASET_ID 52 | * will match the ID of the link, so the link must match the naming 53 | * restrictions of BigQuery datasets (alphanumeric characters and underscores 54 | * only). 55 | * The dataset will have a resource path of 56 | * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" 57 | * 58 | * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; 59 | * @return string 60 | */ 61 | public function getDatasetId() 62 | { 63 | return $this->dataset_id; 64 | } 65 | 66 | /** 67 | * Output only. The full resource name of the BigQuery dataset. The DATASET_ID 68 | * will match the ID of the link, so the link must match the naming 69 | * restrictions of BigQuery datasets (alphanumeric characters and underscores 70 | * only). 71 | * The dataset will have a resource path of 72 | * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" 73 | * 74 | * Generated from protobuf field string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; 75 | * @param string $var 76 | * @return $this 77 | */ 78 | public function setDatasetId($var) 79 | { 80 | GPBUtil::checkString($var, True); 81 | $this->dataset_id = $var; 82 | 83 | return $this; 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/V2/ConfigServiceV2Client.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.CopyLogEntriesRequest 15 | */ 16 | class CopyLogEntriesRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. Log bucket from which to copy log entries. 20 | * For example: 21 | * `"projects/my-project/locations/global/buckets/my-source-bucket"` 22 | * 23 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; 24 | */ 25 | private $name = ''; 26 | /** 27 | * Optional. A filter specifying which log entries to copy. The filter must be 28 | * no more than 20k characters. An empty filter matches all log entries. 29 | * 30 | * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; 31 | */ 32 | private $filter = ''; 33 | /** 34 | * Required. Destination to which to copy log entries. 35 | * 36 | * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; 37 | */ 38 | private $destination = ''; 39 | 40 | /** 41 | * Constructor. 42 | * 43 | * @param array $data { 44 | * Optional. Data for populating the Message object. 45 | * 46 | * @type string $name 47 | * Required. Log bucket from which to copy log entries. 48 | * For example: 49 | * `"projects/my-project/locations/global/buckets/my-source-bucket"` 50 | * @type string $filter 51 | * Optional. A filter specifying which log entries to copy. The filter must be 52 | * no more than 20k characters. An empty filter matches all log entries. 53 | * @type string $destination 54 | * Required. Destination to which to copy log entries. 55 | * } 56 | */ 57 | public function __construct($data = NULL) { 58 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 59 | parent::__construct($data); 60 | } 61 | 62 | /** 63 | * Required. Log bucket from which to copy log entries. 64 | * For example: 65 | * `"projects/my-project/locations/global/buckets/my-source-bucket"` 66 | * 67 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; 68 | * @return string 69 | */ 70 | public function getName() 71 | { 72 | return $this->name; 73 | } 74 | 75 | /** 76 | * Required. Log bucket from which to copy log entries. 77 | * For example: 78 | * `"projects/my-project/locations/global/buckets/my-source-bucket"` 79 | * 80 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; 81 | * @param string $var 82 | * @return $this 83 | */ 84 | public function setName($var) 85 | { 86 | GPBUtil::checkString($var, True); 87 | $this->name = $var; 88 | 89 | return $this; 90 | } 91 | 92 | /** 93 | * Optional. A filter specifying which log entries to copy. The filter must be 94 | * no more than 20k characters. An empty filter matches all log entries. 95 | * 96 | * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; 97 | * @return string 98 | */ 99 | public function getFilter() 100 | { 101 | return $this->filter; 102 | } 103 | 104 | /** 105 | * Optional. A filter specifying which log entries to copy. The filter must be 106 | * no more than 20k characters. An empty filter matches all log entries. 107 | * 108 | * Generated from protobuf field string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; 109 | * @param string $var 110 | * @return $this 111 | */ 112 | public function setFilter($var) 113 | { 114 | GPBUtil::checkString($var, True); 115 | $this->filter = $var; 116 | 117 | return $this; 118 | } 119 | 120 | /** 121 | * Required. Destination to which to copy log entries. 122 | * 123 | * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; 124 | * @return string 125 | */ 126 | public function getDestination() 127 | { 128 | return $this->destination; 129 | } 130 | 131 | /** 132 | * Required. Destination to which to copy log entries. 133 | * 134 | * Generated from protobuf field string destination = 4 [(.google.api.field_behavior) = REQUIRED]; 135 | * @param string $var 136 | * @return $this 137 | */ 138 | public function setDestination($var) 139 | { 140 | GPBUtil::checkString($var, True); 141 | $this->destination = $var; 142 | 143 | return $this; 144 | } 145 | 146 | } 147 | 148 | -------------------------------------------------------------------------------- /src/V2/CopyLogEntriesResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.CopyLogEntriesResponse 15 | */ 16 | class CopyLogEntriesResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Number of log entries copied. 20 | * 21 | * Generated from protobuf field int64 log_entries_copied_count = 1; 22 | */ 23 | private $log_entries_copied_count = 0; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type int|string $log_entries_copied_count 32 | * Number of log entries copied. 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Number of log entries copied. 42 | * 43 | * Generated from protobuf field int64 log_entries_copied_count = 1; 44 | * @return int|string 45 | */ 46 | public function getLogEntriesCopiedCount() 47 | { 48 | return $this->log_entries_copied_count; 49 | } 50 | 51 | /** 52 | * Number of log entries copied. 53 | * 54 | * Generated from protobuf field int64 log_entries_copied_count = 1; 55 | * @param int|string $var 56 | * @return $this 57 | */ 58 | public function setLogEntriesCopiedCount($var) 59 | { 60 | GPBUtil::checkInt64($var); 61 | $this->log_entries_copied_count = $var; 62 | 63 | return $this; 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/V2/CreateLogMetricRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.CreateLogMetricRequest 15 | */ 16 | class CreateLogMetricRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the project in which to create the metric: 20 | * "projects/[PROJECT_ID]" 21 | * The new metric must be provided in the request. 22 | * 23 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 24 | */ 25 | private $parent = ''; 26 | /** 27 | * Required. The new logs-based metric, which must not have an identifier that 28 | * already exists. 29 | * 30 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 31 | */ 32 | private $metric = null; 33 | 34 | /** 35 | * @param string $parent Required. The resource name of the project in which to create the metric: 36 | * 37 | * "projects/[PROJECT_ID]" 38 | * 39 | * The new metric must be provided in the request. Please see 40 | * {@see MetricsServiceV2Client::projectName()} for help formatting this field. 41 | * @param \Google\Cloud\Logging\V2\LogMetric $metric Required. The new logs-based metric, which must not have an identifier that 42 | * already exists. 43 | * 44 | * @return \Google\Cloud\Logging\V2\CreateLogMetricRequest 45 | * 46 | * @experimental 47 | */ 48 | public static function build(string $parent, \Google\Cloud\Logging\V2\LogMetric $metric): self 49 | { 50 | return (new self()) 51 | ->setParent($parent) 52 | ->setMetric($metric); 53 | } 54 | 55 | /** 56 | * Constructor. 57 | * 58 | * @param array $data { 59 | * Optional. Data for populating the Message object. 60 | * 61 | * @type string $parent 62 | * Required. The resource name of the project in which to create the metric: 63 | * "projects/[PROJECT_ID]" 64 | * The new metric must be provided in the request. 65 | * @type \Google\Cloud\Logging\V2\LogMetric $metric 66 | * Required. The new logs-based metric, which must not have an identifier that 67 | * already exists. 68 | * } 69 | */ 70 | public function __construct($data = NULL) { 71 | \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); 72 | parent::__construct($data); 73 | } 74 | 75 | /** 76 | * Required. The resource name of the project in which to create the metric: 77 | * "projects/[PROJECT_ID]" 78 | * The new metric must be provided in the request. 79 | * 80 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 81 | * @return string 82 | */ 83 | public function getParent() 84 | { 85 | return $this->parent; 86 | } 87 | 88 | /** 89 | * Required. The resource name of the project in which to create the metric: 90 | * "projects/[PROJECT_ID]" 91 | * The new metric must be provided in the request. 92 | * 93 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 94 | * @param string $var 95 | * @return $this 96 | */ 97 | public function setParent($var) 98 | { 99 | GPBUtil::checkString($var, True); 100 | $this->parent = $var; 101 | 102 | return $this; 103 | } 104 | 105 | /** 106 | * Required. The new logs-based metric, which must not have an identifier that 107 | * already exists. 108 | * 109 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 110 | * @return \Google\Cloud\Logging\V2\LogMetric|null 111 | */ 112 | public function getMetric() 113 | { 114 | return $this->metric; 115 | } 116 | 117 | public function hasMetric() 118 | { 119 | return isset($this->metric); 120 | } 121 | 122 | public function clearMetric() 123 | { 124 | unset($this->metric); 125 | } 126 | 127 | /** 128 | * Required. The new logs-based metric, which must not have an identifier that 129 | * already exists. 130 | * 131 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 132 | * @param \Google\Cloud\Logging\V2\LogMetric $var 133 | * @return $this 134 | */ 135 | public function setMetric($var) 136 | { 137 | GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); 138 | $this->metric = $var; 139 | 140 | return $this; 141 | } 142 | 143 | } 144 | 145 | -------------------------------------------------------------------------------- /src/V2/CreateViewRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.CreateViewRequest 15 | */ 16 | class CreateViewRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The bucket in which to create the view 20 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` 21 | * For example: 22 | * `"projects/my-project/locations/global/buckets/my-bucket"` 23 | * 24 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; 25 | */ 26 | private $parent = ''; 27 | /** 28 | * Required. A client-assigned identifier such as `"my-view"`. Identifiers are 29 | * limited to 100 characters and can include only letters, digits, 30 | * underscores, hyphens, and periods. 31 | * 32 | * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; 33 | */ 34 | private $view_id = ''; 35 | /** 36 | * Required. The new view. 37 | * 38 | * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; 39 | */ 40 | private $view = null; 41 | 42 | /** 43 | * Constructor. 44 | * 45 | * @param array $data { 46 | * Optional. Data for populating the Message object. 47 | * 48 | * @type string $parent 49 | * Required. The bucket in which to create the view 50 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` 51 | * For example: 52 | * `"projects/my-project/locations/global/buckets/my-bucket"` 53 | * @type string $view_id 54 | * Required. A client-assigned identifier such as `"my-view"`. Identifiers are 55 | * limited to 100 characters and can include only letters, digits, 56 | * underscores, hyphens, and periods. 57 | * @type \Google\Cloud\Logging\V2\LogView $view 58 | * Required. The new view. 59 | * } 60 | */ 61 | public function __construct($data = NULL) { 62 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 63 | parent::__construct($data); 64 | } 65 | 66 | /** 67 | * Required. The bucket in which to create the view 68 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` 69 | * For example: 70 | * `"projects/my-project/locations/global/buckets/my-bucket"` 71 | * 72 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; 73 | * @return string 74 | */ 75 | public function getParent() 76 | { 77 | return $this->parent; 78 | } 79 | 80 | /** 81 | * Required. The bucket in which to create the view 82 | * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` 83 | * For example: 84 | * `"projects/my-project/locations/global/buckets/my-bucket"` 85 | * 86 | * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED]; 87 | * @param string $var 88 | * @return $this 89 | */ 90 | public function setParent($var) 91 | { 92 | GPBUtil::checkString($var, True); 93 | $this->parent = $var; 94 | 95 | return $this; 96 | } 97 | 98 | /** 99 | * Required. A client-assigned identifier such as `"my-view"`. Identifiers are 100 | * limited to 100 characters and can include only letters, digits, 101 | * underscores, hyphens, and periods. 102 | * 103 | * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; 104 | * @return string 105 | */ 106 | public function getViewId() 107 | { 108 | return $this->view_id; 109 | } 110 | 111 | /** 112 | * Required. A client-assigned identifier such as `"my-view"`. Identifiers are 113 | * limited to 100 characters and can include only letters, digits, 114 | * underscores, hyphens, and periods. 115 | * 116 | * Generated from protobuf field string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; 117 | * @param string $var 118 | * @return $this 119 | */ 120 | public function setViewId($var) 121 | { 122 | GPBUtil::checkString($var, True); 123 | $this->view_id = $var; 124 | 125 | return $this; 126 | } 127 | 128 | /** 129 | * Required. The new view. 130 | * 131 | * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; 132 | * @return \Google\Cloud\Logging\V2\LogView|null 133 | */ 134 | public function getView() 135 | { 136 | return $this->view; 137 | } 138 | 139 | public function hasView() 140 | { 141 | return isset($this->view); 142 | } 143 | 144 | public function clearView() 145 | { 146 | unset($this->view); 147 | } 148 | 149 | /** 150 | * Required. The new view. 151 | * 152 | * Generated from protobuf field .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; 153 | * @param \Google\Cloud\Logging\V2\LogView $var 154 | * @return $this 155 | */ 156 | public function setView($var) 157 | { 158 | GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogView::class); 159 | $this->view = $var; 160 | 161 | return $this; 162 | } 163 | 164 | } 165 | 166 | -------------------------------------------------------------------------------- /src/V2/DeleteBucketRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteBucketRequest 15 | */ 16 | class DeleteBucketRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The full resource name of the bucket to delete. 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 21 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 23 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 24 | * For example: 25 | * `"projects/my-project/locations/global/buckets/my-bucket"` 26 | * 27 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $name = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $name 38 | * Required. The full resource name of the bucket to delete. 39 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 40 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 41 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 42 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 43 | * For example: 44 | * `"projects/my-project/locations/global/buckets/my-bucket"` 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * Required. The full resource name of the bucket to delete. 54 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 55 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 56 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 57 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 58 | * For example: 59 | * `"projects/my-project/locations/global/buckets/my-bucket"` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. The full resource name of the bucket to delete. 71 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 72 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 73 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 74 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 75 | * For example: 76 | * `"projects/my-project/locations/global/buckets/my-bucket"` 77 | * 78 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 79 | * @param string $var 80 | * @return $this 81 | */ 82 | public function setName($var) 83 | { 84 | GPBUtil::checkString($var, True); 85 | $this->name = $var; 86 | 87 | return $this; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/V2/DeleteExclusionRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteExclusionRequest 15 | */ 16 | class DeleteExclusionRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of an existing exclusion to delete: 20 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 21 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 23 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 24 | * For example: 25 | * `"projects/my-project/exclusions/my-exclusion"` 26 | * 27 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $name = ''; 30 | 31 | /** 32 | * @param string $name Required. The resource name of an existing exclusion to delete: 33 | * 34 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 35 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 36 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 37 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 38 | * 39 | * For example: 40 | * 41 | * `"projects/my-project/exclusions/my-exclusion"` 42 | * Please see {@see ConfigServiceV2Client::logExclusionName()} for help formatting this field. 43 | * 44 | * @return \Google\Cloud\Logging\V2\DeleteExclusionRequest 45 | * 46 | * @experimental 47 | */ 48 | public static function build(string $name): self 49 | { 50 | return (new self()) 51 | ->setName($name); 52 | } 53 | 54 | /** 55 | * Constructor. 56 | * 57 | * @param array $data { 58 | * Optional. Data for populating the Message object. 59 | * 60 | * @type string $name 61 | * Required. The resource name of an existing exclusion to delete: 62 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 63 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 64 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 65 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 66 | * For example: 67 | * `"projects/my-project/exclusions/my-exclusion"` 68 | * } 69 | */ 70 | public function __construct($data = NULL) { 71 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 72 | parent::__construct($data); 73 | } 74 | 75 | /** 76 | * Required. The resource name of an existing exclusion to delete: 77 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 78 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 79 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 80 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 81 | * For example: 82 | * `"projects/my-project/exclusions/my-exclusion"` 83 | * 84 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 85 | * @return string 86 | */ 87 | public function getName() 88 | { 89 | return $this->name; 90 | } 91 | 92 | /** 93 | * Required. The resource name of an existing exclusion to delete: 94 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 95 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 96 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 97 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 98 | * For example: 99 | * `"projects/my-project/exclusions/my-exclusion"` 100 | * 101 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 102 | * @param string $var 103 | * @return $this 104 | */ 105 | public function setName($var) 106 | { 107 | GPBUtil::checkString($var, True); 108 | $this->name = $var; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/V2/DeleteLinkRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteLinkRequest 15 | */ 16 | class DeleteLinkRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The full resource name of the link to delete. 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 21 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 23 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 24 | * 25 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 26 | */ 27 | private $name = ''; 28 | 29 | /** 30 | * @param string $name Required. The full resource name of the link to delete. 31 | * 32 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 33 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 34 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 35 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 36 | * Please see {@see ConfigServiceV2Client::linkName()} for help formatting this field. 37 | * 38 | * @return \Google\Cloud\Logging\V2\DeleteLinkRequest 39 | * 40 | * @experimental 41 | */ 42 | public static function build(string $name): self 43 | { 44 | return (new self()) 45 | ->setName($name); 46 | } 47 | 48 | /** 49 | * Constructor. 50 | * 51 | * @param array $data { 52 | * Optional. Data for populating the Message object. 53 | * 54 | * @type string $name 55 | * Required. The full resource name of the link to delete. 56 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 57 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 58 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 59 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 60 | * } 61 | */ 62 | public function __construct($data = NULL) { 63 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 64 | parent::__construct($data); 65 | } 66 | 67 | /** 68 | * Required. The full resource name of the link to delete. 69 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 70 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 71 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 72 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 73 | * 74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 75 | * @return string 76 | */ 77 | public function getName() 78 | { 79 | return $this->name; 80 | } 81 | 82 | /** 83 | * Required. The full resource name of the link to delete. 84 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 85 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 86 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 87 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 88 | * 89 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 90 | * @param string $var 91 | * @return $this 92 | */ 93 | public function setName($var) 94 | { 95 | GPBUtil::checkString($var, True); 96 | $this->name = $var; 97 | 98 | return $this; 99 | } 100 | 101 | } 102 | 103 | -------------------------------------------------------------------------------- /src/V2/DeleteLogMetricRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteLogMetricRequest 15 | */ 16 | class DeleteLogMetricRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the metric to delete: 20 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 21 | * 22 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 23 | */ 24 | private $metric_name = ''; 25 | 26 | /** 27 | * @param string $metricName Required. The resource name of the metric to delete: 28 | * 29 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 30 | * Please see {@see MetricsServiceV2Client::logMetricName()} for help formatting this field. 31 | * 32 | * @return \Google\Cloud\Logging\V2\DeleteLogMetricRequest 33 | * 34 | * @experimental 35 | */ 36 | public static function build(string $metricName): self 37 | { 38 | return (new self()) 39 | ->setMetricName($metricName); 40 | } 41 | 42 | /** 43 | * Constructor. 44 | * 45 | * @param array $data { 46 | * Optional. Data for populating the Message object. 47 | * 48 | * @type string $metric_name 49 | * Required. The resource name of the metric to delete: 50 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 51 | * } 52 | */ 53 | public function __construct($data = NULL) { 54 | \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); 55 | parent::__construct($data); 56 | } 57 | 58 | /** 59 | * Required. The resource name of the metric to delete: 60 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 61 | * 62 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 63 | * @return string 64 | */ 65 | public function getMetricName() 66 | { 67 | return $this->metric_name; 68 | } 69 | 70 | /** 71 | * Required. The resource name of the metric to delete: 72 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 73 | * 74 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 75 | * @param string $var 76 | * @return $this 77 | */ 78 | public function setMetricName($var) 79 | { 80 | GPBUtil::checkString($var, True); 81 | $this->metric_name = $var; 82 | 83 | return $this; 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/V2/DeleteLogRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteLogRequest 15 | */ 16 | class DeleteLogRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the log to delete: 20 | * * `projects/[PROJECT_ID]/logs/[LOG_ID]` 21 | * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` 22 | * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` 23 | * * `folders/[FOLDER_ID]/logs/[LOG_ID]` 24 | * `[LOG_ID]` must be URL-encoded. For example, 25 | * `"projects/my-project-id/logs/syslog"`, 26 | * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. 27 | * For more information about log names, see 28 | * [LogEntry][google.logging.v2.LogEntry]. 29 | * 30 | * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 31 | */ 32 | private $log_name = ''; 33 | 34 | /** 35 | * @param string $logName Required. The resource name of the log to delete: 36 | * 37 | * * `projects/[PROJECT_ID]/logs/[LOG_ID]` 38 | * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` 39 | * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` 40 | * * `folders/[FOLDER_ID]/logs/[LOG_ID]` 41 | * 42 | * `[LOG_ID]` must be URL-encoded. For example, 43 | * `"projects/my-project-id/logs/syslog"`, 44 | * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. 45 | * 46 | * For more information about log names, see 47 | * [LogEntry][google.logging.v2.LogEntry]. Please see 48 | * {@see LoggingServiceV2Client::logName()} for help formatting this field. 49 | * 50 | * @return \Google\Cloud\Logging\V2\DeleteLogRequest 51 | * 52 | * @experimental 53 | */ 54 | public static function build(string $logName): self 55 | { 56 | return (new self()) 57 | ->setLogName($logName); 58 | } 59 | 60 | /** 61 | * Constructor. 62 | * 63 | * @param array $data { 64 | * Optional. Data for populating the Message object. 65 | * 66 | * @type string $log_name 67 | * Required. The resource name of the log to delete: 68 | * * `projects/[PROJECT_ID]/logs/[LOG_ID]` 69 | * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` 70 | * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` 71 | * * `folders/[FOLDER_ID]/logs/[LOG_ID]` 72 | * `[LOG_ID]` must be URL-encoded. For example, 73 | * `"projects/my-project-id/logs/syslog"`, 74 | * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. 75 | * For more information about log names, see 76 | * [LogEntry][google.logging.v2.LogEntry]. 77 | * } 78 | */ 79 | public function __construct($data = NULL) { 80 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 81 | parent::__construct($data); 82 | } 83 | 84 | /** 85 | * Required. The resource name of the log to delete: 86 | * * `projects/[PROJECT_ID]/logs/[LOG_ID]` 87 | * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` 88 | * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` 89 | * * `folders/[FOLDER_ID]/logs/[LOG_ID]` 90 | * `[LOG_ID]` must be URL-encoded. For example, 91 | * `"projects/my-project-id/logs/syslog"`, 92 | * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. 93 | * For more information about log names, see 94 | * [LogEntry][google.logging.v2.LogEntry]. 95 | * 96 | * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 97 | * @return string 98 | */ 99 | public function getLogName() 100 | { 101 | return $this->log_name; 102 | } 103 | 104 | /** 105 | * Required. The resource name of the log to delete: 106 | * * `projects/[PROJECT_ID]/logs/[LOG_ID]` 107 | * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` 108 | * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` 109 | * * `folders/[FOLDER_ID]/logs/[LOG_ID]` 110 | * `[LOG_ID]` must be URL-encoded. For example, 111 | * `"projects/my-project-id/logs/syslog"`, 112 | * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. 113 | * For more information about log names, see 114 | * [LogEntry][google.logging.v2.LogEntry]. 115 | * 116 | * Generated from protobuf field string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 117 | * @param string $var 118 | * @return $this 119 | */ 120 | public function setLogName($var) 121 | { 122 | GPBUtil::checkString($var, True); 123 | $this->log_name = $var; 124 | 125 | return $this; 126 | } 127 | 128 | } 129 | 130 | -------------------------------------------------------------------------------- /src/V2/DeleteSinkRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteSinkRequest 15 | */ 16 | class DeleteSinkRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The full resource name of the sink to delete, including the 20 | * parent resource and the sink identifier: 21 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 22 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 23 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 24 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 25 | * For example: 26 | * `"projects/my-project/sinks/my-sink"` 27 | * 28 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 29 | */ 30 | private $sink_name = ''; 31 | 32 | /** 33 | * @param string $sinkName Required. The full resource name of the sink to delete, including the 34 | * parent resource and the sink identifier: 35 | * 36 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 37 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 38 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 39 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 40 | * 41 | * For example: 42 | * 43 | * `"projects/my-project/sinks/my-sink"` 44 | * Please see {@see ConfigServiceV2Client::logSinkName()} for help formatting this field. 45 | * 46 | * @return \Google\Cloud\Logging\V2\DeleteSinkRequest 47 | * 48 | * @experimental 49 | */ 50 | public static function build(string $sinkName): self 51 | { 52 | return (new self()) 53 | ->setSinkName($sinkName); 54 | } 55 | 56 | /** 57 | * Constructor. 58 | * 59 | * @param array $data { 60 | * Optional. Data for populating the Message object. 61 | * 62 | * @type string $sink_name 63 | * Required. The full resource name of the sink to delete, including the 64 | * parent resource and the sink identifier: 65 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 66 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 67 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 68 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 69 | * For example: 70 | * `"projects/my-project/sinks/my-sink"` 71 | * } 72 | */ 73 | public function __construct($data = NULL) { 74 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 75 | parent::__construct($data); 76 | } 77 | 78 | /** 79 | * Required. The full resource name of the sink to delete, including the 80 | * parent resource and the sink identifier: 81 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 82 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 83 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 84 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 85 | * For example: 86 | * `"projects/my-project/sinks/my-sink"` 87 | * 88 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 89 | * @return string 90 | */ 91 | public function getSinkName() 92 | { 93 | return $this->sink_name; 94 | } 95 | 96 | /** 97 | * Required. The full resource name of the sink to delete, including the 98 | * parent resource and the sink identifier: 99 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 100 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 101 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 102 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 103 | * For example: 104 | * `"projects/my-project/sinks/my-sink"` 105 | * 106 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 107 | * @param string $var 108 | * @return $this 109 | */ 110 | public function setSinkName($var) 111 | { 112 | GPBUtil::checkString($var, True); 113 | $this->sink_name = $var; 114 | 115 | return $this; 116 | } 117 | 118 | } 119 | 120 | -------------------------------------------------------------------------------- /src/V2/DeleteViewRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.DeleteViewRequest 15 | */ 16 | class DeleteViewRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The full resource name of the view to delete: 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 21 | * For example: 22 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 23 | * 24 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 25 | */ 26 | private $name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $name 35 | * Required. The full resource name of the view to delete: 36 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 37 | * For example: 38 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * Required. The full resource name of the view to delete: 48 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 49 | * For example: 50 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 51 | * 52 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 53 | * @return string 54 | */ 55 | public function getName() 56 | { 57 | return $this->name; 58 | } 59 | 60 | /** 61 | * Required. The full resource name of the view to delete: 62 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 63 | * For example: 64 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 65 | * 66 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 67 | * @param string $var 68 | * @return $this 69 | */ 70 | public function setName($var) 71 | { 72 | GPBUtil::checkString($var, True); 73 | $this->name = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V2/GetBucketRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetBucketRequest 15 | */ 16 | class GetBucketRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the bucket: 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 21 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 23 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 24 | * For example: 25 | * `"projects/my-project/locations/global/buckets/my-bucket"` 26 | * 27 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $name = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $name 38 | * Required. The resource name of the bucket: 39 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 40 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 41 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 42 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 43 | * For example: 44 | * `"projects/my-project/locations/global/buckets/my-bucket"` 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * Required. The resource name of the bucket: 54 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 55 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 56 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 57 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 58 | * For example: 59 | * `"projects/my-project/locations/global/buckets/my-bucket"` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. The resource name of the bucket: 71 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 72 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 73 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 74 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 75 | * For example: 76 | * `"projects/my-project/locations/global/buckets/my-bucket"` 77 | * 78 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 79 | * @param string $var 80 | * @return $this 81 | */ 82 | public function setName($var) 83 | { 84 | GPBUtil::checkString($var, True); 85 | $this->name = $var; 86 | 87 | return $this; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/V2/GetCmekSettingsRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetCmekSettingsRequest 19 | */ 20 | class GetCmekSettingsRequest extends \Google\Protobuf\Internal\Message 21 | { 22 | /** 23 | * Required. The resource for which to retrieve CMEK settings. 24 | * "projects/[PROJECT_ID]/cmekSettings" 25 | * "organizations/[ORGANIZATION_ID]/cmekSettings" 26 | * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" 27 | * "folders/[FOLDER_ID]/cmekSettings" 28 | * For example: 29 | * `"organizations/12345/cmekSettings"` 30 | * Note: CMEK for the Log Router can be configured for Google Cloud projects, 31 | * folders, organizations and billing accounts. Once configured for an 32 | * organization, it applies to all projects and folders in the Google Cloud 33 | * organization. 34 | * 35 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 36 | */ 37 | private $name = ''; 38 | 39 | /** 40 | * Constructor. 41 | * 42 | * @param array $data { 43 | * Optional. Data for populating the Message object. 44 | * 45 | * @type string $name 46 | * Required. The resource for which to retrieve CMEK settings. 47 | * "projects/[PROJECT_ID]/cmekSettings" 48 | * "organizations/[ORGANIZATION_ID]/cmekSettings" 49 | * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" 50 | * "folders/[FOLDER_ID]/cmekSettings" 51 | * For example: 52 | * `"organizations/12345/cmekSettings"` 53 | * Note: CMEK for the Log Router can be configured for Google Cloud projects, 54 | * folders, organizations and billing accounts. Once configured for an 55 | * organization, it applies to all projects and folders in the Google Cloud 56 | * organization. 57 | * } 58 | */ 59 | public function __construct($data = NULL) { 60 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 61 | parent::__construct($data); 62 | } 63 | 64 | /** 65 | * Required. The resource for which to retrieve CMEK settings. 66 | * "projects/[PROJECT_ID]/cmekSettings" 67 | * "organizations/[ORGANIZATION_ID]/cmekSettings" 68 | * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" 69 | * "folders/[FOLDER_ID]/cmekSettings" 70 | * For example: 71 | * `"organizations/12345/cmekSettings"` 72 | * Note: CMEK for the Log Router can be configured for Google Cloud projects, 73 | * folders, organizations and billing accounts. Once configured for an 74 | * organization, it applies to all projects and folders in the Google Cloud 75 | * organization. 76 | * 77 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 78 | * @return string 79 | */ 80 | public function getName() 81 | { 82 | return $this->name; 83 | } 84 | 85 | /** 86 | * Required. The resource for which to retrieve CMEK settings. 87 | * "projects/[PROJECT_ID]/cmekSettings" 88 | * "organizations/[ORGANIZATION_ID]/cmekSettings" 89 | * "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings" 90 | * "folders/[FOLDER_ID]/cmekSettings" 91 | * For example: 92 | * `"organizations/12345/cmekSettings"` 93 | * Note: CMEK for the Log Router can be configured for Google Cloud projects, 94 | * folders, organizations and billing accounts. Once configured for an 95 | * organization, it applies to all projects and folders in the Google Cloud 96 | * organization. 97 | * 98 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 99 | * @param string $var 100 | * @return $this 101 | */ 102 | public function setName($var) 103 | { 104 | GPBUtil::checkString($var, True); 105 | $this->name = $var; 106 | 107 | return $this; 108 | } 109 | 110 | } 111 | 112 | -------------------------------------------------------------------------------- /src/V2/GetExclusionRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetExclusionRequest 15 | */ 16 | class GetExclusionRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of an existing exclusion: 20 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 21 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 23 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 24 | * For example: 25 | * `"projects/my-project/exclusions/my-exclusion"` 26 | * 27 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $name = ''; 30 | 31 | /** 32 | * @param string $name Required. The resource name of an existing exclusion: 33 | * 34 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 35 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 36 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 37 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 38 | * 39 | * For example: 40 | * 41 | * `"projects/my-project/exclusions/my-exclusion"` 42 | * Please see {@see ConfigServiceV2Client::logExclusionName()} for help formatting this field. 43 | * 44 | * @return \Google\Cloud\Logging\V2\GetExclusionRequest 45 | * 46 | * @experimental 47 | */ 48 | public static function build(string $name): self 49 | { 50 | return (new self()) 51 | ->setName($name); 52 | } 53 | 54 | /** 55 | * Constructor. 56 | * 57 | * @param array $data { 58 | * Optional. Data for populating the Message object. 59 | * 60 | * @type string $name 61 | * Required. The resource name of an existing exclusion: 62 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 63 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 64 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 65 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 66 | * For example: 67 | * `"projects/my-project/exclusions/my-exclusion"` 68 | * } 69 | */ 70 | public function __construct($data = NULL) { 71 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 72 | parent::__construct($data); 73 | } 74 | 75 | /** 76 | * Required. The resource name of an existing exclusion: 77 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 78 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 79 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 80 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 81 | * For example: 82 | * `"projects/my-project/exclusions/my-exclusion"` 83 | * 84 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 85 | * @return string 86 | */ 87 | public function getName() 88 | { 89 | return $this->name; 90 | } 91 | 92 | /** 93 | * Required. The resource name of an existing exclusion: 94 | * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" 95 | * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" 96 | * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" 97 | * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" 98 | * For example: 99 | * `"projects/my-project/exclusions/my-exclusion"` 100 | * 101 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 102 | * @param string $var 103 | * @return $this 104 | */ 105 | public function setName($var) 106 | { 107 | GPBUtil::checkString($var, True); 108 | $this->name = $var; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/V2/GetLinkRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetLinkRequest 15 | */ 16 | class GetLinkRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the link: 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 21 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 23 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] 24 | * 25 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 26 | */ 27 | private $name = ''; 28 | 29 | /** 30 | * @param string $name Required. The resource name of the link: 31 | * 32 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 33 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 34 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 35 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] 36 | * Please see {@see ConfigServiceV2Client::linkName()} for help formatting this field. 37 | * 38 | * @return \Google\Cloud\Logging\V2\GetLinkRequest 39 | * 40 | * @experimental 41 | */ 42 | public static function build(string $name): self 43 | { 44 | return (new self()) 45 | ->setName($name); 46 | } 47 | 48 | /** 49 | * Constructor. 50 | * 51 | * @param array $data { 52 | * Optional. Data for populating the Message object. 53 | * 54 | * @type string $name 55 | * Required. The resource name of the link: 56 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 57 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 58 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 59 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] 60 | * } 61 | */ 62 | public function __construct($data = NULL) { 63 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 64 | parent::__construct($data); 65 | } 66 | 67 | /** 68 | * Required. The resource name of the link: 69 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 70 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 71 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 72 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] 73 | * 74 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 75 | * @return string 76 | */ 77 | public function getName() 78 | { 79 | return $this->name; 80 | } 81 | 82 | /** 83 | * Required. The resource name of the link: 84 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 85 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 86 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" 87 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] 88 | * 89 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 90 | * @param string $var 91 | * @return $this 92 | */ 93 | public function setName($var) 94 | { 95 | GPBUtil::checkString($var, True); 96 | $this->name = $var; 97 | 98 | return $this; 99 | } 100 | 101 | } 102 | 103 | -------------------------------------------------------------------------------- /src/V2/GetLogMetricRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetLogMetricRequest 15 | */ 16 | class GetLogMetricRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the desired metric: 20 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 21 | * 22 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 23 | */ 24 | private $metric_name = ''; 25 | 26 | /** 27 | * @param string $metricName Required. The resource name of the desired metric: 28 | * 29 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 30 | * Please see {@see MetricsServiceV2Client::logMetricName()} for help formatting this field. 31 | * 32 | * @return \Google\Cloud\Logging\V2\GetLogMetricRequest 33 | * 34 | * @experimental 35 | */ 36 | public static function build(string $metricName): self 37 | { 38 | return (new self()) 39 | ->setMetricName($metricName); 40 | } 41 | 42 | /** 43 | * Constructor. 44 | * 45 | * @param array $data { 46 | * Optional. Data for populating the Message object. 47 | * 48 | * @type string $metric_name 49 | * Required. The resource name of the desired metric: 50 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 51 | * } 52 | */ 53 | public function __construct($data = NULL) { 54 | \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); 55 | parent::__construct($data); 56 | } 57 | 58 | /** 59 | * Required. The resource name of the desired metric: 60 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 61 | * 62 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 63 | * @return string 64 | */ 65 | public function getMetricName() 66 | { 67 | return $this->metric_name; 68 | } 69 | 70 | /** 71 | * Required. The resource name of the desired metric: 72 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 73 | * 74 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 75 | * @param string $var 76 | * @return $this 77 | */ 78 | public function setMetricName($var) 79 | { 80 | GPBUtil::checkString($var, True); 81 | $this->metric_name = $var; 82 | 83 | return $this; 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/V2/GetSettingsRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetSettingsRequest 19 | */ 20 | class GetSettingsRequest extends \Google\Protobuf\Internal\Message 21 | { 22 | /** 23 | * Required. The resource for which to retrieve settings. 24 | * "projects/[PROJECT_ID]/settings" 25 | * "organizations/[ORGANIZATION_ID]/settings" 26 | * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" 27 | * "folders/[FOLDER_ID]/settings" 28 | * For example: 29 | * `"organizations/12345/settings"` 30 | * Note: Settings for the Log Router can be get for Google Cloud projects, 31 | * folders, organizations and billing accounts. Currently it can only be 32 | * configured for organizations. Once configured for an organization, it 33 | * applies to all projects and folders in the Google Cloud organization. 34 | * 35 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 36 | */ 37 | private $name = ''; 38 | 39 | /** 40 | * @param string $name Required. The resource for which to retrieve settings. 41 | * 42 | * "projects/[PROJECT_ID]/settings" 43 | * "organizations/[ORGANIZATION_ID]/settings" 44 | * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" 45 | * "folders/[FOLDER_ID]/settings" 46 | * 47 | * For example: 48 | * 49 | * `"organizations/12345/settings"` 50 | * 51 | * Note: Settings for the Log Router can be get for Google Cloud projects, 52 | * folders, organizations and billing accounts. Currently it can only be 53 | * configured for organizations. Once configured for an organization, it 54 | * applies to all projects and folders in the Google Cloud organization. Please see 55 | * {@see ConfigServiceV2Client::settingsName()} for help formatting this field. 56 | * 57 | * @return \Google\Cloud\Logging\V2\GetSettingsRequest 58 | * 59 | * @experimental 60 | */ 61 | public static function build(string $name): self 62 | { 63 | return (new self()) 64 | ->setName($name); 65 | } 66 | 67 | /** 68 | * Constructor. 69 | * 70 | * @param array $data { 71 | * Optional. Data for populating the Message object. 72 | * 73 | * @type string $name 74 | * Required. The resource for which to retrieve settings. 75 | * "projects/[PROJECT_ID]/settings" 76 | * "organizations/[ORGANIZATION_ID]/settings" 77 | * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" 78 | * "folders/[FOLDER_ID]/settings" 79 | * For example: 80 | * `"organizations/12345/settings"` 81 | * Note: Settings for the Log Router can be get for Google Cloud projects, 82 | * folders, organizations and billing accounts. Currently it can only be 83 | * configured for organizations. Once configured for an organization, it 84 | * applies to all projects and folders in the Google Cloud organization. 85 | * } 86 | */ 87 | public function __construct($data = NULL) { 88 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 89 | parent::__construct($data); 90 | } 91 | 92 | /** 93 | * Required. The resource for which to retrieve settings. 94 | * "projects/[PROJECT_ID]/settings" 95 | * "organizations/[ORGANIZATION_ID]/settings" 96 | * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" 97 | * "folders/[FOLDER_ID]/settings" 98 | * For example: 99 | * `"organizations/12345/settings"` 100 | * Note: Settings for the Log Router can be get for Google Cloud projects, 101 | * folders, organizations and billing accounts. Currently it can only be 102 | * configured for organizations. Once configured for an organization, it 103 | * applies to all projects and folders in the Google Cloud organization. 104 | * 105 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 106 | * @return string 107 | */ 108 | public function getName() 109 | { 110 | return $this->name; 111 | } 112 | 113 | /** 114 | * Required. The resource for which to retrieve settings. 115 | * "projects/[PROJECT_ID]/settings" 116 | * "organizations/[ORGANIZATION_ID]/settings" 117 | * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" 118 | * "folders/[FOLDER_ID]/settings" 119 | * For example: 120 | * `"organizations/12345/settings"` 121 | * Note: Settings for the Log Router can be get for Google Cloud projects, 122 | * folders, organizations and billing accounts. Currently it can only be 123 | * configured for organizations. Once configured for an organization, it 124 | * applies to all projects and folders in the Google Cloud organization. 125 | * 126 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 127 | * @param string $var 128 | * @return $this 129 | */ 130 | public function setName($var) 131 | { 132 | GPBUtil::checkString($var, True); 133 | $this->name = $var; 134 | 135 | return $this; 136 | } 137 | 138 | } 139 | 140 | -------------------------------------------------------------------------------- /src/V2/GetSinkRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetSinkRequest 15 | */ 16 | class GetSinkRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the sink: 20 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 21 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 23 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 24 | * For example: 25 | * `"projects/my-project/sinks/my-sink"` 26 | * 27 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $sink_name = ''; 30 | 31 | /** 32 | * @param string $sinkName Required. The resource name of the sink: 33 | * 34 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 35 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 36 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 37 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 38 | * 39 | * For example: 40 | * 41 | * `"projects/my-project/sinks/my-sink"` 42 | * Please see {@see ConfigServiceV2Client::logSinkName()} for help formatting this field. 43 | * 44 | * @return \Google\Cloud\Logging\V2\GetSinkRequest 45 | * 46 | * @experimental 47 | */ 48 | public static function build(string $sinkName): self 49 | { 50 | return (new self()) 51 | ->setSinkName($sinkName); 52 | } 53 | 54 | /** 55 | * Constructor. 56 | * 57 | * @param array $data { 58 | * Optional. Data for populating the Message object. 59 | * 60 | * @type string $sink_name 61 | * Required. The resource name of the sink: 62 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 63 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 64 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 65 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 66 | * For example: 67 | * `"projects/my-project/sinks/my-sink"` 68 | * } 69 | */ 70 | public function __construct($data = NULL) { 71 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 72 | parent::__construct($data); 73 | } 74 | 75 | /** 76 | * Required. The resource name of the sink: 77 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 78 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 79 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 80 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 81 | * For example: 82 | * `"projects/my-project/sinks/my-sink"` 83 | * 84 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 85 | * @return string 86 | */ 87 | public function getSinkName() 88 | { 89 | return $this->sink_name; 90 | } 91 | 92 | /** 93 | * Required. The resource name of the sink: 94 | * "projects/[PROJECT_ID]/sinks/[SINK_ID]" 95 | * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" 96 | * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" 97 | * "folders/[FOLDER_ID]/sinks/[SINK_ID]" 98 | * For example: 99 | * `"projects/my-project/sinks/my-sink"` 100 | * 101 | * Generated from protobuf field string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 102 | * @param string $var 103 | * @return $this 104 | */ 105 | public function setSinkName($var) 106 | { 107 | GPBUtil::checkString($var, True); 108 | $this->sink_name = $var; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/V2/GetViewRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.GetViewRequest 15 | */ 16 | class GetViewRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the policy: 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 21 | * For example: 22 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 23 | * 24 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 25 | */ 26 | private $name = ''; 27 | 28 | /** 29 | * Constructor. 30 | * 31 | * @param array $data { 32 | * Optional. Data for populating the Message object. 33 | * 34 | * @type string $name 35 | * Required. The resource name of the policy: 36 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 37 | * For example: 38 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * Required. The resource name of the policy: 48 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 49 | * For example: 50 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 51 | * 52 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 53 | * @return string 54 | */ 55 | public function getName() 56 | { 57 | return $this->name; 58 | } 59 | 60 | /** 61 | * Required. The resource name of the policy: 62 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" 63 | * For example: 64 | * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` 65 | * 66 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 67 | * @param string $var 68 | * @return $this 69 | */ 70 | public function setName($var) 71 | { 72 | GPBUtil::checkString($var, True); 73 | $this->name = $var; 74 | 75 | return $this; 76 | } 77 | 78 | } 79 | 80 | -------------------------------------------------------------------------------- /src/V2/IndexType.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.IndexType 14 | */ 15 | class IndexType 16 | { 17 | /** 18 | * The index's type is unspecified. 19 | * 20 | * Generated from protobuf enum INDEX_TYPE_UNSPECIFIED = 0; 21 | */ 22 | const INDEX_TYPE_UNSPECIFIED = 0; 23 | /** 24 | * The index is a string-type index. 25 | * 26 | * Generated from protobuf enum INDEX_TYPE_STRING = 1; 27 | */ 28 | const INDEX_TYPE_STRING = 1; 29 | /** 30 | * The index is a integer-type index. 31 | * 32 | * Generated from protobuf enum INDEX_TYPE_INTEGER = 2; 33 | */ 34 | const INDEX_TYPE_INTEGER = 2; 35 | 36 | private static $valueToName = [ 37 | self::INDEX_TYPE_UNSPECIFIED => 'INDEX_TYPE_UNSPECIFIED', 38 | self::INDEX_TYPE_STRING => 'INDEX_TYPE_STRING', 39 | self::INDEX_TYPE_INTEGER => 'INDEX_TYPE_INTEGER', 40 | ]; 41 | 42 | public static function name($value) 43 | { 44 | if (!isset(self::$valueToName[$value])) { 45 | throw new UnexpectedValueException(sprintf( 46 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 47 | } 48 | return self::$valueToName[$value]; 49 | } 50 | 51 | 52 | public static function value($name) 53 | { 54 | $const = __CLASS__ . '::' . strtoupper($name); 55 | if (!defined($const)) { 56 | throw new UnexpectedValueException(sprintf( 57 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 58 | } 59 | return constant($const); 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /src/V2/LifecycleState.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.LifecycleState 13 | */ 14 | class LifecycleState 15 | { 16 | /** 17 | * Unspecified state. This is only used/useful for distinguishing unset 18 | * values. 19 | * 20 | * Generated from protobuf enum LIFECYCLE_STATE_UNSPECIFIED = 0; 21 | */ 22 | const LIFECYCLE_STATE_UNSPECIFIED = 0; 23 | /** 24 | * The normal and active state. 25 | * 26 | * Generated from protobuf enum ACTIVE = 1; 27 | */ 28 | const ACTIVE = 1; 29 | /** 30 | * The resource has been marked for deletion by the user. For some resources 31 | * (e.g. buckets), this can be reversed by an un-delete operation. 32 | * 33 | * Generated from protobuf enum DELETE_REQUESTED = 2; 34 | */ 35 | const DELETE_REQUESTED = 2; 36 | /** 37 | * The resource has been marked for an update by the user. It will remain in 38 | * this state until the update is complete. 39 | * 40 | * Generated from protobuf enum UPDATING = 3; 41 | */ 42 | const UPDATING = 3; 43 | /** 44 | * The resource has been marked for creation by the user. It will remain in 45 | * this state until the creation is complete. 46 | * 47 | * Generated from protobuf enum CREATING = 4; 48 | */ 49 | const CREATING = 4; 50 | /** 51 | * The resource is in an INTERNAL error state. 52 | * 53 | * Generated from protobuf enum FAILED = 5; 54 | */ 55 | const FAILED = 5; 56 | 57 | private static $valueToName = [ 58 | self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED', 59 | self::ACTIVE => 'ACTIVE', 60 | self::DELETE_REQUESTED => 'DELETE_REQUESTED', 61 | self::UPDATING => 'UPDATING', 62 | self::CREATING => 'CREATING', 63 | self::FAILED => 'FAILED', 64 | ]; 65 | 66 | public static function name($value) 67 | { 68 | if (!isset(self::$valueToName[$value])) { 69 | throw new UnexpectedValueException(sprintf( 70 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 71 | } 72 | return self::$valueToName[$value]; 73 | } 74 | 75 | 76 | public static function value($name) 77 | { 78 | $const = __CLASS__ . '::' . strtoupper($name); 79 | if (!defined($const)) { 80 | throw new UnexpectedValueException(sprintf( 81 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 82 | } 83 | return constant($const); 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src/V2/ListBucketsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListBucketsResponse 15 | */ 16 | class ListBucketsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of buckets. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; 22 | */ 23 | private $buckets; 24 | /** 25 | * If there might be more results than appear in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call the same 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $buckets 40 | * A list of buckets. 41 | * @type string $next_page_token 42 | * If there might be more results than appear in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call the same 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of buckets. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getBuckets() 59 | { 60 | return $this->buckets; 61 | } 62 | 63 | /** 64 | * A list of buckets. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.LogBucket buckets = 1; 67 | * @param array<\Google\Cloud\Logging\V2\LogBucket>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setBuckets($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogBucket::class); 73 | $this->buckets = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than appear in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call the same 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than appear in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call the same 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListExclusionsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListExclusionsResponse 15 | */ 16 | class ListExclusionsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of exclusions. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; 22 | */ 23 | private $exclusions; 24 | /** 25 | * If there might be more results than appear in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call the same 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $exclusions 40 | * A list of exclusions. 41 | * @type string $next_page_token 42 | * If there might be more results than appear in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call the same 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of exclusions. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getExclusions() 59 | { 60 | return $this->exclusions; 61 | } 62 | 63 | /** 64 | * A list of exclusions. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.LogExclusion exclusions = 1; 67 | * @param array<\Google\Cloud\Logging\V2\LogExclusion>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setExclusions($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogExclusion::class); 73 | $this->exclusions = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than appear in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call the same 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than appear in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call the same 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListLinksResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListLinksResponse 15 | */ 16 | class ListLinksResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of links. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.Link links = 1; 22 | */ 23 | private $links; 24 | /** 25 | * If there might be more results than those appearing in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call the same 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\Link>|\Google\Protobuf\Internal\RepeatedField $links 40 | * A list of links. 41 | * @type string $next_page_token 42 | * If there might be more results than those appearing in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call the same 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of links. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.Link links = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getLinks() 59 | { 60 | return $this->links; 61 | } 62 | 63 | /** 64 | * A list of links. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.Link links = 1; 67 | * @param array<\Google\Cloud\Logging\V2\Link>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setLinks($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\Link::class); 73 | $this->links = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than those appearing in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call the same 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than those appearing in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call the same 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListLogMetricsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListLogMetricsResponse 15 | */ 16 | class ListLogMetricsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of logs-based metrics. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; 22 | */ 23 | private $metrics; 24 | /** 25 | * If there might be more results than appear in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call this 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $metrics 40 | * A list of logs-based metrics. 41 | * @type string $next_page_token 42 | * If there might be more results than appear in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call this 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of logs-based metrics. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getMetrics() 59 | { 60 | return $this->metrics; 61 | } 62 | 63 | /** 64 | * A list of logs-based metrics. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.LogMetric metrics = 1; 67 | * @param array<\Google\Cloud\Logging\V2\LogMetric>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setMetrics($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogMetric::class); 73 | $this->metrics = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than appear in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call this 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than appear in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call this 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListLogsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListLogsResponse 15 | */ 16 | class ListLogsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of log names. For example, 20 | * `"projects/my-project/logs/syslog"` or 21 | * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. 22 | * 23 | * Generated from protobuf field repeated string log_names = 3; 24 | */ 25 | private $log_names; 26 | /** 27 | * If there might be more results than those appearing in this response, then 28 | * `nextPageToken` is included. To get the next set of results, call this 29 | * method again using the value of `nextPageToken` as `pageToken`. 30 | * 31 | * Generated from protobuf field string next_page_token = 2; 32 | */ 33 | private $next_page_token = ''; 34 | 35 | /** 36 | * Constructor. 37 | * 38 | * @param array $data { 39 | * Optional. Data for populating the Message object. 40 | * 41 | * @type array|\Google\Protobuf\Internal\RepeatedField $log_names 42 | * A list of log names. For example, 43 | * `"projects/my-project/logs/syslog"` or 44 | * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. 45 | * @type string $next_page_token 46 | * If there might be more results than those appearing in this response, then 47 | * `nextPageToken` is included. To get the next set of results, call this 48 | * method again using the value of `nextPageToken` as `pageToken`. 49 | * } 50 | */ 51 | public function __construct($data = NULL) { 52 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 53 | parent::__construct($data); 54 | } 55 | 56 | /** 57 | * A list of log names. For example, 58 | * `"projects/my-project/logs/syslog"` or 59 | * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. 60 | * 61 | * Generated from protobuf field repeated string log_names = 3; 62 | * @return \Google\Protobuf\Internal\RepeatedField 63 | */ 64 | public function getLogNames() 65 | { 66 | return $this->log_names; 67 | } 68 | 69 | /** 70 | * A list of log names. For example, 71 | * `"projects/my-project/logs/syslog"` or 72 | * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. 73 | * 74 | * Generated from protobuf field repeated string log_names = 3; 75 | * @param array|\Google\Protobuf\Internal\RepeatedField $var 76 | * @return $this 77 | */ 78 | public function setLogNames($var) 79 | { 80 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 81 | $this->log_names = $arr; 82 | 83 | return $this; 84 | } 85 | 86 | /** 87 | * If there might be more results than those appearing in this response, then 88 | * `nextPageToken` is included. To get the next set of results, call this 89 | * method again using the value of `nextPageToken` as `pageToken`. 90 | * 91 | * Generated from protobuf field string next_page_token = 2; 92 | * @return string 93 | */ 94 | public function getNextPageToken() 95 | { 96 | return $this->next_page_token; 97 | } 98 | 99 | /** 100 | * If there might be more results than those appearing in this response, then 101 | * `nextPageToken` is included. To get the next set of results, call this 102 | * method again using the value of `nextPageToken` as `pageToken`. 103 | * 104 | * Generated from protobuf field string next_page_token = 2; 105 | * @param string $var 106 | * @return $this 107 | */ 108 | public function setNextPageToken($var) 109 | { 110 | GPBUtil::checkString($var, True); 111 | $this->next_page_token = $var; 112 | 113 | return $this; 114 | } 115 | 116 | } 117 | 118 | -------------------------------------------------------------------------------- /src/V2/ListMonitoredResourceDescriptorsRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListMonitoredResourceDescriptorsRequest 15 | */ 16 | class ListMonitoredResourceDescriptorsRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Optional. The maximum number of results to return from this request. 20 | * Non-positive values are ignored. The presence of `nextPageToken` in the 21 | * response indicates that more results might be available. 22 | * 23 | * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 24 | */ 25 | private $page_size = 0; 26 | /** 27 | * Optional. If present, then retrieve the next batch of results from the 28 | * preceding call to this method. `pageToken` must be the value of 29 | * `nextPageToken` from the previous response. The values of other method 30 | * parameters should be identical to those in the previous call. 31 | * 32 | * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; 33 | */ 34 | private $page_token = ''; 35 | 36 | /** 37 | * Constructor. 38 | * 39 | * @param array $data { 40 | * Optional. Data for populating the Message object. 41 | * 42 | * @type int $page_size 43 | * Optional. The maximum number of results to return from this request. 44 | * Non-positive values are ignored. The presence of `nextPageToken` in the 45 | * response indicates that more results might be available. 46 | * @type string $page_token 47 | * Optional. If present, then retrieve the next batch of results from the 48 | * preceding call to this method. `pageToken` must be the value of 49 | * `nextPageToken` from the previous response. The values of other method 50 | * parameters should be identical to those in the previous call. 51 | * } 52 | */ 53 | public function __construct($data = NULL) { 54 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 55 | parent::__construct($data); 56 | } 57 | 58 | /** 59 | * Optional. The maximum number of results to return from this request. 60 | * Non-positive values are ignored. The presence of `nextPageToken` in the 61 | * response indicates that more results might be available. 62 | * 63 | * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 64 | * @return int 65 | */ 66 | public function getPageSize() 67 | { 68 | return $this->page_size; 69 | } 70 | 71 | /** 72 | * Optional. The maximum number of results to return from this request. 73 | * Non-positive values are ignored. The presence of `nextPageToken` in the 74 | * response indicates that more results might be available. 75 | * 76 | * Generated from protobuf field int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; 77 | * @param int $var 78 | * @return $this 79 | */ 80 | public function setPageSize($var) 81 | { 82 | GPBUtil::checkInt32($var); 83 | $this->page_size = $var; 84 | 85 | return $this; 86 | } 87 | 88 | /** 89 | * Optional. If present, then retrieve the next batch of results from the 90 | * preceding call to this method. `pageToken` must be the value of 91 | * `nextPageToken` from the previous response. The values of other method 92 | * parameters should be identical to those in the previous call. 93 | * 94 | * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; 95 | * @return string 96 | */ 97 | public function getPageToken() 98 | { 99 | return $this->page_token; 100 | } 101 | 102 | /** 103 | * Optional. If present, then retrieve the next batch of results from the 104 | * preceding call to this method. `pageToken` must be the value of 105 | * `nextPageToken` from the previous response. The values of other method 106 | * parameters should be identical to those in the previous call. 107 | * 108 | * Generated from protobuf field string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; 109 | * @param string $var 110 | * @return $this 111 | */ 112 | public function setPageToken($var) 113 | { 114 | GPBUtil::checkString($var, True); 115 | $this->page_token = $var; 116 | 117 | return $this; 118 | } 119 | 120 | } 121 | 122 | -------------------------------------------------------------------------------- /src/V2/ListMonitoredResourceDescriptorsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListMonitoredResourceDescriptorsResponse 15 | */ 16 | class ListMonitoredResourceDescriptorsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of resource descriptors. 20 | * 21 | * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; 22 | */ 23 | private $resource_descriptors; 24 | /** 25 | * If there might be more results than those appearing in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call this 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $resource_descriptors 40 | * A list of resource descriptors. 41 | * @type string $next_page_token 42 | * If there might be more results than those appearing in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call this 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of resource descriptors. 54 | * 55 | * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getResourceDescriptors() 59 | { 60 | return $this->resource_descriptors; 61 | } 62 | 63 | /** 64 | * A list of resource descriptors. 65 | * 66 | * Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; 67 | * @param array<\Google\Api\MonitoredResourceDescriptor>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setResourceDescriptors($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Api\MonitoredResourceDescriptor::class); 73 | $this->resource_descriptors = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than those appearing in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call this 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than those appearing in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call this 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListSinksResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListSinksResponse 15 | */ 16 | class ListSinksResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of sinks. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; 22 | */ 23 | private $sinks; 24 | /** 25 | * If there might be more results than appear in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call the same 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $sinks 40 | * A list of sinks. 41 | * @type string $next_page_token 42 | * If there might be more results than appear in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call the same 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of sinks. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getSinks() 59 | { 60 | return $this->sinks; 61 | } 62 | 63 | /** 64 | * A list of sinks. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.LogSink sinks = 1; 67 | * @param array<\Google\Cloud\Logging\V2\LogSink>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setSinks($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogSink::class); 73 | $this->sinks = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than appear in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call the same 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than appear in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call the same 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/ListViewsResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.ListViewsResponse 15 | */ 16 | class ListViewsResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of views. 20 | * 21 | * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; 22 | */ 23 | private $views; 24 | /** 25 | * If there might be more results than appear in this response, then 26 | * `nextPageToken` is included. To get the next set of results, call the same 27 | * method again using the value of `nextPageToken` as `pageToken`. 28 | * 29 | * Generated from protobuf field string next_page_token = 2; 30 | */ 31 | private $next_page_token = ''; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type array<\Google\Cloud\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $views 40 | * A list of views. 41 | * @type string $next_page_token 42 | * If there might be more results than appear in this response, then 43 | * `nextPageToken` is included. To get the next set of results, call the same 44 | * method again using the value of `nextPageToken` as `pageToken`. 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * A list of views. 54 | * 55 | * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; 56 | * @return \Google\Protobuf\Internal\RepeatedField 57 | */ 58 | public function getViews() 59 | { 60 | return $this->views; 61 | } 62 | 63 | /** 64 | * A list of views. 65 | * 66 | * Generated from protobuf field repeated .google.logging.v2.LogView views = 1; 67 | * @param array<\Google\Cloud\Logging\V2\LogView>|\Google\Protobuf\Internal\RepeatedField $var 68 | * @return $this 69 | */ 70 | public function setViews($var) 71 | { 72 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogView::class); 73 | $this->views = $arr; 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * If there might be more results than appear in this response, then 80 | * `nextPageToken` is included. To get the next set of results, call the same 81 | * method again using the value of `nextPageToken` as `pageToken`. 82 | * 83 | * Generated from protobuf field string next_page_token = 2; 84 | * @return string 85 | */ 86 | public function getNextPageToken() 87 | { 88 | return $this->next_page_token; 89 | } 90 | 91 | /** 92 | * If there might be more results than appear in this response, then 93 | * `nextPageToken` is included. To get the next set of results, call the same 94 | * method again using the value of `nextPageToken` as `pageToken`. 95 | * 96 | * Generated from protobuf field string next_page_token = 2; 97 | * @param string $var 98 | * @return $this 99 | */ 100 | public function setNextPageToken($var) 101 | { 102 | GPBUtil::checkString($var, True); 103 | $this->next_page_token = $var; 104 | 105 | return $this; 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/V2/LocationMetadata.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.LocationMetadata 15 | */ 16 | class LocationMetadata extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Indicates whether or not Log Analytics features are supported in the given 20 | * location. 21 | * 22 | * Generated from protobuf field bool log_analytics_enabled = 1; 23 | */ 24 | private $log_analytics_enabled = false; 25 | 26 | /** 27 | * Constructor. 28 | * 29 | * @param array $data { 30 | * Optional. Data for populating the Message object. 31 | * 32 | * @type bool $log_analytics_enabled 33 | * Indicates whether or not Log Analytics features are supported in the given 34 | * location. 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Indicates whether or not Log Analytics features are supported in the given 44 | * location. 45 | * 46 | * Generated from protobuf field bool log_analytics_enabled = 1; 47 | * @return bool 48 | */ 49 | public function getLogAnalyticsEnabled() 50 | { 51 | return $this->log_analytics_enabled; 52 | } 53 | 54 | /** 55 | * Indicates whether or not Log Analytics features are supported in the given 56 | * location. 57 | * 58 | * Generated from protobuf field bool log_analytics_enabled = 1; 59 | * @param bool $var 60 | * @return $this 61 | */ 62 | public function setLogAnalyticsEnabled($var) 63 | { 64 | GPBUtil::checkBool($var); 65 | $this->log_analytics_enabled = $var; 66 | 67 | return $this; 68 | } 69 | 70 | } 71 | 72 | -------------------------------------------------------------------------------- /src/V2/LogMetric/ApiVersion.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.LogMetric.ApiVersion 13 | */ 14 | class ApiVersion 15 | { 16 | /** 17 | * Logging API v2. 18 | * 19 | * Generated from protobuf enum V2 = 0; 20 | */ 21 | const V2 = 0; 22 | /** 23 | * Logging API v1. 24 | * 25 | * Generated from protobuf enum V1 = 1; 26 | */ 27 | const V1 = 1; 28 | 29 | private static $valueToName = [ 30 | self::V2 => 'V2', 31 | self::V1 => 'V1', 32 | ]; 33 | 34 | public static function name($value) 35 | { 36 | if (!isset(self::$valueToName[$value])) { 37 | throw new UnexpectedValueException(sprintf( 38 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 39 | } 40 | return self::$valueToName[$value]; 41 | } 42 | 43 | 44 | public static function value($name) 45 | { 46 | $const = __CLASS__ . '::' . strtoupper($name); 47 | if (!defined($const)) { 48 | throw new UnexpectedValueException(sprintf( 49 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 50 | } 51 | return constant($const); 52 | } 53 | } 54 | 55 | // Adding a class alias for backwards compatibility with the previous class name. 56 | class_alias(ApiVersion::class, \Google\Cloud\Logging\V2\LogMetric_ApiVersion::class); 57 | 58 | -------------------------------------------------------------------------------- /src/V2/LogMetric_ApiVersion.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.LogSink.VersionFormat 13 | */ 14 | class VersionFormat 15 | { 16 | /** 17 | * An unspecified format version that will default to V2. 18 | * 19 | * Generated from protobuf enum VERSION_FORMAT_UNSPECIFIED = 0; 20 | */ 21 | const VERSION_FORMAT_UNSPECIFIED = 0; 22 | /** 23 | * `LogEntry` version 2 format. 24 | * 25 | * Generated from protobuf enum V2 = 1; 26 | */ 27 | const V2 = 1; 28 | /** 29 | * `LogEntry` version 1 format. 30 | * 31 | * Generated from protobuf enum V1 = 2; 32 | */ 33 | const V1 = 2; 34 | 35 | private static $valueToName = [ 36 | self::VERSION_FORMAT_UNSPECIFIED => 'VERSION_FORMAT_UNSPECIFIED', 37 | self::V2 => 'V2', 38 | self::V1 => 'V1', 39 | ]; 40 | 41 | public static function name($value) 42 | { 43 | if (!isset(self::$valueToName[$value])) { 44 | throw new UnexpectedValueException(sprintf( 45 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 46 | } 47 | return self::$valueToName[$value]; 48 | } 49 | 50 | 51 | public static function value($name) 52 | { 53 | $const = __CLASS__ . '::' . strtoupper($name); 54 | if (!defined($const)) { 55 | throw new UnexpectedValueException(sprintf( 56 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 57 | } 58 | return constant($const); 59 | } 60 | } 61 | 62 | // Adding a class alias for backwards compatibility with the previous class name. 63 | class_alias(VersionFormat::class, \Google\Cloud\Logging\V2\LogSink_VersionFormat::class); 64 | 65 | -------------------------------------------------------------------------------- /src/V2/LogSink_VersionFormat.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.LogSplit 17 | */ 18 | class LogSplit extends \Google\Protobuf\Internal\Message 19 | { 20 | /** 21 | * A globally unique identifier for all log entries in a sequence of split log 22 | * entries. All log entries with the same |LogSplit.uid| are assumed to be 23 | * part of the same sequence of split log entries. 24 | * 25 | * Generated from protobuf field string uid = 1; 26 | */ 27 | private $uid = ''; 28 | /** 29 | * The index of this LogEntry in the sequence of split log entries. Log 30 | * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log 31 | * entries. 32 | * 33 | * Generated from protobuf field int32 index = 2; 34 | */ 35 | private $index = 0; 36 | /** 37 | * The total number of log entries that the original LogEntry was split into. 38 | * 39 | * Generated from protobuf field int32 total_splits = 3; 40 | */ 41 | private $total_splits = 0; 42 | 43 | /** 44 | * Constructor. 45 | * 46 | * @param array $data { 47 | * Optional. Data for populating the Message object. 48 | * 49 | * @type string $uid 50 | * A globally unique identifier for all log entries in a sequence of split log 51 | * entries. All log entries with the same |LogSplit.uid| are assumed to be 52 | * part of the same sequence of split log entries. 53 | * @type int $index 54 | * The index of this LogEntry in the sequence of split log entries. Log 55 | * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log 56 | * entries. 57 | * @type int $total_splits 58 | * The total number of log entries that the original LogEntry was split into. 59 | * } 60 | */ 61 | public function __construct($data = NULL) { 62 | \GPBMetadata\Google\Logging\V2\LogEntry::initOnce(); 63 | parent::__construct($data); 64 | } 65 | 66 | /** 67 | * A globally unique identifier for all log entries in a sequence of split log 68 | * entries. All log entries with the same |LogSplit.uid| are assumed to be 69 | * part of the same sequence of split log entries. 70 | * 71 | * Generated from protobuf field string uid = 1; 72 | * @return string 73 | */ 74 | public function getUid() 75 | { 76 | return $this->uid; 77 | } 78 | 79 | /** 80 | * A globally unique identifier for all log entries in a sequence of split log 81 | * entries. All log entries with the same |LogSplit.uid| are assumed to be 82 | * part of the same sequence of split log entries. 83 | * 84 | * Generated from protobuf field string uid = 1; 85 | * @param string $var 86 | * @return $this 87 | */ 88 | public function setUid($var) 89 | { 90 | GPBUtil::checkString($var, True); 91 | $this->uid = $var; 92 | 93 | return $this; 94 | } 95 | 96 | /** 97 | * The index of this LogEntry in the sequence of split log entries. Log 98 | * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log 99 | * entries. 100 | * 101 | * Generated from protobuf field int32 index = 2; 102 | * @return int 103 | */ 104 | public function getIndex() 105 | { 106 | return $this->index; 107 | } 108 | 109 | /** 110 | * The index of this LogEntry in the sequence of split log entries. Log 111 | * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log 112 | * entries. 113 | * 114 | * Generated from protobuf field int32 index = 2; 115 | * @param int $var 116 | * @return $this 117 | */ 118 | public function setIndex($var) 119 | { 120 | GPBUtil::checkInt32($var); 121 | $this->index = $var; 122 | 123 | return $this; 124 | } 125 | 126 | /** 127 | * The total number of log entries that the original LogEntry was split into. 128 | * 129 | * Generated from protobuf field int32 total_splits = 3; 130 | * @return int 131 | */ 132 | public function getTotalSplits() 133 | { 134 | return $this->total_splits; 135 | } 136 | 137 | /** 138 | * The total number of log entries that the original LogEntry was split into. 139 | * 140 | * Generated from protobuf field int32 total_splits = 3; 141 | * @param int $var 142 | * @return $this 143 | */ 144 | public function setTotalSplits($var) 145 | { 146 | GPBUtil::checkInt32($var); 147 | $this->total_splits = $var; 148 | 149 | return $this; 150 | } 151 | 152 | } 153 | 154 | -------------------------------------------------------------------------------- /src/V2/LoggingServiceV2Client.php: -------------------------------------------------------------------------------- 1 | _simpleRequest('/google.logging.v2.MetricsServiceV2/ListLogMetrics', 45 | $argument, 46 | ['\Google\Cloud\Logging\V2\ListLogMetricsResponse', 'decode'], 47 | $metadata, $options); 48 | } 49 | 50 | /** 51 | * Gets a logs-based metric. 52 | * @param \Google\Cloud\Logging\V2\GetLogMetricRequest $argument input argument 53 | * @param array $metadata metadata 54 | * @param array $options call options 55 | * @return \Grpc\UnaryCall 56 | */ 57 | public function GetLogMetric(\Google\Cloud\Logging\V2\GetLogMetricRequest $argument, 58 | $metadata = [], $options = []) { 59 | return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/GetLogMetric', 60 | $argument, 61 | ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], 62 | $metadata, $options); 63 | } 64 | 65 | /** 66 | * Creates a logs-based metric. 67 | * @param \Google\Cloud\Logging\V2\CreateLogMetricRequest $argument input argument 68 | * @param array $metadata metadata 69 | * @param array $options call options 70 | * @return \Grpc\UnaryCall 71 | */ 72 | public function CreateLogMetric(\Google\Cloud\Logging\V2\CreateLogMetricRequest $argument, 73 | $metadata = [], $options = []) { 74 | return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/CreateLogMetric', 75 | $argument, 76 | ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], 77 | $metadata, $options); 78 | } 79 | 80 | /** 81 | * Creates or updates a logs-based metric. 82 | * @param \Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument input argument 83 | * @param array $metadata metadata 84 | * @param array $options call options 85 | * @return \Grpc\UnaryCall 86 | */ 87 | public function UpdateLogMetric(\Google\Cloud\Logging\V2\UpdateLogMetricRequest $argument, 88 | $metadata = [], $options = []) { 89 | return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/UpdateLogMetric', 90 | $argument, 91 | ['\Google\Cloud\Logging\V2\LogMetric', 'decode'], 92 | $metadata, $options); 93 | } 94 | 95 | /** 96 | * Deletes a logs-based metric. 97 | * @param \Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument input argument 98 | * @param array $metadata metadata 99 | * @param array $options call options 100 | * @return \Grpc\UnaryCall 101 | */ 102 | public function DeleteLogMetric(\Google\Cloud\Logging\V2\DeleteLogMetricRequest $argument, 103 | $metadata = [], $options = []) { 104 | return $this->_simpleRequest('/google.logging.v2.MetricsServiceV2/DeleteLogMetric', 105 | $argument, 106 | ['\Google\Protobuf\GPBEmpty', 'decode'], 107 | $metadata, $options); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/V2/OperationState.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.OperationState 17 | */ 18 | class OperationState 19 | { 20 | /** 21 | * Should not be used. 22 | * 23 | * Generated from protobuf enum OPERATION_STATE_UNSPECIFIED = 0; 24 | */ 25 | const OPERATION_STATE_UNSPECIFIED = 0; 26 | /** 27 | * The operation is scheduled. 28 | * 29 | * Generated from protobuf enum OPERATION_STATE_SCHEDULED = 1; 30 | */ 31 | const OPERATION_STATE_SCHEDULED = 1; 32 | /** 33 | * Waiting for necessary permissions. 34 | * 35 | * Generated from protobuf enum OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; 36 | */ 37 | const OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; 38 | /** 39 | * The operation is running. 40 | * 41 | * Generated from protobuf enum OPERATION_STATE_RUNNING = 3; 42 | */ 43 | const OPERATION_STATE_RUNNING = 3; 44 | /** 45 | * The operation was completed successfully. 46 | * 47 | * Generated from protobuf enum OPERATION_STATE_SUCCEEDED = 4; 48 | */ 49 | const OPERATION_STATE_SUCCEEDED = 4; 50 | /** 51 | * The operation failed. 52 | * 53 | * Generated from protobuf enum OPERATION_STATE_FAILED = 5; 54 | */ 55 | const OPERATION_STATE_FAILED = 5; 56 | /** 57 | * The operation was cancelled by the user. 58 | * 59 | * Generated from protobuf enum OPERATION_STATE_CANCELLED = 6; 60 | */ 61 | const OPERATION_STATE_CANCELLED = 6; 62 | 63 | private static $valueToName = [ 64 | self::OPERATION_STATE_UNSPECIFIED => 'OPERATION_STATE_UNSPECIFIED', 65 | self::OPERATION_STATE_SCHEDULED => 'OPERATION_STATE_SCHEDULED', 66 | self::OPERATION_STATE_WAITING_FOR_PERMISSIONS => 'OPERATION_STATE_WAITING_FOR_PERMISSIONS', 67 | self::OPERATION_STATE_RUNNING => 'OPERATION_STATE_RUNNING', 68 | self::OPERATION_STATE_SUCCEEDED => 'OPERATION_STATE_SUCCEEDED', 69 | self::OPERATION_STATE_FAILED => 'OPERATION_STATE_FAILED', 70 | self::OPERATION_STATE_CANCELLED => 'OPERATION_STATE_CANCELLED', 71 | ]; 72 | 73 | public static function name($value) 74 | { 75 | if (!isset(self::$valueToName[$value])) { 76 | throw new UnexpectedValueException(sprintf( 77 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 78 | } 79 | return self::$valueToName[$value]; 80 | } 81 | 82 | 83 | public static function value($name) 84 | { 85 | $const = __CLASS__ . '::' . strtoupper($name); 86 | if (!defined($const)) { 87 | throw new UnexpectedValueException(sprintf( 88 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 89 | } 90 | return constant($const); 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /src/V2/README.md: -------------------------------------------------------------------------------- 1 | # Stackdriver Logging V2 generated client for PHP 2 | 3 | ### Sample 4 | 5 | ```php 6 | require 'vendor/autoload.php'; 7 | 8 | use Google\Cloud\Logging\V2\LoggingServiceV2Client; 9 | 10 | $loggingServiceV2Client = new LoggingServiceV2Client(); 11 | try { 12 | $formattedLogName = $loggingServiceV2Client->logName('[PROJECT]', '[LOG]'); 13 | $loggingServiceV2Client->deleteLog($formattedLogName); 14 | } finally { 15 | $loggingServiceV2Client->close(); 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /src/V2/TailLogEntriesResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.TailLogEntriesResponse 15 | */ 16 | class TailLogEntriesResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * A list of log entries. Each response in the stream will order entries with 20 | * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed 21 | * between separate responses. 22 | * 23 | * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; 24 | */ 25 | private $entries; 26 | /** 27 | * If entries that otherwise would have been included in the session were not 28 | * sent back to the client, counts of relevant entries omitted from the 29 | * session with the reason that they were not included. There will be at most 30 | * one of each reason per response. The counts represent the number of 31 | * suppressed entries since the last streamed response. 32 | * 33 | * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; 34 | */ 35 | private $suppression_info; 36 | 37 | /** 38 | * Constructor. 39 | * 40 | * @param array $data { 41 | * Optional. Data for populating the Message object. 42 | * 43 | * @type array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $entries 44 | * A list of log entries. Each response in the stream will order entries with 45 | * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed 46 | * between separate responses. 47 | * @type array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $suppression_info 48 | * If entries that otherwise would have been included in the session were not 49 | * sent back to the client, counts of relevant entries omitted from the 50 | * session with the reason that they were not included. There will be at most 51 | * one of each reason per response. The counts represent the number of 52 | * suppressed entries since the last streamed response. 53 | * } 54 | */ 55 | public function __construct($data = NULL) { 56 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 57 | parent::__construct($data); 58 | } 59 | 60 | /** 61 | * A list of log entries. Each response in the stream will order entries with 62 | * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed 63 | * between separate responses. 64 | * 65 | * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; 66 | * @return \Google\Protobuf\Internal\RepeatedField 67 | */ 68 | public function getEntries() 69 | { 70 | return $this->entries; 71 | } 72 | 73 | /** 74 | * A list of log entries. Each response in the stream will order entries with 75 | * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed 76 | * between separate responses. 77 | * 78 | * Generated from protobuf field repeated .google.logging.v2.LogEntry entries = 1; 79 | * @param array<\Google\Cloud\Logging\V2\LogEntry>|\Google\Protobuf\Internal\RepeatedField $var 80 | * @return $this 81 | */ 82 | public function setEntries($var) 83 | { 84 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\LogEntry::class); 85 | $this->entries = $arr; 86 | 87 | return $this; 88 | } 89 | 90 | /** 91 | * If entries that otherwise would have been included in the session were not 92 | * sent back to the client, counts of relevant entries omitted from the 93 | * session with the reason that they were not included. There will be at most 94 | * one of each reason per response. The counts represent the number of 95 | * suppressed entries since the last streamed response. 96 | * 97 | * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; 98 | * @return \Google\Protobuf\Internal\RepeatedField 99 | */ 100 | public function getSuppressionInfo() 101 | { 102 | return $this->suppression_info; 103 | } 104 | 105 | /** 106 | * If entries that otherwise would have been included in the session were not 107 | * sent back to the client, counts of relevant entries omitted from the 108 | * session with the reason that they were not included. There will be at most 109 | * one of each reason per response. The counts represent the number of 110 | * suppressed entries since the last streamed response. 111 | * 112 | * Generated from protobuf field repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; 113 | * @param array<\Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo>|\Google\Protobuf\Internal\RepeatedField $var 114 | * @return $this 115 | */ 116 | public function setSuppressionInfo($var) 117 | { 118 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo::class); 119 | $this->suppression_info = $arr; 120 | 121 | return $this; 122 | } 123 | 124 | } 125 | 126 | -------------------------------------------------------------------------------- /src/V2/TailLogEntriesResponse/SuppressionInfo.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.TailLogEntriesResponse.SuppressionInfo 15 | */ 16 | class SuppressionInfo extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * The reason that entries were omitted from the session. 20 | * 21 | * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; 22 | */ 23 | private $reason = 0; 24 | /** 25 | * A lower bound on the count of entries omitted due to `reason`. 26 | * 27 | * Generated from protobuf field int32 suppressed_count = 2; 28 | */ 29 | private $suppressed_count = 0; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $reason 38 | * The reason that entries were omitted from the session. 39 | * @type int $suppressed_count 40 | * A lower bound on the count of entries omitted due to `reason`. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * The reason that entries were omitted from the session. 50 | * 51 | * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; 52 | * @return int 53 | */ 54 | public function getReason() 55 | { 56 | return $this->reason; 57 | } 58 | 59 | /** 60 | * The reason that entries were omitted from the session. 61 | * 62 | * Generated from protobuf field .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; 63 | * @param int $var 64 | * @return $this 65 | */ 66 | public function setReason($var) 67 | { 68 | GPBUtil::checkEnum($var, \Google\Cloud\Logging\V2\TailLogEntriesResponse\SuppressionInfo\Reason::class); 69 | $this->reason = $var; 70 | 71 | return $this; 72 | } 73 | 74 | /** 75 | * A lower bound on the count of entries omitted due to `reason`. 76 | * 77 | * Generated from protobuf field int32 suppressed_count = 2; 78 | * @return int 79 | */ 80 | public function getSuppressedCount() 81 | { 82 | return $this->suppressed_count; 83 | } 84 | 85 | /** 86 | * A lower bound on the count of entries omitted due to `reason`. 87 | * 88 | * Generated from protobuf field int32 suppressed_count = 2; 89 | * @param int $var 90 | * @return $this 91 | */ 92 | public function setSuppressedCount($var) 93 | { 94 | GPBUtil::checkInt32($var); 95 | $this->suppressed_count = $var; 96 | 97 | return $this; 98 | } 99 | 100 | } 101 | 102 | // Adding a class alias for backwards compatibility with the previous class name. 103 | class_alias(SuppressionInfo::class, \Google\Cloud\Logging\V2\TailLogEntriesResponse_SuppressionInfo::class); 104 | 105 | -------------------------------------------------------------------------------- /src/V2/TailLogEntriesResponse/SuppressionInfo/Reason.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason 13 | */ 14 | class Reason 15 | { 16 | /** 17 | * Unexpected default. 18 | * 19 | * Generated from protobuf enum REASON_UNSPECIFIED = 0; 20 | */ 21 | const REASON_UNSPECIFIED = 0; 22 | /** 23 | * Indicates suppression occurred due to relevant entries being 24 | * received in excess of rate limits. For quotas and limits, see 25 | * [Logging API quotas and 26 | * limits](https://cloud.google.com/logging/quotas#api-limits). 27 | * 28 | * Generated from protobuf enum RATE_LIMIT = 1; 29 | */ 30 | const RATE_LIMIT = 1; 31 | /** 32 | * Indicates suppression occurred due to the client not consuming 33 | * responses quickly enough. 34 | * 35 | * Generated from protobuf enum NOT_CONSUMED = 2; 36 | */ 37 | const NOT_CONSUMED = 2; 38 | 39 | private static $valueToName = [ 40 | self::REASON_UNSPECIFIED => 'REASON_UNSPECIFIED', 41 | self::RATE_LIMIT => 'RATE_LIMIT', 42 | self::NOT_CONSUMED => 'NOT_CONSUMED', 43 | ]; 44 | 45 | public static function name($value) 46 | { 47 | if (!isset(self::$valueToName[$value])) { 48 | throw new UnexpectedValueException(sprintf( 49 | 'Enum %s has no name defined for value %s', __CLASS__, $value)); 50 | } 51 | return self::$valueToName[$value]; 52 | } 53 | 54 | 55 | public static function value($name) 56 | { 57 | $const = __CLASS__ . '::' . strtoupper($name); 58 | if (!defined($const)) { 59 | throw new UnexpectedValueException(sprintf( 60 | 'Enum %s has no value defined for name %s', __CLASS__, $name)); 61 | } 62 | return constant($const); 63 | } 64 | } 65 | 66 | // Adding a class alias for backwards compatibility with the previous class name. 67 | class_alias(Reason::class, \Google\Cloud\Logging\V2\TailLogEntriesResponse_SuppressionInfo_Reason::class); 68 | 69 | -------------------------------------------------------------------------------- /src/V2/TailLogEntriesResponse_SuppressionInfo.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.UndeleteBucketRequest 15 | */ 16 | class UndeleteBucketRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The full resource name of the bucket to undelete. 20 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 21 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 22 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 23 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 24 | * For example: 25 | * `"projects/my-project/locations/global/buckets/my-bucket"` 26 | * 27 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 28 | */ 29 | private $name = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $name 38 | * Required. The full resource name of the bucket to undelete. 39 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 40 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 41 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 42 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 43 | * For example: 44 | * `"projects/my-project/locations/global/buckets/my-bucket"` 45 | * } 46 | */ 47 | public function __construct($data = NULL) { 48 | \GPBMetadata\Google\Logging\V2\LoggingConfig::initOnce(); 49 | parent::__construct($data); 50 | } 51 | 52 | /** 53 | * Required. The full resource name of the bucket to undelete. 54 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 55 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 56 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 57 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 58 | * For example: 59 | * `"projects/my-project/locations/global/buckets/my-bucket"` 60 | * 61 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 62 | * @return string 63 | */ 64 | public function getName() 65 | { 66 | return $this->name; 67 | } 68 | 69 | /** 70 | * Required. The full resource name of the bucket to undelete. 71 | * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 72 | * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 73 | * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 74 | * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" 75 | * For example: 76 | * `"projects/my-project/locations/global/buckets/my-bucket"` 77 | * 78 | * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 79 | * @param string $var 80 | * @return $this 81 | */ 82 | public function setName($var) 83 | { 84 | GPBUtil::checkString($var, True); 85 | $this->name = $var; 86 | 87 | return $this; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /src/V2/UpdateLogMetricRequest.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.UpdateLogMetricRequest 15 | */ 16 | class UpdateLogMetricRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Required. The resource name of the metric to update: 20 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 21 | * The updated metric must be provided in the request and it's 22 | * `name` field must be the same as `[METRIC_ID]` If the metric 23 | * does not exist in `[PROJECT_ID]`, then a new metric is created. 24 | * 25 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 26 | */ 27 | private $metric_name = ''; 28 | /** 29 | * Required. The updated metric. 30 | * 31 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 32 | */ 33 | private $metric = null; 34 | 35 | /** 36 | * @param string $metricName Required. The resource name of the metric to update: 37 | * 38 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 39 | * 40 | * The updated metric must be provided in the request and it's 41 | * `name` field must be the same as `[METRIC_ID]` If the metric 42 | * does not exist in `[PROJECT_ID]`, then a new metric is created. Please see 43 | * {@see MetricsServiceV2Client::logMetricName()} for help formatting this field. 44 | * @param \Google\Cloud\Logging\V2\LogMetric $metric Required. The updated metric. 45 | * 46 | * @return \Google\Cloud\Logging\V2\UpdateLogMetricRequest 47 | * 48 | * @experimental 49 | */ 50 | public static function build(string $metricName, \Google\Cloud\Logging\V2\LogMetric $metric): self 51 | { 52 | return (new self()) 53 | ->setMetricName($metricName) 54 | ->setMetric($metric); 55 | } 56 | 57 | /** 58 | * Constructor. 59 | * 60 | * @param array $data { 61 | * Optional. Data for populating the Message object. 62 | * 63 | * @type string $metric_name 64 | * Required. The resource name of the metric to update: 65 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 66 | * The updated metric must be provided in the request and it's 67 | * `name` field must be the same as `[METRIC_ID]` If the metric 68 | * does not exist in `[PROJECT_ID]`, then a new metric is created. 69 | * @type \Google\Cloud\Logging\V2\LogMetric $metric 70 | * Required. The updated metric. 71 | * } 72 | */ 73 | public function __construct($data = NULL) { 74 | \GPBMetadata\Google\Logging\V2\LoggingMetrics::initOnce(); 75 | parent::__construct($data); 76 | } 77 | 78 | /** 79 | * Required. The resource name of the metric to update: 80 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 81 | * The updated metric must be provided in the request and it's 82 | * `name` field must be the same as `[METRIC_ID]` If the metric 83 | * does not exist in `[PROJECT_ID]`, then a new metric is created. 84 | * 85 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 86 | * @return string 87 | */ 88 | public function getMetricName() 89 | { 90 | return $this->metric_name; 91 | } 92 | 93 | /** 94 | * Required. The resource name of the metric to update: 95 | * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" 96 | * The updated metric must be provided in the request and it's 97 | * `name` field must be the same as `[METRIC_ID]` If the metric 98 | * does not exist in `[PROJECT_ID]`, then a new metric is created. 99 | * 100 | * Generated from protobuf field string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { 101 | * @param string $var 102 | * @return $this 103 | */ 104 | public function setMetricName($var) 105 | { 106 | GPBUtil::checkString($var, True); 107 | $this->metric_name = $var; 108 | 109 | return $this; 110 | } 111 | 112 | /** 113 | * Required. The updated metric. 114 | * 115 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 116 | * @return \Google\Cloud\Logging\V2\LogMetric|null 117 | */ 118 | public function getMetric() 119 | { 120 | return $this->metric; 121 | } 122 | 123 | public function hasMetric() 124 | { 125 | return isset($this->metric); 126 | } 127 | 128 | public function clearMetric() 129 | { 130 | unset($this->metric); 131 | } 132 | 133 | /** 134 | * Required. The updated metric. 135 | * 136 | * Generated from protobuf field .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; 137 | * @param \Google\Cloud\Logging\V2\LogMetric $var 138 | * @return $this 139 | */ 140 | public function setMetric($var) 141 | { 142 | GPBUtil::checkMessage($var, \Google\Cloud\Logging\V2\LogMetric::class); 143 | $this->metric = $var; 144 | 145 | return $this; 146 | } 147 | 148 | } 149 | 150 | -------------------------------------------------------------------------------- /src/V2/WriteLogEntriesPartialErrors.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.WriteLogEntriesPartialErrors 15 | */ 16 | class WriteLogEntriesPartialErrors extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * When `WriteLogEntriesRequest.partial_success` is true, records the error 20 | * status for entries that were not written due to a permanent error, keyed 21 | * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. 22 | * Failed requests for which no entries are written will not include 23 | * per-entry errors. 24 | * 25 | * Generated from protobuf field map log_entry_errors = 1; 26 | */ 27 | private $log_entry_errors; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type array|\Google\Protobuf\Internal\MapField $log_entry_errors 36 | * When `WriteLogEntriesRequest.partial_success` is true, records the error 37 | * status for entries that were not written due to a permanent error, keyed 38 | * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. 39 | * Failed requests for which no entries are written will not include 40 | * per-entry errors. 41 | * } 42 | */ 43 | public function __construct($data = NULL) { 44 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 45 | parent::__construct($data); 46 | } 47 | 48 | /** 49 | * When `WriteLogEntriesRequest.partial_success` is true, records the error 50 | * status for entries that were not written due to a permanent error, keyed 51 | * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. 52 | * Failed requests for which no entries are written will not include 53 | * per-entry errors. 54 | * 55 | * Generated from protobuf field map log_entry_errors = 1; 56 | * @return \Google\Protobuf\Internal\MapField 57 | */ 58 | public function getLogEntryErrors() 59 | { 60 | return $this->log_entry_errors; 61 | } 62 | 63 | /** 64 | * When `WriteLogEntriesRequest.partial_success` is true, records the error 65 | * status for entries that were not written due to a permanent error, keyed 66 | * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. 67 | * Failed requests for which no entries are written will not include 68 | * per-entry errors. 69 | * 70 | * Generated from protobuf field map log_entry_errors = 1; 71 | * @param array|\Google\Protobuf\Internal\MapField $var 72 | * @return $this 73 | */ 74 | public function setLogEntryErrors($var) 75 | { 76 | $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::INT32, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); 77 | $this->log_entry_errors = $arr; 78 | 79 | return $this; 80 | } 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/V2/WriteLogEntriesResponse.php: -------------------------------------------------------------------------------- 1 | google.logging.v2.WriteLogEntriesResponse 15 | */ 16 | class WriteLogEntriesResponse extends \Google\Protobuf\Internal\Message 17 | { 18 | 19 | /** 20 | * Constructor. 21 | * 22 | * @param array $data { 23 | * Optional. Data for populating the Message object. 24 | * 25 | * } 26 | */ 27 | public function __construct($data = NULL) { 28 | \GPBMetadata\Google\Logging\V2\Logging::initOnce(); 29 | parent::__construct($data); 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/V2/resources/logging_service_v2_client_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "interfaces": { 3 | "google.logging.v2.LoggingServiceV2": { 4 | "retry_codes": { 5 | "no_retry_codes": [], 6 | "retry_policy_1_codes": [ 7 | "DEADLINE_EXCEEDED", 8 | "INTERNAL", 9 | "UNAVAILABLE" 10 | ], 11 | "retry_policy_2_codes": [ 12 | "DEADLINE_EXCEEDED", 13 | "INTERNAL", 14 | "UNAVAILABLE" 15 | ] 16 | }, 17 | "retry_params": { 18 | "no_retry_params": { 19 | "initial_retry_delay_millis": 0, 20 | "retry_delay_multiplier": 0.0, 21 | "max_retry_delay_millis": 0, 22 | "initial_rpc_timeout_millis": 0, 23 | "rpc_timeout_multiplier": 1.0, 24 | "max_rpc_timeout_millis": 0, 25 | "total_timeout_millis": 0 26 | }, 27 | "retry_policy_1_params": { 28 | "initial_retry_delay_millis": 100, 29 | "retry_delay_multiplier": 1.3, 30 | "max_retry_delay_millis": 60000, 31 | "initial_rpc_timeout_millis": 60000, 32 | "rpc_timeout_multiplier": 1.0, 33 | "max_rpc_timeout_millis": 60000, 34 | "total_timeout_millis": 60000 35 | }, 36 | "retry_policy_2_params": { 37 | "initial_retry_delay_millis": 100, 38 | "retry_delay_multiplier": 1.3, 39 | "max_retry_delay_millis": 60000, 40 | "initial_rpc_timeout_millis": 3600000, 41 | "rpc_timeout_multiplier": 1.0, 42 | "max_rpc_timeout_millis": 3600000, 43 | "total_timeout_millis": 3600000 44 | } 45 | }, 46 | "methods": { 47 | "DeleteLog": { 48 | "timeout_millis": 60000, 49 | "retry_codes_name": "retry_policy_1_codes", 50 | "retry_params_name": "retry_policy_1_params" 51 | }, 52 | "ListLogEntries": { 53 | "timeout_millis": 60000, 54 | "retry_codes_name": "retry_policy_1_codes", 55 | "retry_params_name": "retry_policy_1_params" 56 | }, 57 | "ListLogs": { 58 | "timeout_millis": 60000, 59 | "retry_codes_name": "retry_policy_1_codes", 60 | "retry_params_name": "retry_policy_1_params" 61 | }, 62 | "ListMonitoredResourceDescriptors": { 63 | "timeout_millis": 60000, 64 | "retry_codes_name": "retry_policy_1_codes", 65 | "retry_params_name": "retry_policy_1_params" 66 | }, 67 | "TailLogEntries": { 68 | "timeout_millis": 3600000 69 | }, 70 | "WriteLogEntries": { 71 | "timeout_millis": 60000, 72 | "retry_codes_name": "retry_policy_1_codes", 73 | "retry_params_name": "retry_policy_1_params", 74 | "bundling": { 75 | "delay_threshold_millis": 50, 76 | "element_count_threshold": 1000, 77 | "request_byte_threshold": 1048576 78 | } 79 | } 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/V2/resources/logging_service_v2_descriptor_config.php: -------------------------------------------------------------------------------- 1 | [ 25 | 'google.logging.v2.LoggingServiceV2' => [ 26 | 'DeleteLog' => [ 27 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 28 | 'responseType' => 'Google\Protobuf\GPBEmpty', 29 | 'headerParams' => [ 30 | [ 31 | 'keyName' => 'log_name', 32 | 'fieldAccessors' => [ 33 | 'getLogName', 34 | ], 35 | ], 36 | ], 37 | ], 38 | 'ListLogEntries' => [ 39 | 'pageStreaming' => [ 40 | 'requestPageTokenGetMethod' => 'getPageToken', 41 | 'requestPageTokenSetMethod' => 'setPageToken', 42 | 'requestPageSizeGetMethod' => 'getPageSize', 43 | 'requestPageSizeSetMethod' => 'setPageSize', 44 | 'responsePageTokenGetMethod' => 'getNextPageToken', 45 | 'resourcesGetMethod' => 'getEntries', 46 | ], 47 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, 48 | 'responseType' => 'Google\Cloud\Logging\V2\ListLogEntriesResponse', 49 | ], 50 | 'ListLogs' => [ 51 | 'pageStreaming' => [ 52 | 'requestPageTokenGetMethod' => 'getPageToken', 53 | 'requestPageTokenSetMethod' => 'setPageToken', 54 | 'requestPageSizeGetMethod' => 'getPageSize', 55 | 'requestPageSizeSetMethod' => 'setPageSize', 56 | 'responsePageTokenGetMethod' => 'getNextPageToken', 57 | 'resourcesGetMethod' => 'getLogNames', 58 | ], 59 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, 60 | 'responseType' => 'Google\Cloud\Logging\V2\ListLogsResponse', 61 | 'headerParams' => [ 62 | [ 63 | 'keyName' => 'parent', 64 | 'fieldAccessors' => [ 65 | 'getParent', 66 | ], 67 | ], 68 | ], 69 | ], 70 | 'ListMonitoredResourceDescriptors' => [ 71 | 'pageStreaming' => [ 72 | 'requestPageTokenGetMethod' => 'getPageToken', 73 | 'requestPageTokenSetMethod' => 'setPageToken', 74 | 'requestPageSizeGetMethod' => 'getPageSize', 75 | 'requestPageSizeSetMethod' => 'setPageSize', 76 | 'responsePageTokenGetMethod' => 'getNextPageToken', 77 | 'resourcesGetMethod' => 'getResourceDescriptors', 78 | ], 79 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, 80 | 'responseType' => 'Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsResponse', 81 | ], 82 | 'TailLogEntries' => [ 83 | 'grpcStreaming' => [ 84 | 'grpcStreamingType' => 'BidiStreaming', 85 | ], 86 | 'callType' => \Google\ApiCore\Call::BIDI_STREAMING_CALL, 87 | 'responseType' => 'Google\Cloud\Logging\V2\TailLogEntriesResponse', 88 | ], 89 | 'WriteLogEntries' => [ 90 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 91 | 'responseType' => 'Google\Cloud\Logging\V2\WriteLogEntriesResponse', 92 | ], 93 | 'templateMap' => [ 94 | 'billingAccount' => 'billingAccounts/{billing_account}', 95 | 'billingAccountLog' => 'billingAccounts/{billing_account}/logs/{log}', 96 | 'folder' => 'folders/{folder}', 97 | 'folderLog' => 'folders/{folder}/logs/{log}', 98 | 'log' => 'projects/{project}/logs/{log}', 99 | 'organization' => 'organizations/{organization}', 100 | 'organizationLog' => 'organizations/{organization}/logs/{log}', 101 | 'project' => 'projects/{project}', 102 | 'projectLog' => 'projects/{project}/logs/{log}', 103 | ], 104 | ], 105 | ], 106 | ]; 107 | -------------------------------------------------------------------------------- /src/V2/resources/metrics_service_v2_client_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "interfaces": { 3 | "google.logging.v2.MetricsServiceV2": { 4 | "retry_codes": { 5 | "no_retry_codes": [], 6 | "no_retry_1_codes": [], 7 | "retry_policy_4_codes": [ 8 | "DEADLINE_EXCEEDED", 9 | "INTERNAL", 10 | "UNAVAILABLE" 11 | ] 12 | }, 13 | "retry_params": { 14 | "no_retry_params": { 15 | "initial_retry_delay_millis": 0, 16 | "retry_delay_multiplier": 0.0, 17 | "max_retry_delay_millis": 0, 18 | "initial_rpc_timeout_millis": 0, 19 | "rpc_timeout_multiplier": 1.0, 20 | "max_rpc_timeout_millis": 0, 21 | "total_timeout_millis": 0 22 | }, 23 | "no_retry_1_params": { 24 | "initial_retry_delay_millis": 0, 25 | "retry_delay_multiplier": 0.0, 26 | "max_retry_delay_millis": 0, 27 | "initial_rpc_timeout_millis": 60000, 28 | "rpc_timeout_multiplier": 1.0, 29 | "max_rpc_timeout_millis": 60000, 30 | "total_timeout_millis": 60000 31 | }, 32 | "retry_policy_4_params": { 33 | "initial_retry_delay_millis": 100, 34 | "retry_delay_multiplier": 1.3, 35 | "max_retry_delay_millis": 60000, 36 | "initial_rpc_timeout_millis": 60000, 37 | "rpc_timeout_multiplier": 1.0, 38 | "max_rpc_timeout_millis": 60000, 39 | "total_timeout_millis": 60000 40 | } 41 | }, 42 | "methods": { 43 | "CreateLogMetric": { 44 | "timeout_millis": 60000, 45 | "retry_codes_name": "no_retry_1_codes", 46 | "retry_params_name": "no_retry_1_params" 47 | }, 48 | "DeleteLogMetric": { 49 | "timeout_millis": 60000, 50 | "retry_codes_name": "retry_policy_4_codes", 51 | "retry_params_name": "retry_policy_4_params" 52 | }, 53 | "GetLogMetric": { 54 | "timeout_millis": 60000, 55 | "retry_codes_name": "retry_policy_4_codes", 56 | "retry_params_name": "retry_policy_4_params" 57 | }, 58 | "ListLogMetrics": { 59 | "timeout_millis": 60000, 60 | "retry_codes_name": "retry_policy_4_codes", 61 | "retry_params_name": "retry_policy_4_params" 62 | }, 63 | "UpdateLogMetric": { 64 | "timeout_millis": 60000, 65 | "retry_codes_name": "retry_policy_4_codes", 66 | "retry_params_name": "retry_policy_4_params" 67 | } 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/V2/resources/metrics_service_v2_descriptor_config.php: -------------------------------------------------------------------------------- 1 | [ 25 | 'google.logging.v2.MetricsServiceV2' => [ 26 | 'CreateLogMetric' => [ 27 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 28 | 'responseType' => 'Google\Cloud\Logging\V2\LogMetric', 29 | 'headerParams' => [ 30 | [ 31 | 'keyName' => 'parent', 32 | 'fieldAccessors' => [ 33 | 'getParent', 34 | ], 35 | ], 36 | ], 37 | ], 38 | 'DeleteLogMetric' => [ 39 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 40 | 'responseType' => 'Google\Protobuf\GPBEmpty', 41 | 'headerParams' => [ 42 | [ 43 | 'keyName' => 'metric_name', 44 | 'fieldAccessors' => [ 45 | 'getMetricName', 46 | ], 47 | ], 48 | ], 49 | ], 50 | 'GetLogMetric' => [ 51 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 52 | 'responseType' => 'Google\Cloud\Logging\V2\LogMetric', 53 | 'headerParams' => [ 54 | [ 55 | 'keyName' => 'metric_name', 56 | 'fieldAccessors' => [ 57 | 'getMetricName', 58 | ], 59 | ], 60 | ], 61 | ], 62 | 'ListLogMetrics' => [ 63 | 'pageStreaming' => [ 64 | 'requestPageTokenGetMethod' => 'getPageToken', 65 | 'requestPageTokenSetMethod' => 'setPageToken', 66 | 'requestPageSizeGetMethod' => 'getPageSize', 67 | 'requestPageSizeSetMethod' => 'setPageSize', 68 | 'responsePageTokenGetMethod' => 'getNextPageToken', 69 | 'resourcesGetMethod' => 'getMetrics', 70 | ], 71 | 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, 72 | 'responseType' => 'Google\Cloud\Logging\V2\ListLogMetricsResponse', 73 | 'headerParams' => [ 74 | [ 75 | 'keyName' => 'parent', 76 | 'fieldAccessors' => [ 77 | 'getParent', 78 | ], 79 | ], 80 | ], 81 | ], 82 | 'UpdateLogMetric' => [ 83 | 'callType' => \Google\ApiCore\Call::UNARY_CALL, 84 | 'responseType' => 'Google\Cloud\Logging\V2\LogMetric', 85 | 'headerParams' => [ 86 | [ 87 | 'keyName' => 'metric_name', 88 | 'fieldAccessors' => [ 89 | 'getMetricName', 90 | ], 91 | ], 92 | ], 93 | ], 94 | 'templateMap' => [ 95 | 'logMetric' => 'projects/{project}/metrics/{metric}', 96 | 'project' => 'projects/{project}', 97 | ], 98 | ], 99 | ], 100 | ]; 101 | --------------------------------------------------------------------------------