diff --git a/ErrorReporting/src/V1beta1/DeleteEventsRequest.php b/ErrorReporting/src/V1beta1/DeleteEventsRequest.php
index bed9aab68a03..569af58e9632 100644
--- a/ErrorReporting/src/V1beta1/DeleteEventsRequest.php
+++ b/ErrorReporting/src/V1beta1/DeleteEventsRequest.php
@@ -17,7 +17,7 @@ class DeleteEventsRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -34,7 +34,7 @@ class DeleteEventsRequest extends \Google\Protobuf\Internal\Message
*
* @type string $project_name
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -47,7 +47,7 @@ public function __construct($data = NULL) {
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -62,7 +62,7 @@ public function getProjectName()
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
diff --git a/ErrorReporting/src/V1beta1/ErrorContext.php b/ErrorReporting/src/V1beta1/ErrorContext.php
index 118262d3c6de..c0576795415f 100644
--- a/ErrorReporting/src/V1beta1/ErrorContext.php
+++ b/ErrorReporting/src/V1beta1/ErrorContext.php
@@ -85,11 +85,11 @@ public function __construct($data = NULL) {
* triggered.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.HttpRequestContext http_request = 1;
- * @return \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext
+ * @return \Google\Cloud\ErrorReporting\V1beta1\HttpRequestContext|null
*/
public function getHttpRequest()
{
- return isset($this->http_request) ? $this->http_request : null;
+ return $this->http_request;
}
public function hasHttpRequest()
@@ -166,11 +166,11 @@ public function setUser($var)
* caught.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.SourceLocation report_location = 3;
- * @return \Google\Cloud\ErrorReporting\V1beta1\SourceLocation
+ * @return \Google\Cloud\ErrorReporting\V1beta1\SourceLocation|null
*/
public function getReportLocation()
{
- return isset($this->report_location) ? $this->report_location : null;
+ return $this->report_location;
}
public function hasReportLocation()
diff --git a/ErrorReporting/src/V1beta1/ErrorEvent.php b/ErrorReporting/src/V1beta1/ErrorEvent.php
index 09a749ecda32..e669ad322242 100644
--- a/ErrorReporting/src/V1beta1/ErrorEvent.php
+++ b/ErrorReporting/src/V1beta1/ErrorEvent.php
@@ -71,11 +71,11 @@ public function __construct($data = NULL) {
* by the Error Reporting system is used.
*
* Generated from protobuf field .google.protobuf.Timestamp event_time = 1;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getEventTime()
{
- return isset($this->event_time) ? $this->event_time : null;
+ return $this->event_time;
}
public function hasEventTime()
@@ -109,11 +109,11 @@ public function setEventTime($var)
* The `ServiceContext` for which this error was reported.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2;
- * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContext
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContext|null
*/
public function getServiceContext()
{
- return isset($this->service_context) ? $this->service_context : null;
+ return $this->service_context;
}
public function hasServiceContext()
@@ -171,11 +171,11 @@ public function setMessage($var)
* Data about the context in which the error occurred.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ErrorContext context = 5;
- * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorContext
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorContext|null
*/
public function getContext()
{
- return isset($this->context) ? $this->context : null;
+ return $this->context;
}
public function hasContext()
diff --git a/ErrorReporting/src/V1beta1/ErrorGroup.php b/ErrorReporting/src/V1beta1/ErrorGroup.php
index 74afe7c771c6..e0e886ba0d60 100644
--- a/ErrorReporting/src/V1beta1/ErrorGroup.php
+++ b/ErrorReporting/src/V1beta1/ErrorGroup.php
@@ -17,7 +17,7 @@ class ErrorGroup extends \Google\Protobuf\Internal\Message
{
/**
* The group resource name.
- * Example: projects/my-project-123/groups/my-groupid
+ * Example: projects/my-project-123/groups/CNSgkpnppqKCUw
*
* Generated from protobuf field string name = 1;
*/
@@ -35,6 +35,13 @@ class ErrorGroup extends \Google\Protobuf\Internal\Message
* Generated from protobuf field repeated .google.devtools.clouderrorreporting.v1beta1.TrackingIssue tracking_issues = 3;
*/
private $tracking_issues;
+ /**
+ * Error group's resolution status.
+ * An unspecified resolution status will be interpreted as OPEN
+ *
+ * Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ResolutionStatus resolution_status = 5;
+ */
+ private $resolution_status = 0;
/**
* Constructor.
@@ -44,12 +51,15 @@ class ErrorGroup extends \Google\Protobuf\Internal\Message
*
* @type string $name
* The group resource name.
- * Example: projects/my-project-123/groups/my-groupid
+ * Example: projects/my-project-123/groups/CNSgkpnppqKCUw
* @type string $group_id
* Group IDs are unique for a given project. If the same kind of error
* occurs in different service contexts, it will receive the same group ID.
* @type \Google\Cloud\ErrorReporting\V1beta1\TrackingIssue[]|\Google\Protobuf\Internal\RepeatedField $tracking_issues
* Associated tracking issues.
+ * @type int $resolution_status
+ * Error group's resolution status.
+ * An unspecified resolution status will be interpreted as OPEN
* }
*/
public function __construct($data = NULL) {
@@ -59,7 +69,7 @@ public function __construct($data = NULL) {
/**
* The group resource name.
- * Example: projects/my-project-123/groups/my-groupid
+ * Example: projects/my-project-123/groups/CNSgkpnppqKCUw
*
* Generated from protobuf field string name = 1;
* @return string
@@ -71,7 +81,7 @@ public function getName()
/**
* The group resource name.
- * Example: projects/my-project-123/groups/my-groupid
+ * Example: projects/my-project-123/groups/CNSgkpnppqKCUw
*
* Generated from protobuf field string name = 1;
* @param string $var
@@ -139,5 +149,33 @@ public function setTrackingIssues($var)
return $this;
}
+ /**
+ * Error group's resolution status.
+ * An unspecified resolution status will be interpreted as OPEN
+ *
+ * Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ResolutionStatus resolution_status = 5;
+ * @return int
+ */
+ public function getResolutionStatus()
+ {
+ return $this->resolution_status;
+ }
+
+ /**
+ * Error group's resolution status.
+ * An unspecified resolution status will be interpreted as OPEN
+ *
+ * Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ResolutionStatus resolution_status = 5;
+ * @param int $var
+ * @return $this
+ */
+ public function setResolutionStatus($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\ErrorReporting\V1beta1\ResolutionStatus::class);
+ $this->resolution_status = $var;
+
+ return $this;
+ }
+
}
diff --git a/ErrorReporting/src/V1beta1/ErrorGroupServiceClient.php b/ErrorReporting/src/V1beta1/ErrorGroupServiceClient.php
index 8c172060c747..98be81eef2d3 100644
--- a/ErrorReporting/src/V1beta1/ErrorGroupServiceClient.php
+++ b/ErrorReporting/src/V1beta1/ErrorGroupServiceClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_group_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_group_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -28,11 +28,9 @@
use Google\Cloud\ErrorReporting\V1beta1\Gapic\ErrorGroupServiceGapicClient;
-/**
- * {@inheritdoc}
- */
+/** {@inheritdoc} */
class ErrorGroupServiceClient extends ErrorGroupServiceGapicClient
{
- // This class is intentionally empty, and is intended to hold manual
- // additions to the generated {@see ErrorGroupServiceGapicClient} class.
+ // This class is intentionally empty, and is intended to hold manual additions to
+ // the generated {@see ErrorGroupServiceGapicClient} class.
}
diff --git a/ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php b/ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php
index 9c17dc7ebf45..5f5856a4f6d7 100644
--- a/ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php
+++ b/ErrorReporting/src/V1beta1/ErrorGroupServiceGrpcClient.php
@@ -2,7 +2,7 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
-// Copyright 2019 Google LLC.
+// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
namespace Google\Cloud\ErrorReporting\V1beta1;
/**
diff --git a/ErrorReporting/src/V1beta1/ErrorGroupStats.php b/ErrorReporting/src/V1beta1/ErrorGroupStats.php
index d0a6029e95ae..169528ce2cca 100644
--- a/ErrorReporting/src/V1beta1/ErrorGroupStats.php
+++ b/ErrorReporting/src/V1beta1/ErrorGroupStats.php
@@ -160,11 +160,11 @@ public function __construct($data = NULL) {
* Group data that is independent of the filter criteria.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ErrorGroup group = 1;
- * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup|null
*/
public function getGroup()
{
- return isset($this->group) ? $this->group : null;
+ return $this->group;
}
public function hasGroup()
@@ -308,11 +308,11 @@ public function setTimedCounts($var)
* time_range that was specified in the request.
*
* Generated from protobuf field .google.protobuf.Timestamp first_seen_time = 5;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getFirstSeenTime()
{
- return isset($this->first_seen_time) ? $this->first_seen_time : null;
+ return $this->first_seen_time;
}
public function hasFirstSeenTime()
@@ -348,11 +348,11 @@ public function setFirstSeenTime($var)
* that was specified in the request.
*
* Generated from protobuf field .google.protobuf.Timestamp last_seen_time = 6;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getLastSeenTime()
{
- return isset($this->last_seen_time) ? $this->last_seen_time : null;
+ return $this->last_seen_time;
}
public function hasLastSeenTime()
@@ -448,11 +448,11 @@ public function setNumAffectedServices($var)
* insight into the characteristics of the group as a whole.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ErrorEvent representative = 9;
- * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorEvent
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorEvent|null
*/
public function getRepresentative()
{
- return isset($this->representative) ? $this->representative : null;
+ return $this->representative;
}
public function hasRepresentative()
diff --git a/ErrorReporting/src/V1beta1/ErrorStatsServiceClient.php b/ErrorReporting/src/V1beta1/ErrorStatsServiceClient.php
index ed4b0dcbc380..8960d2046073 100644
--- a/ErrorReporting/src/V1beta1/ErrorStatsServiceClient.php
+++ b/ErrorReporting/src/V1beta1/ErrorStatsServiceClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -28,11 +28,9 @@
use Google\Cloud\ErrorReporting\V1beta1\Gapic\ErrorStatsServiceGapicClient;
-/**
- * {@inheritdoc}
- */
+/** {@inheritdoc} */
class ErrorStatsServiceClient extends ErrorStatsServiceGapicClient
{
- // This class is intentionally empty, and is intended to hold manual
- // additions to the generated {@see ErrorStatsServiceGapicClient} class.
+ // This class is intentionally empty, and is intended to hold manual additions to
+ // the generated {@see ErrorStatsServiceGapicClient} class.
}
diff --git a/ErrorReporting/src/V1beta1/ErrorStatsServiceGrpcClient.php b/ErrorReporting/src/V1beta1/ErrorStatsServiceGrpcClient.php
index 1f1fa534dc06..2a17f17379b1 100644
--- a/ErrorReporting/src/V1beta1/ErrorStatsServiceGrpcClient.php
+++ b/ErrorReporting/src/V1beta1/ErrorStatsServiceGrpcClient.php
@@ -2,7 +2,7 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
-// Copyright 2019 Google LLC.
+// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
namespace Google\Cloud\ErrorReporting\V1beta1;
/**
diff --git a/ErrorReporting/src/V1beta1/Gapic/ErrorGroupServiceGapicClient.php b/ErrorReporting/src/V1beta1/Gapic/ErrorGroupServiceGapicClient.php
index 252a01018fe1..95c5c5a8e95e 100644
--- a/ErrorReporting/src/V1beta1/Gapic/ErrorGroupServiceGapicClient.php
+++ b/ErrorReporting/src/V1beta1/Gapic/ErrorGroupServiceGapicClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_group_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_group_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -29,6 +29,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
+
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
@@ -48,17 +49,17 @@
* ```
* $errorGroupServiceClient = new ErrorGroupServiceClient();
* try {
- * $group = new ErrorGroup();
- * $response = $errorGroupServiceClient->updateGroup($group);
+ * $formattedGroupName = $errorGroupServiceClient->errorGroupName('[PROJECT]', '[GROUP]');
+ * $response = $errorGroupServiceClient->getGroup($formattedGroupName);
* } finally {
* $errorGroupServiceClient->close();
* }
* ```
*
- * Many parameters require resource names to be formatted in a particular way. To assist
- * with these names, this class includes a format method for each type of name, and additionally
- * a parseName method to extract the individual identifiers contained within formatted names
- * that are returned by the API.
+ * Many parameters require resource names to be formatted in a particular way. To
+ * assist with these names, this class includes a format method for each type of
+ * name, and additionally a parseName method to extract the individual identifiers
+ * contained within formatted names that are returned by the API.
*
* @experimental
*/
@@ -92,23 +93,25 @@ class ErrorGroupServiceGapicClient
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
+
private static $errorGroupNameTemplate;
+
private static $pathTemplateMap;
private static function getClientDefaults()
{
return [
'serviceName' => self::SERVICE_NAME,
- 'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
- 'clientConfig' => __DIR__.'/../resources/error_group_service_client_config.json',
- 'descriptorsConfigPath' => __DIR__.'/../resources/error_group_service_descriptor_config.php',
- 'gcpApiConfigPath' => __DIR__.'/../resources/error_group_service_grpc_config.json',
+ 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
+ 'clientConfig' => __DIR__ . '/../resources/error_group_service_client_config.json',
+ 'descriptorsConfigPath' => __DIR__ . '/../resources/error_group_service_descriptor_config.php',
+ 'gcpApiConfigPath' => __DIR__ . '/../resources/error_group_service_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
],
'transportConfig' => [
'rest' => [
- 'restClientConfigPath' => __DIR__.'/../resources/error_group_service_rest_client_config.php',
+ 'restClientConfigPath' => __DIR__ . '/../resources/error_group_service_rest_client_config.php',
],
],
];
@@ -116,7 +119,7 @@ private static function getClientDefaults()
private static function getErrorGroupNameTemplate()
{
- if (null == self::$errorGroupNameTemplate) {
+ if (self::$errorGroupNameTemplate == null) {
self::$errorGroupNameTemplate = new PathTemplate('projects/{project}/groups/{group}');
}
@@ -125,7 +128,7 @@ private static function getErrorGroupNameTemplate()
private static function getPathTemplateMap()
{
- if (null == self::$pathTemplateMap) {
+ if (self::$pathTemplateMap == null) {
self::$pathTemplateMap = [
'errorGroup' => self::getErrorGroupNameTemplate(),
];
@@ -135,13 +138,14 @@ private static function getPathTemplateMap()
}
/**
- * Formats a string containing the fully-qualified path to represent
- * a error_group resource.
+ * Formats a string containing the fully-qualified path to represent a error_group
+ * resource.
*
* @param string $project
* @param string $group
*
* @return string The formatted error_group resource.
+ *
* @experimental
*/
public static function errorGroupName($project, $group)
@@ -156,12 +160,13 @@ public static function errorGroupName($project, $group)
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
* Template: Pattern
- * - errorGroup: projects/{project}/groups/{group}.
+ * - errorGroup: projects/{project}/groups/{group}
*
- * The optional $template argument can be supplied to specify a particular pattern, and must
- * match one of the templates listed above. If no $template argument is provided, or if the
- * $template argument does not match one of the templates listed, then parseName will check
- * each of the supported templates, and return the first match.
+ * The optional $template argument can be supplied to specify a particular pattern,
+ * and must match one of the templates listed above. If no $template argument is
+ * provided, or if the $template argument does not match one of the templates
+ * listed, then parseName will check each of the supported templates, and return
+ * the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
@@ -169,12 +174,12 @@ public static function errorGroupName($project, $group)
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
+ *
* @experimental
*/
public static function parseName($formattedName, $template = null)
{
$templateMap = self::getPathTemplateMap();
-
if ($template) {
if (!isset($templateMap[$template])) {
throw new ValidationException("Template name $template does not exist");
@@ -190,6 +195,7 @@ public static function parseName($formattedName, $template = null)
// Swallow the exception to continue trying other path templates
}
}
+
throw new ValidationException("Input did not match any known format. Input: $formattedName");
}
@@ -197,7 +203,7 @@ public static function parseName($formattedName, $template = null)
* Constructor.
*
* @param array $options {
- * Optional. Options for configuring the service API wrapper.
+ * Optional. Options for configuring the service API wrapper.
*
* @type string $serviceAddress
* **Deprecated**. This option will be removed in a future major release. Please
@@ -214,38 +220,42 @@ public static function parseName($formattedName, $template = null)
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* @type array $credentialsConfig
- * Options used to configure credentials, including auth token caching, for the client.
- * For a full list of supporting configuration options, see
- * {@see \Google\ApiCore\CredentialsWrapper::build()}.
+ * Options used to configure credentials, including auth token caching, for the
+ * client. For a full list of supporting configuration options, see
+ * {@see \Google\ApiCore\CredentialsWrapper::build()} .
* @type bool $disableRetries
* Determines whether or not retries defined by the client configuration should be
* disabled. Defaults to `false`.
* @type string|array $clientConfig
- * Client method configuration, including retry settings. This option can be either a
- * path to a JSON file, or a PHP array containing the decoded JSON data.
- * By default this settings points to the default client config file, which is provided
- * in the resources folder.
+ * Client method configuration, including retry settings. This option can be either
+ * a path to a JSON file, or a PHP array containing the decoded JSON data. By
+ * default this settings points to the default client config file, which is
+ * provided in the resources folder.
* @type string|TransportInterface $transport
- * The transport used for executing network requests. May be either the string `rest`
- * or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
- * *Advanced usage*: Additionally, it is possible to pass in an already instantiated
- * {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
- * object is provided, any settings in $transportConfig, and any `$apiEndpoint`
- * setting, will be ignored.
+ * The transport used for executing network requests. May be either the string
+ * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
+ * *Advanced usage*: Additionally, it is possible to pass in an already
+ * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
+ * that when this object is provided, any settings in $transportConfig, and any
+ * $serviceAddress setting, will be ignored.
* @type array $transportConfig
* Configuration options that will be used to construct the transport. Options for
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
- * 'rest' => [...]
+ * 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
+ * @type callable $clientCertSource
+ * A callable which returns the client cert as a string. This can be used to
+ * provide a certificate and private key to the transport layer for mTLS.
* }
*
* @throws ValidationException
+ *
* @experimental
*/
public function __construct(array $options = [])
@@ -255,108 +265,92 @@ public function __construct(array $options = [])
}
/**
- * Replace the data for the specified group.
- * Fails if the group does not exist.
+ * Get the specified group.
*
* Sample code:
* ```
* $errorGroupServiceClient = new ErrorGroupServiceClient();
* try {
- * $group = new ErrorGroup();
- * $response = $errorGroupServiceClient->updateGroup($group);
+ * $formattedGroupName = $errorGroupServiceClient->errorGroupName('[PROJECT]', '[GROUP]');
+ * $response = $errorGroupServiceClient->getGroup($formattedGroupName);
* } finally {
* $errorGroupServiceClient->close();
* }
* ```
*
- * @param ErrorGroup $group Required. The group which replaces the resource on the server.
- * @param array $optionalArgs {
- * Optional.
+ * @param string $groupName Required. The group resource name. Written as
+ * `projects/{projectID}/groups/{group_name}`. Call
+ * [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
+ * to return a list of groups belonging to this project.
+ *
+ * Example: `projects/my-project-123/groups/my-group`
+ * @param array $optionalArgs {
+ * Optional.
*
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
- public function updateGroup($group, array $optionalArgs = [])
+ public function getGroup($groupName, array $optionalArgs = [])
{
- $request = new UpdateGroupRequest();
- $request->setGroup($group);
-
- $requestParams = new RequestParamsHeaderDescriptor([
- 'group.name' => $request->getGroup()->getName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->startCall(
- 'UpdateGroup',
- ErrorGroup::class,
- $optionalArgs,
- $request
- )->wait();
+ $request = new GetGroupRequest();
+ $requestParamHeaders = [];
+ $request->setGroupName($groupName);
+ $requestParamHeaders['group_name'] = $groupName;
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->startCall('GetGroup', ErrorGroup::class, $optionalArgs, $request)->wait();
}
/**
- * Get the specified group.
+ * Replace the data for the specified group.
+ * Fails if the group does not exist.
*
* Sample code:
* ```
* $errorGroupServiceClient = new ErrorGroupServiceClient();
* try {
- * $formattedGroupName = $errorGroupServiceClient->errorGroupName('[PROJECT]', '[GROUP]');
- * $response = $errorGroupServiceClient->getGroup($formattedGroupName);
+ * $group = new ErrorGroup();
+ * $response = $errorGroupServiceClient->updateGroup($group);
* } finally {
* $errorGroupServiceClient->close();
* }
* ```
*
- * @param string $groupName The group resource name. Written as
- * `projects/{projectID}/groups/{group_name}`. Call
- * [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
- * to return a list of groups belonging to this project.
- *
- * Example: `projects/my-project-123/groups/my-group`
- * @param array $optionalArgs {
- * Optional.
+ * @param ErrorGroup $group Required. The group which replaces the resource on the server.
+ * @param array $optionalArgs {
+ * Optional.
*
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
- public function getGroup($groupName, array $optionalArgs = [])
+ public function updateGroup($group, array $optionalArgs = [])
{
- $request = new GetGroupRequest();
- $request->setGroupName($groupName);
-
- $requestParams = new RequestParamsHeaderDescriptor([
- 'group_name' => $request->getGroupName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->startCall(
- 'GetGroup',
- ErrorGroup::class,
- $optionalArgs,
- $request
- )->wait();
+ $request = new UpdateGroupRequest();
+ $requestParamHeaders = [];
+ $request->setGroup($group);
+ $requestParamHeaders['group.name'] = $group->getName();
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->startCall('UpdateGroup', ErrorGroup::class, $optionalArgs, $request)->wait();
}
}
diff --git a/ErrorReporting/src/V1beta1/Gapic/ErrorStatsServiceGapicClient.php b/ErrorReporting/src/V1beta1/Gapic/ErrorStatsServiceGapicClient.php
index e5743462a0b9..5222e7ba942d 100644
--- a/ErrorReporting/src/V1beta1/Gapic/ErrorStatsServiceGapicClient.php
+++ b/ErrorReporting/src/V1beta1/Gapic/ErrorStatsServiceGapicClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -29,6 +29,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
+
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
@@ -44,8 +45,11 @@
use Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange;
use Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter;
use Google\Protobuf\Duration;
+
use Google\Protobuf\Timestamp;
+
+
/**
* Service Description: An API for retrieving and managing error statistics as well as data for
* individual events.
@@ -63,10 +67,10 @@
* }
* ```
*
- * Many parameters require resource names to be formatted in a particular way. To assist
- * with these names, this class includes a format method for each type of name, and additionally
- * a parseName method to extract the individual identifiers contained within formatted names
- * that are returned by the API.
+ * Many parameters require resource names to be formatted in a particular way. To
+ * assist with these names, this class includes a format method for each type of
+ * name, and additionally a parseName method to extract the individual identifiers
+ * contained within formatted names that are returned by the API.
*
* @experimental
*/
@@ -100,23 +104,25 @@ class ErrorStatsServiceGapicClient
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
+
private static $projectNameTemplate;
+
private static $pathTemplateMap;
private static function getClientDefaults()
{
return [
'serviceName' => self::SERVICE_NAME,
- 'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
- 'clientConfig' => __DIR__.'/../resources/error_stats_service_client_config.json',
- 'descriptorsConfigPath' => __DIR__.'/../resources/error_stats_service_descriptor_config.php',
- 'gcpApiConfigPath' => __DIR__.'/../resources/error_stats_service_grpc_config.json',
+ 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
+ 'clientConfig' => __DIR__ . '/../resources/error_stats_service_client_config.json',
+ 'descriptorsConfigPath' => __DIR__ . '/../resources/error_stats_service_descriptor_config.php',
+ 'gcpApiConfigPath' => __DIR__ . '/../resources/error_stats_service_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
],
'transportConfig' => [
'rest' => [
- 'restClientConfigPath' => __DIR__.'/../resources/error_stats_service_rest_client_config.php',
+ 'restClientConfigPath' => __DIR__ . '/../resources/error_stats_service_rest_client_config.php',
],
],
];
@@ -124,7 +130,7 @@ private static function getClientDefaults()
private static function getProjectNameTemplate()
{
- if (null == self::$projectNameTemplate) {
+ if (self::$projectNameTemplate == null) {
self::$projectNameTemplate = new PathTemplate('projects/{project}');
}
@@ -133,7 +139,7 @@ private static function getProjectNameTemplate()
private static function getPathTemplateMap()
{
- if (null == self::$pathTemplateMap) {
+ if (self::$pathTemplateMap == null) {
self::$pathTemplateMap = [
'project' => self::getProjectNameTemplate(),
];
@@ -143,12 +149,13 @@ private static function getPathTemplateMap()
}
/**
- * Formats a string containing the fully-qualified path to represent
- * a project resource.
+ * Formats a string containing the fully-qualified path to represent a project
+ * resource.
*
* @param string $project
*
* @return string The formatted project resource.
+ *
* @experimental
*/
public static function projectName($project)
@@ -162,12 +169,13 @@ public static function projectName($project)
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
* Template: Pattern
- * - project: projects/{project}.
+ * - project: projects/{project}
*
- * The optional $template argument can be supplied to specify a particular pattern, and must
- * match one of the templates listed above. If no $template argument is provided, or if the
- * $template argument does not match one of the templates listed, then parseName will check
- * each of the supported templates, and return the first match.
+ * The optional $template argument can be supplied to specify a particular pattern,
+ * and must match one of the templates listed above. If no $template argument is
+ * provided, or if the $template argument does not match one of the templates
+ * listed, then parseName will check each of the supported templates, and return
+ * the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
@@ -175,12 +183,12 @@ public static function projectName($project)
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
+ *
* @experimental
*/
public static function parseName($formattedName, $template = null)
{
$templateMap = self::getPathTemplateMap();
-
if ($template) {
if (!isset($templateMap[$template])) {
throw new ValidationException("Template name $template does not exist");
@@ -196,6 +204,7 @@ public static function parseName($formattedName, $template = null)
// Swallow the exception to continue trying other path templates
}
}
+
throw new ValidationException("Input did not match any known format. Input: $formattedName");
}
@@ -203,7 +212,7 @@ public static function parseName($formattedName, $template = null)
* Constructor.
*
* @param array $options {
- * Optional. Options for configuring the service API wrapper.
+ * Optional. Options for configuring the service API wrapper.
*
* @type string $serviceAddress
* **Deprecated**. This option will be removed in a future major release. Please
@@ -220,38 +229,42 @@ public static function parseName($formattedName, $template = null)
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* @type array $credentialsConfig
- * Options used to configure credentials, including auth token caching, for the client.
- * For a full list of supporting configuration options, see
- * {@see \Google\ApiCore\CredentialsWrapper::build()}.
+ * Options used to configure credentials, including auth token caching, for the
+ * client. For a full list of supporting configuration options, see
+ * {@see \Google\ApiCore\CredentialsWrapper::build()} .
* @type bool $disableRetries
* Determines whether or not retries defined by the client configuration should be
* disabled. Defaults to `false`.
* @type string|array $clientConfig
- * Client method configuration, including retry settings. This option can be either a
- * path to a JSON file, or a PHP array containing the decoded JSON data.
- * By default this settings points to the default client config file, which is provided
- * in the resources folder.
+ * Client method configuration, including retry settings. This option can be either
+ * a path to a JSON file, or a PHP array containing the decoded JSON data. By
+ * default this settings points to the default client config file, which is
+ * provided in the resources folder.
* @type string|TransportInterface $transport
- * The transport used for executing network requests. May be either the string `rest`
- * or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
- * *Advanced usage*: Additionally, it is possible to pass in an already instantiated
- * {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
- * object is provided, any settings in $transportConfig, and any `$apiEndpoint`
- * setting, will be ignored.
+ * The transport used for executing network requests. May be either the string
+ * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
+ * *Advanced usage*: Additionally, it is possible to pass in an already
+ * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
+ * that when this object is provided, any settings in $transportConfig, and any
+ * $serviceAddress setting, will be ignored.
* @type array $transportConfig
* Configuration options that will be used to construct the transport. Options for
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
- * 'rest' => [...]
+ * 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
+ * @type callable $clientCertSource
+ * A callable which returns the client cert as a string. This can be used to
+ * provide a certificate and private key to the transport layer for mTLS.
* }
*
* @throws ValidationException
+ *
* @experimental
*/
public function __construct(array $options = [])
@@ -275,66 +288,57 @@ public function __construct(array $options = [])
* ```
*
* @param string $projectName Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
+ *
* Example: `projects/my-project-123`.
* @param array $optionalArgs {
- * Optional.
+ * Optional.
*
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\ErrorReporting\V1beta1\DeleteEventsResponse
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
public function deleteEvents($projectName, array $optionalArgs = [])
{
$request = new DeleteEventsRequest();
+ $requestParamHeaders = [];
$request->setProjectName($projectName);
-
- $requestParams = new RequestParamsHeaderDescriptor([
- 'project_name' => $request->getProjectName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->startCall(
- 'DeleteEvents',
- DeleteEventsResponse::class,
- $optionalArgs,
- $request
- )->wait();
+ $requestParamHeaders['project_name'] = $projectName;
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->startCall('DeleteEvents', DeleteEventsResponse::class, $optionalArgs, $request)->wait();
}
/**
- * Lists the specified groups.
+ * Lists the specified events.
*
* Sample code:
* ```
* $errorStatsServiceClient = new ErrorStatsServiceClient();
* try {
* $formattedProjectName = $errorStatsServiceClient->projectName('[PROJECT]');
+ * $groupId = 'group_id';
* // Iterate over pages of elements
- * $pagedResponse = $errorStatsServiceClient->listGroupStats($formattedProjectName);
+ * $pagedResponse = $errorStatsServiceClient->listEvents($formattedProjectName, $groupId);
* foreach ($pagedResponse->iteratePages() as $page) {
* foreach ($page as $element) {
* // doSomethingWith($element);
* }
* }
- *
- *
* // Alternatively:
- *
* // Iterate through all elements
- * $pagedResponse = $errorStatsServiceClient->listGroupStats($formattedProjectName);
+ * $pagedResponse = $errorStatsServiceClient->listEvents($formattedProjectName, $groupId);
* foreach ($pagedResponse->iterateAllElements() as $element) {
* // doSomethingWith($element);
* }
@@ -343,134 +347,92 @@ public function deleteEvents($projectName, array $optionalArgs = [])
* }
* ```
*
- * @param string $projectName Required. The resource name of the Google Cloud Platform project. Written
- * as projects/
plus the
- * Google Cloud
- * Platform project ID.
+ * @param string $projectName Required. The resource name of the Google Cloud Platform project. Written
+ * as `projects/{projectID}`, where `{projectID}` is the
+ * [Google Cloud Platform project
+ * ID](https://support.google.com/cloud/answer/6158840).
*
- * Example: projects/my-project-123
.
- * @param array $optionalArgs {
- * Optional.
+ * Example: `projects/my-project-123`.
+ * @param string $groupId Required. The group for which events shall be returned.
+ * @param array $optionalArgs {
+ * Optional.
*
- * @type string[] $groupId
- * Optional. List all ErrorGroupStats
with these IDs.
* @type ServiceContextFilter $serviceFilter
- * Optional. List only ErrorGroupStats
which belong to a service
- * context that matches the filter.
- * Data for all service contexts is returned if this field is not specified.
+ * Optional. List only ErrorGroups which belong to a service context that
+ * matches the filter.
+ * Data for all service contexts is returned if this field is not specified.
* @type QueryTimeRange $timeRange
- * Optional. List data for the given time range.
- * If not set, a default time range is used. The field
- * time_range_begin
in the response will specify the beginning
- * of this time range.
- * Only ErrorGroupStats
with a non-zero count in the given time
- * range are returned, unless the request contains an explicit
- * group_id
list. If a group_id
list is given, also
- * ErrorGroupStats
with zero occurrences are returned.
- * @type Duration $timedCountDuration
- * Optional. The preferred duration for a single returned `TimedCount`.
- * If not set, no timed counts are returned.
- * @type int $alignment
- * Optional. The alignment of the timed counts to be returned.
- * Default is `ALIGNMENT_EQUAL_AT_END`.
- * For allowed values, use constants defined on {@see \Google\Cloud\ErrorReporting\V1beta1\TimedCountAlignment}
- * @type Timestamp $alignmentTime
- * Optional. Time where the timed counts shall be aligned if rounded
- * alignment is chosen. Default is 00:00 UTC.
- * @type int $order
- * Optional. The sort order in which the results are returned.
- * Default is `COUNT_DESC`.
- * For allowed values, use constants defined on {@see \Google\Cloud\ErrorReporting\V1beta1\ErrorGroupOrder}
+ * Optional. List only data for the given time range.
+ * If not set a default time range is used. The field time_range_begin
+ * in the response will specify the beginning of this time range.
* @type int $pageSize
- * The maximum number of resources contained in the underlying API
- * response. The API may return fewer values in a page, even if
- * there are additional values to be retrieved.
+ * The maximum number of resources contained in the underlying API
+ * response. The API may return fewer values in a page, even if
+ * there are additional values to be retrieved.
* @type string $pageToken
- * A page token is used to specify a page of values to be returned.
- * If no page token is specified (the default), the first page
- * of values will be returned. Any page token used here must have
- * been generated by a previous call to the API.
+ * A page token is used to specify a page of values to be returned.
+ * If no page token is specified (the default), the first page
+ * of values will be returned. Any page token used here must have
+ * been generated by a previous call to the API.
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\ApiCore\PagedListResponse
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
- public function listGroupStats($projectName, array $optionalArgs = [])
+ public function listEvents($projectName, $groupId, array $optionalArgs = [])
{
- $request = new ListGroupStatsRequest();
+ $request = new ListEventsRequest();
+ $requestParamHeaders = [];
$request->setProjectName($projectName);
- if (isset($optionalArgs['groupId'])) {
- $request->setGroupId($optionalArgs['groupId']);
- }
+ $request->setGroupId($groupId);
+ $requestParamHeaders['project_name'] = $projectName;
if (isset($optionalArgs['serviceFilter'])) {
$request->setServiceFilter($optionalArgs['serviceFilter']);
}
+
if (isset($optionalArgs['timeRange'])) {
$request->setTimeRange($optionalArgs['timeRange']);
}
- if (isset($optionalArgs['timedCountDuration'])) {
- $request->setTimedCountDuration($optionalArgs['timedCountDuration']);
- }
- if (isset($optionalArgs['alignment'])) {
- $request->setAlignment($optionalArgs['alignment']);
- }
- if (isset($optionalArgs['alignmentTime'])) {
- $request->setAlignmentTime($optionalArgs['alignmentTime']);
- }
- if (isset($optionalArgs['order'])) {
- $request->setOrder($optionalArgs['order']);
- }
+
if (isset($optionalArgs['pageSize'])) {
$request->setPageSize($optionalArgs['pageSize']);
}
+
if (isset($optionalArgs['pageToken'])) {
$request->setPageToken($optionalArgs['pageToken']);
}
- $requestParams = new RequestParamsHeaderDescriptor([
- 'project_name' => $request->getProjectName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->getPagedListResponse(
- 'ListGroupStats',
- $optionalArgs,
- ListGroupStatsResponse::class,
- $request
- );
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->getPagedListResponse('ListEvents', $optionalArgs, ListEventsResponse::class, $request);
}
/**
- * Lists the specified events.
+ * Lists the specified groups.
*
* Sample code:
* ```
* $errorStatsServiceClient = new ErrorStatsServiceClient();
* try {
* $formattedProjectName = $errorStatsServiceClient->projectName('[PROJECT]');
- * $groupId = '';
* // Iterate over pages of elements
- * $pagedResponse = $errorStatsServiceClient->listEvents($formattedProjectName, $groupId);
+ * $pagedResponse = $errorStatsServiceClient->listGroupStats($formattedProjectName);
* foreach ($pagedResponse->iteratePages() as $page) {
* foreach ($page as $element) {
* // doSomethingWith($element);
* }
* }
- *
- *
* // Alternatively:
- *
* // Iterate through all elements
- * $pagedResponse = $errorStatsServiceClient->listEvents($formattedProjectName, $groupId);
+ * $pagedResponse = $errorStatsServiceClient->listGroupStats($formattedProjectName);
* foreach ($pagedResponse->iterateAllElements() as $element) {
* // doSomethingWith($element);
* }
@@ -480,73 +442,109 @@ public function listGroupStats($projectName, array $optionalArgs = [])
* ```
*
* @param string $projectName Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
- * [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840).
- * Example: `projects/my-project-123`.
- * @param string $groupId Required. The group for which events shall be returned.
+ * as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
+ * and `{projectNumber}` can be found in the
+ * [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
+ *
+ * Examples: `projects/my-project-123`, `projects/5551234`.
* @param array $optionalArgs {
- * Optional.
+ * Optional.
*
+ * @type string[] $groupId
+ * Optional. List all ErrorGroupStats
with these IDs.
* @type ServiceContextFilter $serviceFilter
- * Optional. List only ErrorGroups which belong to a service context that
- * matches the filter.
- * Data for all service contexts is returned if this field is not specified.
+ * Optional. List only ErrorGroupStats
which belong to a service
+ * context that matches the filter.
+ * Data for all service contexts is returned if this field is not specified.
* @type QueryTimeRange $timeRange
- * Optional. List only data for the given time range.
- * If not set a default time range is used. The field time_range_begin
- * in the response will specify the beginning of this time range.
+ * Optional. List data for the given time range.
+ * If not set, a default time range is used. The field
+ * time_range_begin
in the response will specify the beginning
+ * of this time range.
+ * Only ErrorGroupStats
with a non-zero count in the given time
+ * range are returned, unless the request contains an explicit
+ * group_id
list. If a group_id
list is given, also
+ * ErrorGroupStats
with zero occurrences are returned.
+ * @type Duration $timedCountDuration
+ * Optional. The preferred duration for a single returned `TimedCount`.
+ * If not set, no timed counts are returned.
+ * @type int $alignment
+ * Optional. The alignment of the timed counts to be returned.
+ * Default is `ALIGNMENT_EQUAL_AT_END`.
+ * For allowed values, use constants defined on {@see \Google\Cloud\ErrorReporting\V1beta1\TimedCountAlignment}
+ * @type Timestamp $alignmentTime
+ * Optional. Time where the timed counts shall be aligned if rounded
+ * alignment is chosen. Default is 00:00 UTC.
+ * @type int $order
+ * Optional. The sort order in which the results are returned.
+ * Default is `COUNT_DESC`.
+ * For allowed values, use constants defined on {@see \Google\Cloud\ErrorReporting\V1beta1\ErrorGroupOrder}
* @type int $pageSize
- * The maximum number of resources contained in the underlying API
- * response. The API may return fewer values in a page, even if
- * there are additional values to be retrieved.
+ * The maximum number of resources contained in the underlying API
+ * response. The API may return fewer values in a page, even if
+ * there are additional values to be retrieved.
* @type string $pageToken
- * A page token is used to specify a page of values to be returned.
- * If no page token is specified (the default), the first page
- * of values will be returned. Any page token used here must have
- * been generated by a previous call to the API.
+ * A page token is used to specify a page of values to be returned.
+ * If no page token is specified (the default), the first page
+ * of values will be returned. Any page token used here must have
+ * been generated by a previous call to the API.
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\ApiCore\PagedListResponse
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
- public function listEvents($projectName, $groupId, array $optionalArgs = [])
+ public function listGroupStats($projectName, array $optionalArgs = [])
{
- $request = new ListEventsRequest();
+ $request = new ListGroupStatsRequest();
+ $requestParamHeaders = [];
$request->setProjectName($projectName);
- $request->setGroupId($groupId);
+ $requestParamHeaders['project_name'] = $projectName;
+ if (isset($optionalArgs['groupId'])) {
+ $request->setGroupId($optionalArgs['groupId']);
+ }
+
if (isset($optionalArgs['serviceFilter'])) {
$request->setServiceFilter($optionalArgs['serviceFilter']);
}
+
if (isset($optionalArgs['timeRange'])) {
$request->setTimeRange($optionalArgs['timeRange']);
}
+
+ if (isset($optionalArgs['timedCountDuration'])) {
+ $request->setTimedCountDuration($optionalArgs['timedCountDuration']);
+ }
+
+ if (isset($optionalArgs['alignment'])) {
+ $request->setAlignment($optionalArgs['alignment']);
+ }
+
+ if (isset($optionalArgs['alignmentTime'])) {
+ $request->setAlignmentTime($optionalArgs['alignmentTime']);
+ }
+
+ if (isset($optionalArgs['order'])) {
+ $request->setOrder($optionalArgs['order']);
+ }
+
if (isset($optionalArgs['pageSize'])) {
$request->setPageSize($optionalArgs['pageSize']);
}
+
if (isset($optionalArgs['pageToken'])) {
$request->setPageToken($optionalArgs['pageToken']);
}
- $requestParams = new RequestParamsHeaderDescriptor([
- 'project_name' => $request->getProjectName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->getPagedListResponse(
- 'ListEvents',
- $optionalArgs,
- ListEventsResponse::class,
- $request
- );
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->getPagedListResponse('ListGroupStats', $optionalArgs, ListGroupStatsResponse::class, $request);
}
}
diff --git a/ErrorReporting/src/V1beta1/Gapic/ReportErrorsServiceGapicClient.php b/ErrorReporting/src/V1beta1/Gapic/ReportErrorsServiceGapicClient.php
index 0c79b7f8f107..09351fa42cb3 100644
--- a/ErrorReporting/src/V1beta1/Gapic/ReportErrorsServiceGapicClient.php
+++ b/ErrorReporting/src/V1beta1/Gapic/ReportErrorsServiceGapicClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -29,15 +29,16 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
+
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RequestParamsHeaderDescriptor;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
use Google\Auth\FetchAuthTokenInterface;
+use Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent;
use Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventRequest;
use Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventResponse;
-use Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent;
/**
* Service Description: An API for reporting error events.
@@ -56,10 +57,10 @@
* }
* ```
*
- * Many parameters require resource names to be formatted in a particular way. To assist
- * with these names, this class includes a format method for each type of name, and additionally
- * a parseName method to extract the individual identifiers contained within formatted names
- * that are returned by the API.
+ * Many parameters require resource names to be formatted in a particular way. To
+ * assist with these names, this class includes a format method for each type of
+ * name, and additionally a parseName method to extract the individual identifiers
+ * contained within formatted names that are returned by the API.
*
* @experimental
*/
@@ -93,23 +94,25 @@ class ReportErrorsServiceGapicClient
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
+
private static $projectNameTemplate;
+
private static $pathTemplateMap;
private static function getClientDefaults()
{
return [
'serviceName' => self::SERVICE_NAME,
- 'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
- 'clientConfig' => __DIR__.'/../resources/report_errors_service_client_config.json',
- 'descriptorsConfigPath' => __DIR__.'/../resources/report_errors_service_descriptor_config.php',
- 'gcpApiConfigPath' => __DIR__.'/../resources/report_errors_service_grpc_config.json',
+ 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
+ 'clientConfig' => __DIR__ . '/../resources/report_errors_service_client_config.json',
+ 'descriptorsConfigPath' => __DIR__ . '/../resources/report_errors_service_descriptor_config.php',
+ 'gcpApiConfigPath' => __DIR__ . '/../resources/report_errors_service_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
],
'transportConfig' => [
'rest' => [
- 'restClientConfigPath' => __DIR__.'/../resources/report_errors_service_rest_client_config.php',
+ 'restClientConfigPath' => __DIR__ . '/../resources/report_errors_service_rest_client_config.php',
],
],
];
@@ -117,7 +120,7 @@ private static function getClientDefaults()
private static function getProjectNameTemplate()
{
- if (null == self::$projectNameTemplate) {
+ if (self::$projectNameTemplate == null) {
self::$projectNameTemplate = new PathTemplate('projects/{project}');
}
@@ -126,7 +129,7 @@ private static function getProjectNameTemplate()
private static function getPathTemplateMap()
{
- if (null == self::$pathTemplateMap) {
+ if (self::$pathTemplateMap == null) {
self::$pathTemplateMap = [
'project' => self::getProjectNameTemplate(),
];
@@ -136,12 +139,13 @@ private static function getPathTemplateMap()
}
/**
- * Formats a string containing the fully-qualified path to represent
- * a project resource.
+ * Formats a string containing the fully-qualified path to represent a project
+ * resource.
*
* @param string $project
*
* @return string The formatted project resource.
+ *
* @experimental
*/
public static function projectName($project)
@@ -155,12 +159,13 @@ public static function projectName($project)
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
* Template: Pattern
- * - project: projects/{project}.
+ * - project: projects/{project}
*
- * The optional $template argument can be supplied to specify a particular pattern, and must
- * match one of the templates listed above. If no $template argument is provided, or if the
- * $template argument does not match one of the templates listed, then parseName will check
- * each of the supported templates, and return the first match.
+ * The optional $template argument can be supplied to specify a particular pattern,
+ * and must match one of the templates listed above. If no $template argument is
+ * provided, or if the $template argument does not match one of the templates
+ * listed, then parseName will check each of the supported templates, and return
+ * the first match.
*
* @param string $formattedName The formatted name string
* @param string $template Optional name of template to match
@@ -168,12 +173,12 @@ public static function projectName($project)
* @return array An associative array from name component IDs to component values.
*
* @throws ValidationException If $formattedName could not be matched.
+ *
* @experimental
*/
public static function parseName($formattedName, $template = null)
{
$templateMap = self::getPathTemplateMap();
-
if ($template) {
if (!isset($templateMap[$template])) {
throw new ValidationException("Template name $template does not exist");
@@ -189,6 +194,7 @@ public static function parseName($formattedName, $template = null)
// Swallow the exception to continue trying other path templates
}
}
+
throw new ValidationException("Input did not match any known format. Input: $formattedName");
}
@@ -196,7 +202,7 @@ public static function parseName($formattedName, $template = null)
* Constructor.
*
* @param array $options {
- * Optional. Options for configuring the service API wrapper.
+ * Optional. Options for configuring the service API wrapper.
*
* @type string $serviceAddress
* **Deprecated**. This option will be removed in a future major release. Please
@@ -213,38 +219,42 @@ public static function parseName($formattedName, $template = null)
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* @type array $credentialsConfig
- * Options used to configure credentials, including auth token caching, for the client.
- * For a full list of supporting configuration options, see
- * {@see \Google\ApiCore\CredentialsWrapper::build()}.
+ * Options used to configure credentials, including auth token caching, for the
+ * client. For a full list of supporting configuration options, see
+ * {@see \Google\ApiCore\CredentialsWrapper::build()} .
* @type bool $disableRetries
* Determines whether or not retries defined by the client configuration should be
* disabled. Defaults to `false`.
* @type string|array $clientConfig
- * Client method configuration, including retry settings. This option can be either a
- * path to a JSON file, or a PHP array containing the decoded JSON data.
- * By default this settings points to the default client config file, which is provided
- * in the resources folder.
+ * Client method configuration, including retry settings. This option can be either
+ * a path to a JSON file, or a PHP array containing the decoded JSON data. By
+ * default this settings points to the default client config file, which is
+ * provided in the resources folder.
* @type string|TransportInterface $transport
- * The transport used for executing network requests. May be either the string `rest`
- * or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
- * *Advanced usage*: Additionally, it is possible to pass in an already instantiated
- * {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
- * object is provided, any settings in $transportConfig, and any `$apiEndpoint`
- * setting, will be ignored.
+ * The transport used for executing network requests. May be either the string
+ * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
+ * *Advanced usage*: Additionally, it is possible to pass in an already
+ * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
+ * that when this object is provided, any settings in $transportConfig, and any
+ * $serviceAddress setting, will be ignored.
* @type array $transportConfig
* Configuration options that will be used to construct the transport. Options for
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
- * 'rest' => [...]
+ * 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
+ * @type callable $clientCertSource
+ * A callable which returns the client cert as a string. This can be used to
+ * provide a certificate and private key to the transport layer for mTLS.
* }
*
* @throws ValidationException
+ *
* @experimental
*/
public function __construct(array $options = [])
@@ -254,7 +264,7 @@ public function __construct(array $options = [])
}
/**
- * Report an individual error event.
+ * Report an individual error event and record the event to a log.
*
* This endpoint accepts **either** an OAuth token,
* **or** an [API key](https://support.google.com/cloud/answer/6158862)
@@ -262,7 +272,15 @@ public function __construct(array $options = [])
* a `key` parameter. For example:
*
* `POST
- * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456`
+ * https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456`
+ *
+ * **Note:** [Error Reporting](https://cloud.google.com/error-reporting) is a global service built
+ * on Cloud Logging and doesn't analyze logs stored
+ * in regional log buckets or logs routed to other Google Cloud projects.
+ *
+ * For more information, see
+ * [Using Error Reporting with regionalized
+ * logs](https://cloud.google.com/error-reporting/docs/regionalization).
*
* Sample code:
* ```
@@ -277,44 +295,37 @@ public function __construct(array $options = [])
* ```
*
* @param string $projectName Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectId}`, where `{projectId}` is the
* [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840). Example:
- * `projects/my-project-123`.
+ * ID](https://support.google.com/cloud/answer/6158840).
+ *
+ * Example: // `projects/my-project-123`.
* @param ReportedErrorEvent $event Required. The error event to be reported.
* @param array $optionalArgs {
- * Optional.
+ * Optional.
*
* @type RetrySettings|array $retrySettings
- * Retry settings to use for this call. Can be a
- * {@see Google\ApiCore\RetrySettings} object, or an associative array
- * of retry settings parameters. See the documentation on
- * {@see Google\ApiCore\RetrySettings} for example usage.
+ * Retry settings to use for this call. Can be a
+ * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry
+ * settings parameters. See the documentation on
+ * {@see Google\ApiCore\RetrySettings} for example usage.
* }
*
* @return \Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventResponse
*
* @throws ApiException if the remote call fails
+ *
* @experimental
*/
public function reportErrorEvent($projectName, $event, array $optionalArgs = [])
{
$request = new ReportErrorEventRequest();
+ $requestParamHeaders = [];
$request->setProjectName($projectName);
$request->setEvent($event);
-
- $requestParams = new RequestParamsHeaderDescriptor([
- 'project_name' => $request->getProjectName(),
- ]);
- $optionalArgs['headers'] = isset($optionalArgs['headers'])
- ? array_merge($requestParams->getHeader(), $optionalArgs['headers'])
- : $requestParams->getHeader();
-
- return $this->startCall(
- 'ReportErrorEvent',
- ReportErrorEventResponse::class,
- $optionalArgs,
- $request
- )->wait();
+ $requestParamHeaders['project_name'] = $projectName;
+ $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
+ $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
+ return $this->startCall('ReportErrorEvent', ReportErrorEventResponse::class, $optionalArgs, $request)->wait();
}
}
diff --git a/ErrorReporting/src/V1beta1/GetGroupRequest.php b/ErrorReporting/src/V1beta1/GetGroupRequest.php
index 0a211b05ae0f..ff1cd7cd9f32 100644
--- a/ErrorReporting/src/V1beta1/GetGroupRequest.php
+++ b/ErrorReporting/src/V1beta1/GetGroupRequest.php
@@ -16,7 +16,7 @@
class GetGroupRequest extends \Google\Protobuf\Internal\Message
{
/**
- * The group resource name. Written as
+ * Required. The group resource name. Written as
* `projects/{projectID}/groups/{group_name}`. Call
* [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
* to return a list of groups belonging to this project.
@@ -33,7 +33,7 @@ class GetGroupRequest extends \Google\Protobuf\Internal\Message
* Optional. Data for populating the Message object.
*
* @type string $group_name
- * The group resource name. Written as
+ * Required. The group resource name. Written as
* `projects/{projectID}/groups/{group_name}`. Call
* [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
* to return a list of groups belonging to this project.
@@ -46,7 +46,7 @@ public function __construct($data = NULL) {
}
/**
- * The group resource name. Written as
+ * Required. The group resource name. Written as
* `projects/{projectID}/groups/{group_name}`. Call
* [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
* to return a list of groups belonging to this project.
@@ -61,7 +61,7 @@ public function getGroupName()
}
/**
- * The group resource name. Written as
+ * Required. The group resource name. Written as
* `projects/{projectID}/groups/{group_name}`. Call
* [`groupStats.list`](https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.groupStats/list)
* to return a list of groups belonging to this project.
diff --git a/ErrorReporting/src/V1beta1/ListEventsRequest.php b/ErrorReporting/src/V1beta1/ListEventsRequest.php
index a0bc89136e48..8cfb0d4c9725 100644
--- a/ErrorReporting/src/V1beta1/ListEventsRequest.php
+++ b/ErrorReporting/src/V1beta1/ListEventsRequest.php
@@ -17,7 +17,7 @@ class ListEventsRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -68,7 +68,7 @@ class ListEventsRequest extends \Google\Protobuf\Internal\Message
*
* @type string $project_name
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -95,7 +95,7 @@ public function __construct($data = NULL) {
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -110,7 +110,7 @@ public function getProjectName()
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectID}`, where `{projectID}` is the
* [Google Cloud Platform project
* ID](https://support.google.com/cloud/answer/6158840).
* Example: `projects/my-project-123`.
@@ -159,11 +159,11 @@ public function setGroupId($var)
* Data for all service contexts is returned if this field is not specified.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ServiceContextFilter service_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter|null
*/
public function getServiceFilter()
{
- return isset($this->service_filter) ? $this->service_filter : null;
+ return $this->service_filter;
}
public function hasServiceFilter()
@@ -199,11 +199,11 @@ public function setServiceFilter($var)
* in the response will specify the beginning of this time range.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.QueryTimeRange time_range = 4 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange
+ * @return \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange|null
*/
public function getTimeRange()
{
- return isset($this->time_range) ? $this->time_range : null;
+ return $this->time_range;
}
public function hasTimeRange()
diff --git a/ErrorReporting/src/V1beta1/ListEventsResponse.php b/ErrorReporting/src/V1beta1/ListEventsResponse.php
index bfdb73f74d41..f57645164dcf 100644
--- a/ErrorReporting/src/V1beta1/ListEventsResponse.php
+++ b/ErrorReporting/src/V1beta1/ListEventsResponse.php
@@ -117,11 +117,11 @@ public function setNextPageToken($var)
* The timestamp specifies the start time to which the request was restricted.
*
* Generated from protobuf field .google.protobuf.Timestamp time_range_begin = 4;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getTimeRangeBegin()
{
- return isset($this->time_range_begin) ? $this->time_range_begin : null;
+ return $this->time_range_begin;
}
public function hasTimeRangeBegin()
diff --git a/ErrorReporting/src/V1beta1/ListGroupStatsRequest.php b/ErrorReporting/src/V1beta1/ListGroupStatsRequest.php
index 4dc10076b409..247c1c100bd1 100644
--- a/ErrorReporting/src/V1beta1/ListGroupStatsRequest.php
+++ b/ErrorReporting/src/V1beta1/ListGroupStatsRequest.php
@@ -17,10 +17,10 @@ class ListGroupStatsRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as projects/
plus the
- * Google Cloud
- * Platform project ID.
- * Example: projects/my-project-123
.
+ * as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
+ * and `{projectNumber}` can be found in the
+ * [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
+ * Examples: `projects/my-project-123`, `projects/5551234`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
@@ -104,10 +104,10 @@ class ListGroupStatsRequest extends \Google\Protobuf\Internal\Message
*
* @type string $project_name
* Required. The resource name of the Google Cloud Platform project. Written
- * as projects/
plus the
- * Google Cloud
- * Platform project ID.
- * Example: projects/my-project-123
.
+ * as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
+ * and `{projectNumber}` can be found in the
+ * [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
+ * Examples: `projects/my-project-123`, `projects/5551234`.
* @type string[]|\Google\Protobuf\Internal\RepeatedField $group_id
* Optional. List all ErrorGroupStats
with these IDs.
* @type \Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter $service_filter
@@ -151,10 +151,10 @@ public function __construct($data = NULL) {
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as projects/
plus the
- * Google Cloud
- * Platform project ID.
- * Example: projects/my-project-123
.
+ * as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
+ * and `{projectNumber}` can be found in the
+ * [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
+ * Examples: `projects/my-project-123`, `projects/5551234`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
* @return string
@@ -166,10 +166,10 @@ public function getProjectName()
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as projects/
plus the
- * Google Cloud
- * Platform project ID.
- * Example: projects/my-project-123
.
+ * as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}`
+ * and `{projectNumber}` can be found in the
+ * [Google Cloud Console](https://support.google.com/cloud/answer/6158840).
+ * Examples: `projects/my-project-123`, `projects/5551234`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
* @param string $var
@@ -215,11 +215,11 @@ public function setGroupId($var)
* Data for all service contexts is returned if this field is not specified.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ServiceContextFilter service_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContextFilter|null
*/
public function getServiceFilter()
{
- return isset($this->service_filter) ? $this->service_filter : null;
+ return $this->service_filter;
}
public function hasServiceFilter()
@@ -260,11 +260,11 @@ public function setServiceFilter($var)
* ErrorGroupStats
with zero occurrences are returned.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.QueryTimeRange time_range = 5 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange
+ * @return \Google\Cloud\ErrorReporting\V1beta1\QueryTimeRange|null
*/
public function getTimeRange()
{
- return isset($this->time_range) ? $this->time_range : null;
+ return $this->time_range;
}
public function hasTimeRange()
@@ -304,11 +304,11 @@ public function setTimeRange($var)
* If not set, no timed counts are returned.
*
* Generated from protobuf field .google.protobuf.Duration timed_count_duration = 6 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Protobuf\Duration
+ * @return \Google\Protobuf\Duration|null
*/
public function getTimedCountDuration()
{
- return isset($this->timed_count_duration) ? $this->timed_count_duration : null;
+ return $this->timed_count_duration;
}
public function hasTimedCountDuration()
@@ -370,11 +370,11 @@ public function setAlignment($var)
* alignment is chosen. Default is 00:00 UTC.
*
* Generated from protobuf field .google.protobuf.Timestamp alignment_time = 8 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getAlignmentTime()
{
- return isset($this->alignment_time) ? $this->alignment_time : null;
+ return $this->alignment_time;
}
public function hasAlignmentTime()
diff --git a/ErrorReporting/src/V1beta1/ListGroupStatsResponse.php b/ErrorReporting/src/V1beta1/ListGroupStatsResponse.php
index af3990345a47..06c7bb67a3f5 100644
--- a/ErrorReporting/src/V1beta1/ListGroupStatsResponse.php
+++ b/ErrorReporting/src/V1beta1/ListGroupStatsResponse.php
@@ -126,11 +126,11 @@ public function setNextPageToken($var)
* has been deleted.
*
* Generated from protobuf field .google.protobuf.Timestamp time_range_begin = 4;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getTimeRangeBegin()
{
- return isset($this->time_range_begin) ? $this->time_range_begin : null;
+ return $this->time_range_begin;
}
public function hasTimeRangeBegin()
diff --git a/ErrorReporting/src/V1beta1/ReportErrorEventRequest.php b/ErrorReporting/src/V1beta1/ReportErrorEventRequest.php
index 903ee9a1ecc4..8de6dc3a08f9 100644
--- a/ErrorReporting/src/V1beta1/ReportErrorEventRequest.php
+++ b/ErrorReporting/src/V1beta1/ReportErrorEventRequest.php
@@ -17,10 +17,10 @@ class ReportErrorEventRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectId}`, where `{projectId}` is the
* [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840). Example:
- * `projects/my-project-123`.
+ * ID](https://support.google.com/cloud/answer/6158840).
+ * Example: // `projects/my-project-123`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
*/
@@ -40,10 +40,10 @@ class ReportErrorEventRequest extends \Google\Protobuf\Internal\Message
*
* @type string $project_name
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectId}`, where `{projectId}` is the
* [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840). Example:
- * `projects/my-project-123`.
+ * ID](https://support.google.com/cloud/answer/6158840).
+ * Example: // `projects/my-project-123`.
* @type \Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent $event
* Required. The error event to be reported.
* }
@@ -55,10 +55,10 @@ public function __construct($data = NULL) {
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectId}`, where `{projectId}` is the
* [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840). Example:
- * `projects/my-project-123`.
+ * ID](https://support.google.com/cloud/answer/6158840).
+ * Example: // `projects/my-project-123`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
* @return string
@@ -70,10 +70,10 @@ public function getProjectName()
/**
* Required. The resource name of the Google Cloud Platform project. Written
- * as `projects/` plus the
+ * as `projects/{projectId}`, where `{projectId}` is the
* [Google Cloud Platform project
- * ID](https://support.google.com/cloud/answer/6158840). Example:
- * `projects/my-project-123`.
+ * ID](https://support.google.com/cloud/answer/6158840).
+ * Example: // `projects/my-project-123`.
*
* Generated from protobuf field string project_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
* @param string $var
@@ -91,11 +91,11 @@ public function setProjectName($var)
* Required. The error event to be reported.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent event = 2 [(.google.api.field_behavior) = REQUIRED];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent|null
*/
public function getEvent()
{
- return isset($this->event) ? $this->event : null;
+ return $this->event;
}
public function hasEvent()
diff --git a/ErrorReporting/src/V1beta1/ReportErrorsServiceClient.php b/ErrorReporting/src/V1beta1/ReportErrorsServiceClient.php
index e0d5d4e897c1..9b3a67581c71 100644
--- a/ErrorReporting/src/V1beta1/ReportErrorsServiceClient.php
+++ b/ErrorReporting/src/V1beta1/ReportErrorsServiceClient.php
@@ -17,9 +17,9 @@
/*
* GENERATED CODE WARNING
- * This file was generated from the file
- * https://github.com/google/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto
- * and updates to that file get reflected here through a refresh process.
+ * Generated by gapic-generator-php from the file
+ * https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/report_errors_service.proto
+ * Updates to the above are reflected here through a refresh process.
*
* @experimental
*/
@@ -28,11 +28,9 @@
use Google\Cloud\ErrorReporting\V1beta1\Gapic\ReportErrorsServiceGapicClient;
-/**
- * {@inheritdoc}
- */
+/** {@inheritdoc} */
class ReportErrorsServiceClient extends ReportErrorsServiceGapicClient
{
- // This class is intentionally empty, and is intended to hold manual
- // additions to the generated {@see ReportErrorsServiceGapicClient} class.
+ // This class is intentionally empty, and is intended to hold manual additions to
+ // the generated {@see ReportErrorsServiceGapicClient} class.
}
diff --git a/ErrorReporting/src/V1beta1/ReportErrorsServiceGrpcClient.php b/ErrorReporting/src/V1beta1/ReportErrorsServiceGrpcClient.php
index ae0957983d5f..f29acd0d28ad 100644
--- a/ErrorReporting/src/V1beta1/ReportErrorsServiceGrpcClient.php
+++ b/ErrorReporting/src/V1beta1/ReportErrorsServiceGrpcClient.php
@@ -2,7 +2,7 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
-// Copyright 2019 Google LLC.
+// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
namespace Google\Cloud\ErrorReporting\V1beta1;
/**
@@ -34,7 +33,7 @@ public function __construct($hostname, $opts, $channel = null) {
}
/**
- * Report an individual error event.
+ * Report an individual error event and record the event to a log.
*
* This endpoint accepts **either** an OAuth token,
* **or** an [API key](https://support.google.com/cloud/answer/6158862)
@@ -42,7 +41,15 @@ public function __construct($hostname, $opts, $channel = null) {
* a `key` parameter. For example:
*
* `POST
- * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456`
+ * https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456`
+ *
+ * **Note:** [Error Reporting](https://cloud.google.com/error-reporting) is a global service built
+ * on Cloud Logging and doesn't analyze logs stored
+ * in regional log buckets or logs routed to other Google Cloud projects.
+ *
+ * For more information, see
+ * [Using Error Reporting with regionalized
+ * logs](https://cloud.google.com/error-reporting/docs/regionalization).
* @param \Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventRequest $argument input argument
* @param array $metadata metadata
* @param array $options call options
diff --git a/ErrorReporting/src/V1beta1/ReportedErrorEvent.php b/ErrorReporting/src/V1beta1/ReportedErrorEvent.php
index 2d56e3262104..7f04857ddc66 100644
--- a/ErrorReporting/src/V1beta1/ReportedErrorEvent.php
+++ b/ErrorReporting/src/V1beta1/ReportedErrorEvent.php
@@ -115,11 +115,11 @@ public function __construct($data = NULL) {
* Error Reporting system will be used.
*
* Generated from protobuf field .google.protobuf.Timestamp event_time = 1 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getEventTime()
{
- return isset($this->event_time) ? $this->event_time : null;
+ return $this->event_time;
}
public function hasEventTime()
@@ -153,11 +153,11 @@ public function setEventTime($var)
* Required. The service context in which this error has occurred.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ServiceContext service_context = 2 [(.google.api.field_behavior) = REQUIRED];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContext
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ServiceContext|null
*/
public function getServiceContext()
{
- return isset($this->service_context) ? $this->service_context : null;
+ return $this->service_context;
}
public function hasServiceContext()
@@ -259,11 +259,11 @@ public function setMessage($var)
* Optional. A description of the context in which the error occurred.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ErrorContext context = 4 [(.google.api.field_behavior) = OPTIONAL];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorContext
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorContext|null
*/
public function getContext()
{
- return isset($this->context) ? $this->context : null;
+ return $this->context;
}
public function hasContext()
diff --git a/ErrorReporting/src/V1beta1/ResolutionStatus.php b/ErrorReporting/src/V1beta1/ResolutionStatus.php
new file mode 100644
index 000000000000..a50feb043ec5
--- /dev/null
+++ b/ErrorReporting/src/V1beta1/ResolutionStatus.php
@@ -0,0 +1,78 @@
+google.devtools.clouderrorreporting.v1beta1.ResolutionStatus
+ */
+class ResolutionStatus
+{
+ /**
+ * Status is unknown. When left unspecified in requests, it is treated like
+ * OPEN.
+ *
+ * Generated from protobuf enum RESOLUTION_STATUS_UNSPECIFIED = 0;
+ */
+ const RESOLUTION_STATUS_UNSPECIFIED = 0;
+ /**
+ * The error group is not being addressed. This is the default for
+ * new groups. It is also used for errors re-occurring after marked RESOLVED.
+ *
+ * Generated from protobuf enum OPEN = 1;
+ */
+ const OPEN = 1;
+ /**
+ * Error Group manually acknowledged, it can have an issue link attached.
+ *
+ * Generated from protobuf enum ACKNOWLEDGED = 2;
+ */
+ const ACKNOWLEDGED = 2;
+ /**
+ * Error Group manually resolved, more events for this group are not expected
+ * to occur.
+ *
+ * Generated from protobuf enum RESOLVED = 3;
+ */
+ const RESOLVED = 3;
+ /**
+ * The error group is muted and excluded by default on group stats requests.
+ *
+ * Generated from protobuf enum MUTED = 4;
+ */
+ const MUTED = 4;
+
+ private static $valueToName = [
+ self::RESOLUTION_STATUS_UNSPECIFIED => 'RESOLUTION_STATUS_UNSPECIFIED',
+ self::OPEN => 'OPEN',
+ self::ACKNOWLEDGED => 'ACKNOWLEDGED',
+ self::RESOLVED => 'RESOLVED',
+ self::MUTED => 'MUTED',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
diff --git a/ErrorReporting/src/V1beta1/TimedCount.php b/ErrorReporting/src/V1beta1/TimedCount.php
index 852b13da2b5b..e0a3875fd5a5 100644
--- a/ErrorReporting/src/V1beta1/TimedCount.php
+++ b/ErrorReporting/src/V1beta1/TimedCount.php
@@ -85,11 +85,11 @@ public function setCount($var)
* Start of the time period to which `count` refers (included).
*
* Generated from protobuf field .google.protobuf.Timestamp start_time = 2;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getStartTime()
{
- return isset($this->start_time) ? $this->start_time : null;
+ return $this->start_time;
}
public function hasStartTime()
@@ -121,11 +121,11 @@ public function setStartTime($var)
* End of the time period to which `count` refers (excluded).
*
* Generated from protobuf field .google.protobuf.Timestamp end_time = 3;
- * @return \Google\Protobuf\Timestamp
+ * @return \Google\Protobuf\Timestamp|null
*/
public function getEndTime()
{
- return isset($this->end_time) ? $this->end_time : null;
+ return $this->end_time;
}
public function hasEndTime()
diff --git a/ErrorReporting/src/V1beta1/UpdateGroupRequest.php b/ErrorReporting/src/V1beta1/UpdateGroupRequest.php
index bcb5ee437bfa..7863ea9d1138 100644
--- a/ErrorReporting/src/V1beta1/UpdateGroupRequest.php
+++ b/ErrorReporting/src/V1beta1/UpdateGroupRequest.php
@@ -41,11 +41,11 @@ public function __construct($data = NULL) {
* Required. The group which replaces the resource on the server.
*
* Generated from protobuf field .google.devtools.clouderrorreporting.v1beta1.ErrorGroup group = 1 [(.google.api.field_behavior) = REQUIRED];
- * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup
+ * @return \Google\Cloud\ErrorReporting\V1beta1\ErrorGroup|null
*/
public function getGroup()
{
- return isset($this->group) ? $this->group : null;
+ return $this->group;
}
public function hasGroup()
diff --git a/ErrorReporting/src/V1beta1/gapic_metadata.json b/ErrorReporting/src/V1beta1/gapic_metadata.json
new file mode 100644
index 000000000000..8f2d0ccc76b5
--- /dev/null
+++ b/ErrorReporting/src/V1beta1/gapic_metadata.json
@@ -0,0 +1,66 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods",
+ "language": "php",
+ "protoPackage": "google.devtools.clouderrorreporting.v1beta1",
+ "libraryPackage": "Google\\Cloud\\ErrorReporting\\V1beta1",
+ "services": {
+ "ErrorGroupService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ErrorGroupServiceGapicClient",
+ "rpcs": {
+ "GetGroup": {
+ "methods": [
+ "getGroup"
+ ]
+ },
+ "UpdateGroup": {
+ "methods": [
+ "updateGroup"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "ErrorStatsService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ErrorStatsServiceGapicClient",
+ "rpcs": {
+ "DeleteEvents": {
+ "methods": [
+ "deleteEvents"
+ ]
+ },
+ "ListEvents": {
+ "methods": [
+ "listEvents"
+ ]
+ },
+ "ListGroupStats": {
+ "methods": [
+ "listGroupStats"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "ReportErrorsService": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ReportErrorsServiceGapicClient",
+ "rpcs": {
+ "ReportErrorEvent": {
+ "methods": [
+ "reportErrorEvent"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/ErrorReporting/src/V1beta1/resources/error_group_service_client_config.json b/ErrorReporting/src/V1beta1/resources/error_group_service_client_config.json
index 8799b344139c..40af7ebab8d5 100644
--- a/ErrorReporting/src/V1beta1/resources/error_group_service_client_config.json
+++ b/ErrorReporting/src/V1beta1/resources/error_group_service_client_config.json
@@ -1,45 +1,45 @@
{
- "interfaces": {
- "google.devtools.clouderrorreporting.v1beta1.ErrorGroupService": {
- "retry_codes": {
- "retry_policy_1_codes": [
- "UNAVAILABLE",
- "DEADLINE_EXCEEDED"
- ],
- "no_retry_codes": []
- },
- "retry_params": {
- "retry_policy_1_params": {
- "initial_retry_delay_millis": 100,
- "retry_delay_multiplier": 1.3,
- "max_retry_delay_millis": 60000,
- "initial_rpc_timeout_millis": 600000,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 600000,
- "total_timeout_millis": 600000
- },
- "no_retry_params": {
- "initial_retry_delay_millis": 0,
- "retry_delay_multiplier": 0.0,
- "max_retry_delay_millis": 0,
- "initial_rpc_timeout_millis": 0,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 0,
- "total_timeout_millis": 0
+ "interfaces": {
+ "google.devtools.clouderrorreporting.v1beta1.ErrorGroupService": {
+ "retry_codes": {
+ "no_retry_codes": [],
+ "retry_policy_1_codes": [
+ "UNAVAILABLE",
+ "DEADLINE_EXCEEDED"
+ ]
+ },
+ "retry_params": {
+ "no_retry_params": {
+ "initial_retry_delay_millis": 0,
+ "retry_delay_multiplier": 0.0,
+ "max_retry_delay_millis": 0,
+ "initial_rpc_timeout_millis": 0,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 0,
+ "total_timeout_millis": 0
+ },
+ "retry_policy_1_params": {
+ "initial_retry_delay_millis": 100,
+ "retry_delay_multiplier": 1.3,
+ "max_retry_delay_millis": 60000,
+ "initial_rpc_timeout_millis": 600000,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 600000,
+ "total_timeout_millis": 600000
+ }
+ },
+ "methods": {
+ "GetGroup": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
+ "UpdateGroup": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ }
+ }
}
- },
- "methods": {
- "UpdateGroup": {
- "timeout_millis": 600000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- },
- "GetGroup": {
- "timeout_millis": 600000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- }
- }
}
- }
}
diff --git a/ErrorReporting/src/V1beta1/resources/error_group_service_descriptor_config.php b/ErrorReporting/src/V1beta1/resources/error_group_service_descriptor_config.php
index 3a89cb7b4ca8..2e9c68889066 100644
--- a/ErrorReporting/src/V1beta1/resources/error_group_service_descriptor_config.php
+++ b/ErrorReporting/src/V1beta1/resources/error_group_service_descriptor_config.php
@@ -2,7 +2,6 @@
return [
'interfaces' => [
- 'google.devtools.clouderrorreporting.v1beta1.ErrorGroupService' => [
- ],
+ 'google.devtools.clouderrorreporting.v1beta1.ErrorGroupService' => [],
],
];
diff --git a/ErrorReporting/src/V1beta1/resources/error_group_service_rest_client_config.php b/ErrorReporting/src/V1beta1/resources/error_group_service_rest_client_config.php
index 5813382303e8..8660657af11a 100644
--- a/ErrorReporting/src/V1beta1/resources/error_group_service_rest_client_config.php
+++ b/ErrorReporting/src/V1beta1/resources/error_group_service_rest_client_config.php
@@ -3,6 +3,17 @@
return [
'interfaces' => [
'google.devtools.clouderrorreporting.v1beta1.ErrorGroupService' => [
+ 'GetGroup' => [
+ 'method' => 'get',
+ 'uriTemplate' => '/v1beta1/{group_name=projects/*/groups/*}',
+ 'placeholders' => [
+ 'group_name' => [
+ 'getters' => [
+ 'getGroupName',
+ ],
+ ],
+ ],
+ ],
'UpdateGroup' => [
'method' => 'put',
'uriTemplate' => '/v1beta1/{group.name=projects/*/groups/*}',
@@ -16,17 +27,6 @@
],
],
],
- 'GetGroup' => [
- 'method' => 'get',
- 'uriTemplate' => '/v1beta1/{group_name=projects/*/groups/*}',
- 'placeholders' => [
- 'group_name' => [
- 'getters' => [
- 'getGroupName',
- ],
- ],
- ],
- ],
],
],
];
diff --git a/ErrorReporting/src/V1beta1/resources/error_stats_service_client_config.json b/ErrorReporting/src/V1beta1/resources/error_stats_service_client_config.json
index 7c848682a0ff..0a7501188091 100644
--- a/ErrorReporting/src/V1beta1/resources/error_stats_service_client_config.json
+++ b/ErrorReporting/src/V1beta1/resources/error_stats_service_client_config.json
@@ -1,50 +1,50 @@
{
- "interfaces": {
- "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService": {
- "retry_codes": {
- "retry_policy_1_codes": [
- "UNAVAILABLE",
- "DEADLINE_EXCEEDED"
- ],
- "no_retry_codes": []
- },
- "retry_params": {
- "retry_policy_1_params": {
- "initial_retry_delay_millis": 100,
- "retry_delay_multiplier": 1.3,
- "max_retry_delay_millis": 60000,
- "initial_rpc_timeout_millis": 600000,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 600000,
- "total_timeout_millis": 600000
- },
- "no_retry_params": {
- "initial_retry_delay_millis": 0,
- "retry_delay_multiplier": 0.0,
- "max_retry_delay_millis": 0,
- "initial_rpc_timeout_millis": 0,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 0,
- "total_timeout_millis": 0
+ "interfaces": {
+ "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService": {
+ "retry_codes": {
+ "no_retry_codes": [],
+ "retry_policy_1_codes": [
+ "UNAVAILABLE",
+ "DEADLINE_EXCEEDED"
+ ]
+ },
+ "retry_params": {
+ "no_retry_params": {
+ "initial_retry_delay_millis": 0,
+ "retry_delay_multiplier": 0.0,
+ "max_retry_delay_millis": 0,
+ "initial_rpc_timeout_millis": 0,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 0,
+ "total_timeout_millis": 0
+ },
+ "retry_policy_1_params": {
+ "initial_retry_delay_millis": 100,
+ "retry_delay_multiplier": 1.3,
+ "max_retry_delay_millis": 60000,
+ "initial_rpc_timeout_millis": 600000,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 600000,
+ "total_timeout_millis": 600000
+ }
+ },
+ "methods": {
+ "DeleteEvents": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
+ "ListEvents": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
+ "ListGroupStats": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ }
+ }
}
- },
- "methods": {
- "DeleteEvents": {
- "timeout_millis": 600000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- },
- "ListGroupStats": {
- "timeout_millis": 600000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- },
- "ListEvents": {
- "timeout_millis": 600000,
- "retry_codes_name": "retry_policy_1_codes",
- "retry_params_name": "retry_policy_1_params"
- }
- }
}
- }
}
diff --git a/ErrorReporting/src/V1beta1/resources/error_stats_service_descriptor_config.php b/ErrorReporting/src/V1beta1/resources/error_stats_service_descriptor_config.php
index 3e892a7ac884..35148865a5eb 100644
--- a/ErrorReporting/src/V1beta1/resources/error_stats_service_descriptor_config.php
+++ b/ErrorReporting/src/V1beta1/resources/error_stats_service_descriptor_config.php
@@ -3,24 +3,24 @@
return [
'interfaces' => [
'google.devtools.clouderrorreporting.v1beta1.ErrorStatsService' => [
- 'ListGroupStats' => [
+ 'ListEvents' => [
'pageStreaming' => [
'requestPageTokenGetMethod' => 'getPageToken',
'requestPageTokenSetMethod' => 'setPageToken',
'requestPageSizeGetMethod' => 'getPageSize',
'requestPageSizeSetMethod' => 'setPageSize',
'responsePageTokenGetMethod' => 'getNextPageToken',
- 'resourcesGetMethod' => 'getErrorGroupStats',
+ 'resourcesGetMethod' => 'getErrorEvents',
],
],
- 'ListEvents' => [
+ 'ListGroupStats' => [
'pageStreaming' => [
'requestPageTokenGetMethod' => 'getPageToken',
'requestPageTokenSetMethod' => 'setPageToken',
'requestPageSizeGetMethod' => 'getPageSize',
'requestPageSizeSetMethod' => 'setPageSize',
'responsePageTokenGetMethod' => 'getNextPageToken',
- 'resourcesGetMethod' => 'getErrorEvents',
+ 'resourcesGetMethod' => 'getErrorGroupStats',
],
],
],
diff --git a/ErrorReporting/src/V1beta1/resources/error_stats_service_rest_client_config.php b/ErrorReporting/src/V1beta1/resources/error_stats_service_rest_client_config.php
index 7be9586f8a7d..57064b872a4e 100644
--- a/ErrorReporting/src/V1beta1/resources/error_stats_service_rest_client_config.php
+++ b/ErrorReporting/src/V1beta1/resources/error_stats_service_rest_client_config.php
@@ -14,9 +14,9 @@
],
],
],
- 'ListGroupStats' => [
+ 'ListEvents' => [
'method' => 'get',
- 'uriTemplate' => '/v1beta1/{project_name=projects/*}/groupStats',
+ 'uriTemplate' => '/v1beta1/{project_name=projects/*}/events',
'placeholders' => [
'project_name' => [
'getters' => [
@@ -24,10 +24,13 @@
],
],
],
+ 'queryParams' => [
+ 'group_id',
+ ],
],
- 'ListEvents' => [
+ 'ListGroupStats' => [
'method' => 'get',
- 'uriTemplate' => '/v1beta1/{project_name=projects/*}/events',
+ 'uriTemplate' => '/v1beta1/{project_name=projects/*}/groupStats',
'placeholders' => [
'project_name' => [
'getters' => [
diff --git a/ErrorReporting/src/V1beta1/resources/report_errors_service_client_config.json b/ErrorReporting/src/V1beta1/resources/report_errors_service_client_config.json
index 55b9ca628b6c..701d5afb9615 100644
--- a/ErrorReporting/src/V1beta1/resources/report_errors_service_client_config.json
+++ b/ErrorReporting/src/V1beta1/resources/report_errors_service_client_config.json
@@ -1,37 +1,37 @@
{
- "interfaces": {
- "google.devtools.clouderrorreporting.v1beta1.ReportErrorsService": {
- "retry_codes": {
- "no_retry_codes": [],
- "no_retry_1_codes": []
- },
- "retry_params": {
- "no_retry_params": {
- "initial_retry_delay_millis": 0,
- "retry_delay_multiplier": 0.0,
- "max_retry_delay_millis": 0,
- "initial_rpc_timeout_millis": 0,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 0,
- "total_timeout_millis": 0
- },
- "no_retry_1_params": {
- "initial_retry_delay_millis": 0,
- "retry_delay_multiplier": 0.0,
- "max_retry_delay_millis": 0,
- "initial_rpc_timeout_millis": 600000,
- "rpc_timeout_multiplier": 1.0,
- "max_rpc_timeout_millis": 600000,
- "total_timeout_millis": 600000
+ "interfaces": {
+ "google.devtools.clouderrorreporting.v1beta1.ReportErrorsService": {
+ "retry_codes": {
+ "no_retry_codes": [],
+ "no_retry_1_codes": []
+ },
+ "retry_params": {
+ "no_retry_params": {
+ "initial_retry_delay_millis": 0,
+ "retry_delay_multiplier": 0.0,
+ "max_retry_delay_millis": 0,
+ "initial_rpc_timeout_millis": 0,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 0,
+ "total_timeout_millis": 0
+ },
+ "no_retry_1_params": {
+ "initial_retry_delay_millis": 0,
+ "retry_delay_multiplier": 0.0,
+ "max_retry_delay_millis": 0,
+ "initial_rpc_timeout_millis": 600000,
+ "rpc_timeout_multiplier": 1.0,
+ "max_rpc_timeout_millis": 600000,
+ "total_timeout_millis": 600000
+ }
+ },
+ "methods": {
+ "ReportErrorEvent": {
+ "timeout_millis": 600000,
+ "retry_codes_name": "no_retry_1_codes",
+ "retry_params_name": "no_retry_1_params"
+ }
+ }
}
- },
- "methods": {
- "ReportErrorEvent": {
- "timeout_millis": 600000,
- "retry_codes_name": "no_retry_1_codes",
- "retry_params_name": "no_retry_1_params"
- }
- }
}
- }
}
diff --git a/ErrorReporting/src/V1beta1/resources/report_errors_service_descriptor_config.php b/ErrorReporting/src/V1beta1/resources/report_errors_service_descriptor_config.php
index f24982788ee1..52aefb0c1051 100644
--- a/ErrorReporting/src/V1beta1/resources/report_errors_service_descriptor_config.php
+++ b/ErrorReporting/src/V1beta1/resources/report_errors_service_descriptor_config.php
@@ -2,7 +2,6 @@
return [
'interfaces' => [
- 'google.devtools.clouderrorreporting.v1beta1.ReportErrorsService' => [
- ],
+ 'google.devtools.clouderrorreporting.v1beta1.ReportErrorsService' => [],
],
];
diff --git a/ErrorReporting/tests/Unit/V1beta1/ErrorGroupServiceClientTest.php b/ErrorReporting/tests/Unit/V1beta1/ErrorGroupServiceClientTest.php
index 45c745c160dc..e945dcc4cdab 100644
--- a/ErrorReporting/tests/Unit/V1beta1/ErrorGroupServiceClientTest.php
+++ b/ErrorReporting/tests/Unit/V1beta1/ErrorGroupServiceClientTest.php
@@ -22,18 +22,19 @@
namespace Google\Cloud\ErrorReporting\Tests\Unit\V1beta1;
-use Google\Cloud\ErrorReporting\V1beta1\ErrorGroupServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\Testing\GeneratedTest;
+
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\ErrorReporting\V1beta1\ErrorGroup;
-use Google\Protobuf\Any;
+use Google\Cloud\ErrorReporting\V1beta1\ErrorGroupServiceClient;
use Google\Rpc\Code;
use stdClass;
/**
* @group errorreporting
+ *
* @group gapic
*/
class ErrorGroupServiceClientTest extends GeneratedTest
@@ -51,9 +52,7 @@ private function createTransport($deserialize = null)
*/
private function createCredentials()
{
- return $this->getMockBuilder(CredentialsWrapper::class)
- ->disableOriginalConstructor()
- ->getMock();
+ return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock();
}
/**
@@ -64,20 +63,19 @@ private function createClient(array $options = [])
$options += [
'credentials' => $this->createCredentials(),
];
-
return new ErrorGroupServiceClient($options);
}
/**
* @test
*/
- public function updateGroupTest()
+ public function getGroupTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$name = 'name3373707';
$groupId = 'groupId506361563';
@@ -85,59 +83,50 @@ public function updateGroupTest()
$expectedResponse->setName($name);
$expectedResponse->setGroupId($groupId);
$transport->addResponse($expectedResponse);
-
// Mock request
- $group = new ErrorGroup();
-
- $response = $client->updateGroup($group);
+ $formattedGroupName = $client->errorGroupName('[PROJECT]', '[GROUP]');
+ $response = $client->getGroup($formattedGroupName);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup', $actualFuncCall);
-
- $actualValue = $actualRequestObject->getGroup();
-
- $this->assertProtobufEquals($group, $actualValue);
-
+ $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup', $actualFuncCall);
+ $actualValue = $actualRequestObject->getGroupName();
+ $this->assertProtobufEquals($formattedGroupName, $actualValue);
$this->assertTrue($transport->isExhausted());
}
/**
* @test
*/
- public function updateGroupExceptionTest()
+ public function getGroupExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
- $group = new ErrorGroup();
-
+ $formattedGroupName = $client->errorGroupName('[PROJECT]', '[GROUP]');
try {
- $client->updateGroup($group);
+ $client->getGroup($formattedGroupName);
// If the $client method call did not throw, fail the test
$this->fail('Expected an ApiException, but no exception was thrown.');
} catch (ApiException $ex) {
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());
@@ -146,13 +135,13 @@ public function updateGroupExceptionTest()
/**
* @test
*/
- public function getGroupTest()
+ public function updateGroupTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$name = 'name3373707';
$groupId = 'groupId506361563';
@@ -160,59 +149,50 @@ public function getGroupTest()
$expectedResponse->setName($name);
$expectedResponse->setGroupId($groupId);
$transport->addResponse($expectedResponse);
-
// Mock request
- $formattedGroupName = $client->errorGroupName('[PROJECT]', '[GROUP]');
-
- $response = $client->getGroup($formattedGroupName);
+ $group = new ErrorGroup();
+ $response = $client->updateGroup($group);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup', $actualFuncCall);
-
- $actualValue = $actualRequestObject->getGroupName();
-
- $this->assertProtobufEquals($formattedGroupName, $actualValue);
-
+ $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup', $actualFuncCall);
+ $actualValue = $actualRequestObject->getGroup();
+ $this->assertProtobufEquals($group, $actualValue);
$this->assertTrue($transport->isExhausted());
}
/**
* @test
*/
- public function getGroupExceptionTest()
+ public function updateGroupExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
- $formattedGroupName = $client->errorGroupName('[PROJECT]', '[GROUP]');
-
+ $group = new ErrorGroup();
try {
- $client->getGroup($formattedGroupName);
+ $client->updateGroup($group);
// If the $client method call did not throw, fail the test
$this->fail('Expected an ApiException, but no exception was thrown.');
} catch (ApiException $ex) {
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());
diff --git a/ErrorReporting/tests/Unit/V1beta1/ErrorStatsServiceClientTest.php b/ErrorReporting/tests/Unit/V1beta1/ErrorStatsServiceClientTest.php
index 0f1e4238ddfc..7d3c9f890b9f 100644
--- a/ErrorReporting/tests/Unit/V1beta1/ErrorStatsServiceClientTest.php
+++ b/ErrorReporting/tests/Unit/V1beta1/ErrorStatsServiceClientTest.php
@@ -22,22 +22,23 @@
namespace Google\Cloud\ErrorReporting\Tests\Unit\V1beta1;
-use Google\Cloud\ErrorReporting\V1beta1\ErrorStatsServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\Testing\GeneratedTest;
+
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\ErrorReporting\V1beta1\DeleteEventsResponse;
use Google\Cloud\ErrorReporting\V1beta1\ErrorEvent;
use Google\Cloud\ErrorReporting\V1beta1\ErrorGroupStats;
+use Google\Cloud\ErrorReporting\V1beta1\ErrorStatsServiceClient;
use Google\Cloud\ErrorReporting\V1beta1\ListEventsResponse;
use Google\Cloud\ErrorReporting\V1beta1\ListGroupStatsResponse;
-use Google\Protobuf\Any;
use Google\Rpc\Code;
use stdClass;
/**
* @group errorreporting
+ *
* @group gapic
*/
class ErrorStatsServiceClientTest extends GeneratedTest
@@ -55,9 +56,7 @@ private function createTransport($deserialize = null)
*/
private function createCredentials()
{
- return $this->getMockBuilder(CredentialsWrapper::class)
- ->disableOriginalConstructor()
- ->getMock();
+ return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock();
}
/**
@@ -68,7 +67,6 @@ private function createClient(array $options = [])
$options += [
'credentials' => $this->createCredentials(),
];
-
return new ErrorStatsServiceClient($options);
}
@@ -78,17 +76,15 @@ private function createClient(array $options = [])
public function deleteEventsTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$expectedResponse = new DeleteEventsResponse();
$transport->addResponse($expectedResponse);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
-
$response = $client->deleteEvents($formattedProjectName);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -96,11 +92,8 @@ public function deleteEventsTest()
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
$this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/DeleteEvents', $actualFuncCall);
-
$actualValue = $actualRequestObject->getProjectName();
-
$this->assertProtobufEquals($formattedProjectName, $actualValue);
-
$this->assertTrue($transport->isExhausted());
}
@@ -110,25 +103,22 @@ public function deleteEventsTest()
public function deleteEventsExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
-
try {
$client->deleteEvents($formattedProjectName);
// If the $client method call did not throw, fail the test
@@ -137,7 +127,6 @@ public function deleteEventsExceptionTest()
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());
@@ -146,77 +135,74 @@ public function deleteEventsExceptionTest()
/**
* @test
*/
- public function listGroupStatsTest()
+ public function listEventsTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$nextPageToken = '';
- $errorGroupStatsElement = new ErrorGroupStats();
- $errorGroupStats = [$errorGroupStatsElement];
- $expectedResponse = new ListGroupStatsResponse();
+ $errorEventsElement = new ErrorEvent();
+ $errorEvents = [
+ $errorEventsElement,
+ ];
+ $expectedResponse = new ListEventsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setErrorGroupStats($errorGroupStats);
+ $expectedResponse->setErrorEvents($errorEvents);
$transport->addResponse($expectedResponse);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
-
- $response = $client->listGroupStats($formattedProjectName);
+ $groupId = 'groupId506361563';
+ $response = $client->listEvents($formattedProjectName, $groupId);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
$this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getErrorGroupStats()[0], $resources[0]);
-
+ $this->assertEquals($expectedResponse->getErrorEvents()[0], $resources[0]);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats', $actualFuncCall);
-
+ $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents', $actualFuncCall);
$actualValue = $actualRequestObject->getProjectName();
-
$this->assertProtobufEquals($formattedProjectName, $actualValue);
+ $actualValue = $actualRequestObject->getGroupId();
+ $this->assertProtobufEquals($groupId, $actualValue);
$this->assertTrue($transport->isExhausted());
}
/**
* @test
*/
- public function listGroupStatsExceptionTest()
+ public function listEventsExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
-
+ $groupId = 'groupId506361563';
try {
- $client->listGroupStats($formattedProjectName);
+ $client->listEvents($formattedProjectName, $groupId);
// If the $client method call did not throw, fail the test
$this->fail('Expected an ApiException, but no exception was thrown.');
} catch (ApiException $ex) {
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());
@@ -225,82 +211,70 @@ public function listGroupStatsExceptionTest()
/**
* @test
*/
- public function listEventsTest()
+ public function listGroupStatsTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$nextPageToken = '';
- $errorEventsElement = new ErrorEvent();
- $errorEvents = [$errorEventsElement];
- $expectedResponse = new ListEventsResponse();
+ $errorGroupStatsElement = new ErrorGroupStats();
+ $errorGroupStats = [
+ $errorGroupStatsElement,
+ ];
+ $expectedResponse = new ListGroupStatsResponse();
$expectedResponse->setNextPageToken($nextPageToken);
- $expectedResponse->setErrorEvents($errorEvents);
+ $expectedResponse->setErrorGroupStats($errorGroupStats);
$transport->addResponse($expectedResponse);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
- $groupId = 'groupId506361563';
-
- $response = $client->listEvents($formattedProjectName, $groupId);
+ $response = $client->listGroupStats($formattedProjectName);
$this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
$resources = iterator_to_array($response->iterateAllElements());
$this->assertSame(1, count($resources));
- $this->assertEquals($expectedResponse->getErrorEvents()[0], $resources[0]);
-
+ $this->assertEquals($expectedResponse->getErrorGroupStats()[0], $resources[0]);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
- $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents', $actualFuncCall);
-
+ $this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats', $actualFuncCall);
$actualValue = $actualRequestObject->getProjectName();
-
$this->assertProtobufEquals($formattedProjectName, $actualValue);
- $actualValue = $actualRequestObject->getGroupId();
-
- $this->assertProtobufEquals($groupId, $actualValue);
$this->assertTrue($transport->isExhausted());
}
/**
* @test
*/
- public function listEventsExceptionTest()
+ public function listGroupStatsExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
- $groupId = 'groupId506361563';
-
try {
- $client->listEvents($formattedProjectName, $groupId);
+ $client->listGroupStats($formattedProjectName);
// If the $client method call did not throw, fail the test
$this->fail('Expected an ApiException, but no exception was thrown.');
} catch (ApiException $ex) {
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());
diff --git a/ErrorReporting/tests/Unit/V1beta1/ReportErrorsServiceClientTest.php b/ErrorReporting/tests/Unit/V1beta1/ReportErrorsServiceClientTest.php
index 24761374fc65..136f0c9cc58e 100644
--- a/ErrorReporting/tests/Unit/V1beta1/ReportErrorsServiceClientTest.php
+++ b/ErrorReporting/tests/Unit/V1beta1/ReportErrorsServiceClientTest.php
@@ -22,19 +22,21 @@
namespace Google\Cloud\ErrorReporting\Tests\Unit\V1beta1;
-use Google\Cloud\ErrorReporting\V1beta1\ReportErrorsServiceClient;
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\Testing\GeneratedTest;
+
use Google\ApiCore\Testing\MockTransport;
-use Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventResponse;
use Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent;
-use Google\Protobuf\Any;
+use Google\Cloud\ErrorReporting\V1beta1\ReportErrorEventResponse;
+use Google\Cloud\ErrorReporting\V1beta1\ReportErrorsServiceClient;
+use Google\Cloud\ErrorReporting\V1beta1\ServiceContext;
use Google\Rpc\Code;
use stdClass;
/**
* @group errorreporting
+ *
* @group gapic
*/
class ReportErrorsServiceClientTest extends GeneratedTest
@@ -52,9 +54,7 @@ private function createTransport($deserialize = null)
*/
private function createCredentials()
{
- return $this->getMockBuilder(CredentialsWrapper::class)
- ->disableOriginalConstructor()
- ->getMock();
+ return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock();
}
/**
@@ -65,7 +65,6 @@ private function createClient(array $options = [])
$options += [
'credentials' => $this->createCredentials(),
];
-
return new ReportErrorsServiceClient($options);
}
@@ -75,18 +74,20 @@ private function createClient(array $options = [])
public function reportErrorEventTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
// Mock response
$expectedResponse = new ReportErrorEventResponse();
$transport->addResponse($expectedResponse);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
$event = new ReportedErrorEvent();
-
+ $eventServiceContext = new ServiceContext();
+ $event->setServiceContext($eventServiceContext);
+ $eventMessage = 'eventMessage1863181325';
+ $event->setMessage($eventMessage);
$response = $client->reportErrorEvent($formattedProjectName, $event);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
@@ -94,14 +95,10 @@ public function reportErrorEventTest()
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
$this->assertSame('/google.devtools.clouderrorreporting.v1beta1.ReportErrorsService/ReportErrorEvent', $actualFuncCall);
-
$actualValue = $actualRequestObject->getProjectName();
-
$this->assertProtobufEquals($formattedProjectName, $actualValue);
$actualValue = $actualRequestObject->getEvent();
-
$this->assertProtobufEquals($event, $actualValue);
-
$this->assertTrue($transport->isExhausted());
}
@@ -111,26 +108,27 @@ public function reportErrorEventTest()
public function reportErrorEventExceptionTest()
{
$transport = $this->createTransport();
- $client = $this->createClient(['transport' => $transport]);
-
+ $client = $this->createClient([
+ 'transport' => $transport,
+ ]);
$this->assertTrue($transport->isExhausted());
-
$status = new stdClass();
$status->code = Code::DATA_LOSS;
$status->details = 'internal error';
-
- $expectedExceptionMessage = json_encode([
- 'message' => 'internal error',
- 'code' => Code::DATA_LOSS,
- 'status' => 'DATA_LOSS',
- 'details' => [],
+ $expectedExceptionMessage = json_encode([
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
], JSON_PRETTY_PRINT);
$transport->addResponse(null, $status);
-
// Mock request
$formattedProjectName = $client->projectName('[PROJECT]');
$event = new ReportedErrorEvent();
-
+ $eventServiceContext = new ServiceContext();
+ $event->setServiceContext($eventServiceContext);
+ $eventMessage = 'eventMessage1863181325';
+ $event->setMessage($eventMessage);
try {
$client->reportErrorEvent($formattedProjectName, $event);
// If the $client method call did not throw, fail the test
@@ -139,7 +137,6 @@ public function reportErrorEventExceptionTest()
$this->assertEquals($status->code, $ex->getCode());
$this->assertEquals($expectedExceptionMessage, $ex->getMessage());
}
-
// Call popReceivedCalls to ensure the stub is exhausted
$transport->popReceivedCalls();
$this->assertTrue($transport->isExhausted());