From 04af6b49e31ddd2bdc2c2fae6aea2ce4227693f6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:32:31 -0700 Subject: [PATCH] feat: add GetSettings and UpdateSettings methods at the Project-level to advisorynotifications.googleapis.com (#7203) docs: adding docs for new project level settings methods PiperOrigin-RevId: 621647197 Source-Link: https://github.com/googleapis/googleapis/commit/39692d046b0f57acc76533a4154280e573a9d6f1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5d0ab2fe8b379dfae651b350f38915f2d44af42a Copy-Tag: eyJwIjoiQWR2aXNvcnlOb3RpZmljYXRpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI1ZDBhYjJmZThiMzc5ZGZhZTY1MWIzNTBmMzg5MTVmMmQ0NGFmNDJhIn0= --- AdvisoryNotifications/metadata/V1/Service.php | Bin 5452 -> 5637 bytes .../get_settings.php | 3 +- .../list_notifications.php | 4 +- .../AdvisoryNotificationsServiceClient.php | 36 +++++++++ ...dvisoryNotificationsServiceGapicClient.php | 71 +++++++++++++++++- .../src/V1/GetSettingsRequest.php | 15 ++-- .../src/V1/ListNotificationsRequest.php | 12 +-- AdvisoryNotifications/src/V1/Settings.php | 26 ++++--- ...otifications_service_descriptor_config.php | 2 + ...tifications_service_rest_client_config.php | 13 ++++ 10 files changed, 155 insertions(+), 27 deletions(-) diff --git a/AdvisoryNotifications/metadata/V1/Service.php b/AdvisoryNotifications/metadata/V1/Service.php index 1821b6c4f77df02c01af53b1a6b7311c4255c002..325c9235b57c04a062eadbd43b4b2966b161fa88 100644 GIT binary patch delta 227 zcmX@3)vB|Bmzim`>SliCTkMP%C%@v7W#pL5!TpzGE8{E2jf`BnlNC8tCmZm%FbNq< zp2?~)IfsXXM~kC4wWK67FTL1^V{;DA9wwHVoLn-K8AU`lJMt?tF+QK1Dp<{zbIXw> zFEKZ@>GG4wO!1T72^tzk=?H1*ml^6;gT!qMit@8klS_*Awe)lHlM_oa^YcJ#nAx>L sGnpnU2{njJXT0SIw-IbwE92xXLN0Pq_D05F<6v6!kj>qERj8Z^0Iz9HUjP6A delta 128 zcmZqGIit0Kmzn94@@9VKTkMRTlV5SkGBQu*;Qq^&_sTJwOLwv&r|M)Q9+%B~c(yRH ztl;31nanRLy1A2InTc`dd6}e2-5q8render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location resource. @@ -213,6 +230,23 @@ public static function projectLocationNotificationName(string $project, string $ ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_settings resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_settings resource. + */ + public static function projectLocationSettingsName(string $project, string $location): string + { + return self::getPathTemplate('projectLocationSettings')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a settings * resource. @@ -238,8 +272,10 @@ public static function settingsName(string $organization, string $location): str * - notification: organizations/{organization}/locations/{location}/notifications/{notification} * - organizationLocation: organizations/{organization}/locations/{location} * - organizationLocationNotification: organizations/{organization}/locations/{location}/notifications/{notification} + * - organizationLocationSettings: organizations/{organization}/locations/{location}/settings * - projectLocation: projects/{project}/locations/{location} * - projectLocationNotification: projects/{project}/locations/{location}/notifications/{notification} + * - projectLocationSettings: projects/{project}/locations/{location}/settings * - settings: organizations/{organization}/locations/{location}/settings * * The optional $template argument can be supplied to specify a particular pattern, diff --git a/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php b/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php index 0f6489b7e47a..b7246dfce687 100644 --- a/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php +++ b/AdvisoryNotifications/src/V1/Gapic/AdvisoryNotificationsServiceGapicClient.php @@ -100,10 +100,14 @@ class AdvisoryNotificationsServiceGapicClient private static $organizationLocationNotificationNameTemplate; + private static $organizationLocationSettingsNameTemplate; + private static $projectLocationNameTemplate; private static $projectLocationNotificationNameTemplate; + private static $projectLocationSettingsNameTemplate; + private static $settingsNameTemplate; private static $pathTemplateMap; @@ -180,6 +184,17 @@ private static function getOrganizationLocationNotificationNameTemplate() return self::$organizationLocationNotificationNameTemplate; } + private static function getOrganizationLocationSettingsNameTemplate() + { + if (self::$organizationLocationSettingsNameTemplate == null) { + self::$organizationLocationSettingsNameTemplate = new PathTemplate( + 'organizations/{organization}/locations/{location}/settings' + ); + } + + return self::$organizationLocationSettingsNameTemplate; + } + private static function getProjectLocationNameTemplate() { if (self::$projectLocationNameTemplate == null) { @@ -202,6 +217,17 @@ private static function getProjectLocationNotificationNameTemplate() return self::$projectLocationNotificationNameTemplate; } + private static function getProjectLocationSettingsNameTemplate() + { + if (self::$projectLocationSettingsNameTemplate == null) { + self::$projectLocationSettingsNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/settings' + ); + } + + return self::$projectLocationSettingsNameTemplate; + } + private static function getSettingsNameTemplate() { if (self::$settingsNameTemplate == null) { @@ -221,8 +247,10 @@ private static function getPathTemplateMap() 'notification' => self::getNotificationNameTemplate(), 'organizationLocation' => self::getOrganizationLocationNameTemplate(), 'organizationLocationNotification' => self::getOrganizationLocationNotificationNameTemplate(), + 'organizationLocationSettings' => self::getOrganizationLocationSettingsNameTemplate(), 'projectLocation' => self::getProjectLocationNameTemplate(), 'projectLocationNotification' => self::getProjectLocationNotificationNameTemplate(), + 'projectLocationSettings' => self::getProjectLocationSettingsNameTemplate(), 'settings' => self::getSettingsNameTemplate(), ]; } @@ -308,6 +336,25 @@ public static function organizationLocationNotificationName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * organization_location_settings resource. + * + * @param string $organization + * @param string $location + * + * @return string The formatted organization_location_settings resource. + */ + public static function organizationLocationSettingsName( + $organization, + $location + ) { + return self::getOrganizationLocationSettingsNameTemplate()->render([ + 'organization' => $organization, + 'location' => $location, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a * project_location resource. @@ -347,6 +394,23 @@ public static function projectLocationNotificationName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * project_location_settings resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted project_location_settings resource. + */ + public static function projectLocationSettingsName($project, $location) + { + return self::getProjectLocationSettingsNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a settings * resource. @@ -372,8 +436,10 @@ public static function settingsName($organization, $location) * - notification: organizations/{organization}/locations/{location}/notifications/{notification} * - organizationLocation: organizations/{organization}/locations/{location} * - organizationLocationNotification: organizations/{organization}/locations/{location}/notifications/{notification} + * - organizationLocationSettings: organizations/{organization}/locations/{location}/settings * - projectLocation: projects/{project}/locations/{location} * - projectLocationNotification: projects/{project}/locations/{location}/notifications/{notification} + * - projectLocationSettings: projects/{project}/locations/{location}/settings * - settings: organizations/{organization}/locations/{location}/settings * * The optional $template argument can be supplied to specify a particular pattern, @@ -552,7 +618,8 @@ public function getNotification($name, array $optionalArgs = []) * * @param string $name Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * @param array $optionalArgs { * Optional. * @@ -614,7 +681,7 @@ public function getSettings($name, array $optionalArgs = []) * * @param string $parent Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" + * or "projects/{project}/locations/{location}". * @param array $optionalArgs { * Optional. * diff --git a/AdvisoryNotifications/src/V1/GetSettingsRequest.php b/AdvisoryNotifications/src/V1/GetSettingsRequest.php index ca213364ae8e..1aab7050300b 100644 --- a/AdvisoryNotifications/src/V1/GetSettingsRequest.php +++ b/AdvisoryNotifications/src/V1/GetSettingsRequest.php @@ -18,7 +18,8 @@ class GetSettingsRequest extends \Google\Protobuf\Internal\Message /** * Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -27,7 +28,8 @@ class GetSettingsRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. Please see + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. Please see * {@see AdvisoryNotificationsServiceClient::settingsName()} for help formatting this field. * * @return \Google\Cloud\AdvisoryNotifications\V1\GetSettingsRequest @@ -49,7 +51,8 @@ public static function build(string $name): self * @type string $name * Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * } */ public function __construct($data = NULL) { @@ -60,7 +63,8 @@ public function __construct($data = NULL) { /** * Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -73,7 +77,8 @@ public function getName() /** * Required. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/AdvisoryNotifications/src/V1/ListNotificationsRequest.php b/AdvisoryNotifications/src/V1/ListNotificationsRequest.php index 9f6eb8532fb5..8c3e66512911 100644 --- a/AdvisoryNotifications/src/V1/ListNotificationsRequest.php +++ b/AdvisoryNotifications/src/V1/ListNotificationsRequest.php @@ -18,7 +18,7 @@ class ListNotificationsRequest extends \Google\Protobuf\Internal\Message /** * Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" + * or "projects/{project}/locations/{location}". * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -61,8 +61,8 @@ class ListNotificationsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" - * Please see {@see AdvisoryNotificationsServiceClient::locationName()} for help formatting this field. + * or "projects/{project}/locations/{location}". Please see + * {@see AdvisoryNotificationsServiceClient::locationName()} for help formatting this field. * * @return \Google\Cloud\AdvisoryNotifications\V1\ListNotificationsRequest * @@ -83,7 +83,7 @@ public static function build(string $parent): self * @type string $parent * Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" + * or "projects/{project}/locations/{location}". * @type int $page_size * The maximum number of notifications to return. The service may return * fewer than this value. If unspecified or equal to 0, at most 50 @@ -112,7 +112,7 @@ public function __construct($data = NULL) { /** * Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" + * or "projects/{project}/locations/{location}". * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -125,7 +125,7 @@ public function getParent() /** * Required. The parent, which owns this collection of notifications. * Must be of the form "organizations/{organization}/locations/{location}" - * or "projects/{project}/locations/{location}" + * or "projects/{project}/locations/{location}". * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/AdvisoryNotifications/src/V1/Settings.php b/AdvisoryNotifications/src/V1/Settings.php index 70baa8b3ef7c..162f44a30b15 100644 --- a/AdvisoryNotifications/src/V1/Settings.php +++ b/AdvisoryNotifications/src/V1/Settings.php @@ -16,11 +16,12 @@ class Settings extends \Google\Protobuf\Internal\Message { /** - * Output only. The resource name of the settings to retrieve. + * Identifier. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; */ protected $name = ''; /** @@ -48,9 +49,10 @@ class Settings extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Output only. The resource name of the settings to retrieve. + * Identifier. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * @type array|\Google\Protobuf\Internal\MapField $notification_settings * Required. Map of each notification type and its settings to get/set all * settings at once. The server will validate the value for each notification @@ -68,11 +70,12 @@ public function __construct($data = NULL) { } /** - * Output only. The resource name of the settings to retrieve. + * Identifier. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @return string */ public function getName() @@ -81,11 +84,12 @@ public function getName() } /** - * Output only. The resource name of the settings to retrieve. + * Identifier. The resource name of the settings to retrieve. * Format: - * organizations/{organization}/locations/{location}/settings. + * organizations/{organization}/locations/{location}/settings or + * projects/{projects}/locations/{location}/settings. * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; * @param string $var * @return $this */ diff --git a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php index ebb3a6ad425e..50647237c0f0 100644 --- a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php +++ b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_descriptor_config.php @@ -65,8 +65,10 @@ 'notification' => 'organizations/{organization}/locations/{location}/notifications/{notification}', 'organizationLocation' => 'organizations/{organization}/locations/{location}', 'organizationLocationNotification' => 'organizations/{organization}/locations/{location}/notifications/{notification}', + 'organizationLocationSettings' => 'organizations/{organization}/locations/{location}/settings', 'projectLocation' => 'projects/{project}/locations/{location}', 'projectLocationNotification' => 'projects/{project}/locations/{location}/notifications/{notification}', + 'projectLocationSettings' => 'projects/{project}/locations/{location}/settings', 'settings' => 'organizations/{organization}/locations/{location}/settings', ], ], diff --git a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php index 5dfef8bb6492..bfa0527efbf6 100644 --- a/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php +++ b/AdvisoryNotifications/src/V1/resources/advisory_notifications_service_rest_client_config.php @@ -23,6 +23,12 @@ 'GetSettings' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=organizations/*/locations/*/settings}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/settings}', + ], + ], 'placeholders' => [ 'name' => [ 'getters' => [ @@ -52,6 +58,13 @@ 'method' => 'patch', 'uriTemplate' => '/v1/{settings.name=organizations/*/locations/*/settings}', 'body' => 'settings', + 'additionalBindings' => [ + [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{settings.name=projects/*/locations/*/settings}', + 'body' => 'settings', + ], + ], 'placeholders' => [ 'settings.name' => [ 'getters' => [