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\Dns\Resource; 19 20use Google\Service\Dns\ResponsePoliciesListResponse; 21use Google\Service\Dns\ResponsePoliciesPatchResponse; 22use Google\Service\Dns\ResponsePoliciesUpdateResponse; 23use Google\Service\Dns\ResponsePolicy; 24 25/** 26 * The "responsePolicies" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $dnsService = new Google\Service\Dns(...); 30 * $responsePolicies = $dnsService->responsePolicies; 31 * </code> 32 */ 33class ResponsePolicies extends \Google\Service\Resource 34{ 35 /** 36 * Creates a new Response Policy (responsePolicies.create) 37 * 38 * @param string $project Identifies the project addressed by this request. 39 * @param string $location Specifies the location of the resource, only 40 * applicable in the v APIs. This information will be used for routing and will 41 * be part of the resource name. 42 * @param ResponsePolicy $postBody 43 * @param array $optParams Optional parameters. 44 * 45 * @opt_param string clientOperationId For mutating operation requests only. An 46 * optional identifier specified by the client. Must be unique for operation 47 * resources in the Operations collection. 48 * @return ResponsePolicy 49 */ 50 public function create($project, $location, ResponsePolicy $postBody, $optParams = []) 51 { 52 $params = ['project' => $project, 'location' => $location, 'postBody' => $postBody]; 53 $params = array_merge($params, $optParams); 54 return $this->call('create', [$params], ResponsePolicy::class); 55 } 56 /** 57 * Deletes a previously created Response Policy. Fails if the response policy is 58 * non-empty or still being referenced by a network. (responsePolicies.delete) 59 * 60 * @param string $project Identifies the project addressed by this request. 61 * @param string $location Specifies the location of the resource. This 62 * information will be used for routing and will be part of the resource name. 63 * @param string $responsePolicy User assigned name of the Response Policy 64 * addressed by this request. 65 * @param array $optParams Optional parameters. 66 * 67 * @opt_param string clientOperationId For mutating operation requests only. An 68 * optional identifier specified by the client. Must be unique for operation 69 * resources in the Operations collection. 70 */ 71 public function delete($project, $location, $responsePolicy, $optParams = []) 72 { 73 $params = ['project' => $project, 'location' => $location, 'responsePolicy' => $responsePolicy]; 74 $params = array_merge($params, $optParams); 75 return $this->call('delete', [$params]); 76 } 77 /** 78 * Fetches the representation of an existing Response Policy. 79 * (responsePolicies.get) 80 * 81 * @param string $project Identifies the project addressed by this request. 82 * @param string $location Specifies the location of the resource. This 83 * information will be used for routing and will be part of the resource name. 84 * @param string $responsePolicy User assigned name of the Response Policy 85 * addressed by this request. 86 * @param array $optParams Optional parameters. 87 * 88 * @opt_param string clientOperationId For mutating operation requests only. An 89 * optional identifier specified by the client. Must be unique for operation 90 * resources in the Operations collection. 91 * @return ResponsePolicy 92 */ 93 public function get($project, $location, $responsePolicy, $optParams = []) 94 { 95 $params = ['project' => $project, 'location' => $location, 'responsePolicy' => $responsePolicy]; 96 $params = array_merge($params, $optParams); 97 return $this->call('get', [$params], ResponsePolicy::class); 98 } 99 /** 100 * Enumerates all Response Policies associated with a project. 101 * (responsePolicies.listResponsePolicies) 102 * 103 * @param string $project Identifies the project addressed by this request. 104 * @param string $location Specifies the location of the resource. This 105 * information will be used for routing and will be part of the resource name. 106 * @param array $optParams Optional parameters. 107 * 108 * @opt_param int maxResults Optional. Maximum number of results to be returned. 109 * If unspecified, the server decides how many results to return. 110 * @opt_param string pageToken Optional. A tag returned by a previous list 111 * request that was truncated. Use this parameter to continue a previous list 112 * request. 113 * @return ResponsePoliciesListResponse 114 */ 115 public function listResponsePolicies($project, $location, $optParams = []) 116 { 117 $params = ['project' => $project, 'location' => $location]; 118 $params = array_merge($params, $optParams); 119 return $this->call('list', [$params], ResponsePoliciesListResponse::class); 120 } 121 /** 122 * Applies a partial update to an existing Response Policy. 123 * (responsePolicies.patch) 124 * 125 * @param string $project Identifies the project addressed by this request. 126 * @param string $location Specifies the location of the resource. This 127 * information will be used for routing and will be part of the resource name. 128 * @param string $responsePolicy User assigned name of the Respones Policy 129 * addressed by this request. 130 * @param ResponsePolicy $postBody 131 * @param array $optParams Optional parameters. 132 * 133 * @opt_param string clientOperationId For mutating operation requests only. An 134 * optional identifier specified by the client. Must be unique for operation 135 * resources in the Operations collection. 136 * @return ResponsePoliciesPatchResponse 137 */ 138 public function patch($project, $location, $responsePolicy, ResponsePolicy $postBody, $optParams = []) 139 { 140 $params = ['project' => $project, 'location' => $location, 'responsePolicy' => $responsePolicy, 'postBody' => $postBody]; 141 $params = array_merge($params, $optParams); 142 return $this->call('patch', [$params], ResponsePoliciesPatchResponse::class); 143 } 144 /** 145 * Updates an existing Response Policy. (responsePolicies.update) 146 * 147 * @param string $project Identifies the project addressed by this request. 148 * @param string $location Specifies the location of the resource. This 149 * information will be used for routing and will be part of the resource name. 150 * @param string $responsePolicy User assigned name of the Response Policy 151 * addressed by this request. 152 * @param ResponsePolicy $postBody 153 * @param array $optParams Optional parameters. 154 * 155 * @opt_param string clientOperationId For mutating operation requests only. An 156 * optional identifier specified by the client. Must be unique for operation 157 * resources in the Operations collection. 158 * @return ResponsePoliciesUpdateResponse 159 */ 160 public function update($project, $location, $responsePolicy, ResponsePolicy $postBody, $optParams = []) 161 { 162 $params = ['project' => $project, 'location' => $location, 'responsePolicy' => $responsePolicy, 'postBody' => $postBody]; 163 $params = array_merge($params, $optParams); 164 return $this->call('update', [$params], ResponsePoliciesUpdateResponse::class); 165 } 166} 167 168// Adding a class alias for backwards compatibility with the previous class name. 169class_alias(ResponsePolicies::class, 'Google_Service_Dns_Resource_ResponsePolicies'); 170