Skip to content

Commit

Permalink
feat: add GetSettings and UpdateSettings methods at the Project-level…
Browse files Browse the repository at this point in the history
… to advisorynotifications.googleapis.com (#7203)

docs: adding docs for new project level settings methods
PiperOrigin-RevId: 621647197
Source-Link: googleapis/googleapis@39692d0
Source-Link: googleapis/googleapis-gen@5d0ab2f
Copy-Tag: eyJwIjoiQWR2aXNvcnlOb3RpZmljYXRpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI1ZDBhYjJmZThiMzc5ZGZhZTY1MWIzNTBmMzg5MTVmMmQ0NGFmNDJhIn0=
  • Loading branch information
gcf-owl-bot[bot] committed Apr 5, 2024
1 parent 21a61d8 commit 04af6b4
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 27 deletions.
Binary file modified AdvisoryNotifications/metadata/V1/Service.php
Binary file not shown.
Expand Up @@ -33,7 +33,8 @@
*
* @param string $formattedName 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.
*/
function get_settings_sample(string $formattedName): void
Expand Down
Expand Up @@ -34,8 +34,8 @@
*
* @param string $formattedParent 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.
*/
function list_notifications_sample(string $formattedParent): void
{
Expand Down
Expand Up @@ -177,6 +177,23 @@ public static function organizationLocationNotificationName(string $organization
]);
}

/**
* 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(string $organization, string $location): string
{
return self::getPathTemplate('organizationLocationSettings')->render([
'organization' => $organization,
'location' => $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* project_location resource.
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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(),
];
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
15 changes: 10 additions & 5 deletions AdvisoryNotifications/src/V1/GetSettingsRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions AdvisoryNotifications/src/V1/ListNotificationsRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 15 additions & 11 deletions AdvisoryNotifications/src/V1/Settings.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -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',
],
],
Expand Down

0 comments on commit 04af6b4

Please sign in to comment.