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