Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [AdvisoryNotifications] adding project level methods to advisorynotifications.googleapis.com #6854

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified AdvisoryNotifications/metadata/V1/Service.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
*
* @param string $formattedName A name of the notification to retrieve.
* Format:
* organizations/{organization}/locations/{location}/notifications/{notification}. Please see
* organizations/{organization}/locations/{location}/notifications/{notification}
* or projects/{projects}/locations/{location}/notifications/{notification}. Please see
* {@see AdvisoryNotificationsServiceClient::notificationName()} for help formatting this field.
*/
function get_notification_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
* Lists notifications under a given parent.
*
* @param string $formattedParent The parent, which owns this collection of notifications.
* Must be of the form "organizations/{organization}/locations/{location}". Please see
* {@see AdvisoryNotificationsServiceClient::locationName()} for help formatting this field.
* Must be of the form "organizations/{organization}/locations/{location}"
* or "projects/{project}/locations/{location}"
* Please see {@see AdvisoryNotificationsServiceClient::locationName()} for help formatting this field.
*/
function list_notifications_sample(string $formattedParent): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,78 @@ public static function notificationName(string $organization, string $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* organization_location resource.
*
* @param string $organization
* @param string $location
*
* @return string The formatted organization_location resource.
*/
public static function organizationLocationName(string $organization, string $location): string
{
return self::getPathTemplate('organizationLocation')->render([
'organization' => $organization,
'location' => $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* organization_location_notification resource.
*
* @param string $organization
* @param string $location
* @param string $notification
*
* @return string The formatted organization_location_notification resource.
*/
public static function organizationLocationNotificationName(string $organization, string $location, string $notification): string
{
return self::getPathTemplate('organizationLocationNotification')->render([
'organization' => $organization,
'location' => $location,
'notification' => $notification,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* project_location resource.
*
* @param string $project
* @param string $location
*
* @return string The formatted project_location resource.
*/
public static function projectLocationName(string $project, string $location): string
{
return self::getPathTemplate('projectLocation')->render([
'project' => $project,
'location' => $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* project_location_notification resource.
*
* @param string $project
* @param string $location
* @param string $notification
*
* @return string The formatted project_location_notification resource.
*/
public static function projectLocationNotificationName(string $project, string $location, string $notification): string
{
return self::getPathTemplate('projectLocationNotification')->render([
'project' => $project,
'location' => $location,
'notification' => $notification,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a settings
* resource.
Expand All @@ -163,6 +235,10 @@ public static function settingsName(string $organization, string $location): str
* Template: Pattern
* - location: organizations/{organization}/locations/{location}
* - notification: organizations/{organization}/locations/{location}/notifications/{notification}
* - organizationLocation: organizations/{organization}/locations/{location}
* - organizationLocationNotification: organizations/{organization}/locations/{location}/notifications/{notification}
* - projectLocation: projects/{project}/locations/{location}
* - projectLocationNotification: projects/{project}/locations/{location}/notifications/{notification}
* - settings: organizations/{organization}/locations/{location}/settings
*
* The optional $template argument can be supplied to specify a particular pattern,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ class AdvisoryNotificationsServiceGapicClient

private static $notificationNameTemplate;

private static $organizationLocationNameTemplate;

private static $organizationLocationNotificationNameTemplate;

private static $projectLocationNameTemplate;

private static $projectLocationNotificationNameTemplate;

private static $settingsNameTemplate;

private static $pathTemplateMap;
Expand Down Expand Up @@ -145,6 +153,50 @@ private static function getNotificationNameTemplate()
return self::$notificationNameTemplate;
}

private static function getOrganizationLocationNameTemplate()
{
if (self::$organizationLocationNameTemplate == null) {
self::$organizationLocationNameTemplate = new PathTemplate(
'organizations/{organization}/locations/{location}'
);
}

return self::$organizationLocationNameTemplate;
}

private static function getOrganizationLocationNotificationNameTemplate()
{
if (self::$organizationLocationNotificationNameTemplate == null) {
self::$organizationLocationNotificationNameTemplate = new PathTemplate(
'organizations/{organization}/locations/{location}/notifications/{notification}'
);
}

return self::$organizationLocationNotificationNameTemplate;
}

private static function getProjectLocationNameTemplate()
{
if (self::$projectLocationNameTemplate == null) {
self::$projectLocationNameTemplate = new PathTemplate(
'projects/{project}/locations/{location}'
);
}

return self::$projectLocationNameTemplate;
}

private static function getProjectLocationNotificationNameTemplate()
{
if (self::$projectLocationNotificationNameTemplate == null) {
self::$projectLocationNotificationNameTemplate = new PathTemplate(
'projects/{project}/locations/{location}/notifications/{notification}'
);
}

return self::$projectLocationNotificationNameTemplate;
}

private static function getSettingsNameTemplate()
{
if (self::$settingsNameTemplate == null) {
Expand All @@ -162,6 +214,10 @@ private static function getPathTemplateMap()
self::$pathTemplateMap = [
'location' => self::getLocationNameTemplate(),
'notification' => self::getNotificationNameTemplate(),
'organizationLocation' => self::getOrganizationLocationNameTemplate(),
'organizationLocationNotification' => self::getOrganizationLocationNotificationNameTemplate(),
'projectLocation' => self::getProjectLocationNameTemplate(),
'projectLocationNotification' => self::getProjectLocationNotificationNameTemplate(),
'settings' => self::getSettingsNameTemplate(),
];
}
Expand Down Expand Up @@ -208,6 +264,84 @@ public static function notificationName(
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* organization_location resource.
*
* @param string $organization
* @param string $location
*
* @return string The formatted organization_location resource.
*/
public static function organizationLocationName($organization, $location)
{
return self::getOrganizationLocationNameTemplate()->render([
'organization' => $organization,
'location' => $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* organization_location_notification resource.
*
* @param string $organization
* @param string $location
* @param string $notification
*
* @return string The formatted organization_location_notification resource.
*/
public static function organizationLocationNotificationName(
$organization,
$location,
$notification
) {
return self::getOrganizationLocationNotificationNameTemplate()->render([
'organization' => $organization,
'location' => $location,
'notification' => $notification,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* project_location resource.
*
* @param string $project
* @param string $location
*
* @return string The formatted project_location resource.
*/
public static function projectLocationName($project, $location)
{
return self::getProjectLocationNameTemplate()->render([
'project' => $project,
'location' => $location,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a
* project_location_notification resource.
*
* @param string $project
* @param string $location
* @param string $notification
*
* @return string The formatted project_location_notification resource.
*/
public static function projectLocationNotificationName(
$project,
$location,
$notification
) {
return self::getProjectLocationNotificationNameTemplate()->render([
'project' => $project,
'location' => $location,
'notification' => $notification,
]);
}

/**
* Formats a string containing the fully-qualified path to represent a settings
* resource.
Expand All @@ -231,6 +365,10 @@ public static function settingsName($organization, $location)
* Template: Pattern
* - location: organizations/{organization}/locations/{location}
* - notification: organizations/{organization}/locations/{location}/notifications/{notification}
* - organizationLocation: organizations/{organization}/locations/{location}
* - organizationLocationNotification: organizations/{organization}/locations/{location}/notifications/{notification}
* - projectLocation: projects/{project}/locations/{location}
* - projectLocationNotification: projects/{project}/locations/{location}/notifications/{notification}
* - settings: organizations/{organization}/locations/{location}/settings
*
* The optional $template argument can be supplied to specify a particular pattern,
Expand Down Expand Up @@ -348,7 +486,8 @@ public function __construct(array $options = [])
*
* @param string $name Required. A name of the notification to retrieve.
* Format:
* organizations/{organization}/locations/{location}/notifications/{notification}.
* organizations/{organization}/locations/{location}/notifications/{notification}
* or projects/{projects}/locations/{location}/notifications/{notification}.
* @param array $optionalArgs {
* Optional.
*
Expand Down Expand Up @@ -469,7 +608,8 @@ 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}".
* Must be of the form "organizations/{organization}/locations/{location}"
* or "projects/{project}/locations/{location}"
* @param array $optionalArgs {
* Optional.
*
Expand Down
15 changes: 10 additions & 5 deletions AdvisoryNotifications/src/V1/GetNotificationRequest.php

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

Loading