1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18namespace Google\Service\Monitoring\Resource; 19 20use Google\Service\Monitoring\ListNotificationChannelDescriptorsResponse; 21use Google\Service\Monitoring\NotificationChannelDescriptor; 22 23/** 24 * The "notificationChannelDescriptors" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $monitoringService = new Google\Service\Monitoring(...); 28 * $notificationChannelDescriptors = $monitoringService->notificationChannelDescriptors; 29 * </code> 30 */ 31class ProjectsNotificationChannelDescriptors extends \Google\Service\Resource 32{ 33 /** 34 * Gets a single channel descriptor. The descriptor indicates which fields are 35 * expected / permitted for a notification channel of the given type. 36 * (notificationChannelDescriptors.get) 37 * 38 * @param string $name Required. The channel type for which to execute the 39 * request. The format is: 40 * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] 41 * @param array $optParams Optional parameters. 42 * @return NotificationChannelDescriptor 43 */ 44 public function get($name, $optParams = []) 45 { 46 $params = ['name' => $name]; 47 $params = array_merge($params, $optParams); 48 return $this->call('get', [$params], NotificationChannelDescriptor::class); 49 } 50 /** 51 * Lists the descriptors for supported channel types. The use of descriptors 52 * makes it possible for new channel types to be dynamically added. 53 * (notificationChannelDescriptors.listProjectsNotificationChannelDescriptors) 54 * 55 * @param string $name Required. The REST resource name of the parent from which 56 * to retrieve the notification channel descriptors. The expected syntax is: 57 * projects/[PROJECT_ID_OR_NUMBER] Note that this names 58 * (https://cloud.google.com/monitoring/api/v3#project_name) the parent 59 * container in which to look for the descriptors; to retrieve a single 60 * descriptor by name, use the GetNotificationChannelDescriptor operation, 61 * instead. 62 * @param array $optParams Optional parameters. 63 * 64 * @opt_param int pageSize The maximum number of results to return in a single 65 * response. If not set to a positive number, a reasonable value will be chosen 66 * by the service. 67 * @opt_param string pageToken If non-empty, page_token must contain a value 68 * returned as the next_page_token in a previous response to request the next 69 * set of results. 70 * @return ListNotificationChannelDescriptorsResponse 71 */ 72 public function listProjectsNotificationChannelDescriptors($name, $optParams = []) 73 { 74 $params = ['name' => $name]; 75 $params = array_merge($params, $optParams); 76 return $this->call('list', [$params], ListNotificationChannelDescriptorsResponse::class); 77 } 78} 79 80// Adding a class alias for backwards compatibility with the previous class name. 81class_alias(ProjectsNotificationChannelDescriptors::class, 'Google_Service_Monitoring_Resource_ProjectsNotificationChannelDescriptors'); 82