|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.networksecurity.v1beta1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * `AuthzPolicy` is a resource that allows to forward traffic to a callout backend designed to scan |
| 21 | + * the traffic for security purposes. |
| 22 | + * |
| 23 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 24 | + * transmitted over HTTP when working with the Network Security API. For a detailed explanation see: |
| 25 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 26 | + * </p> |
| 27 | + * |
| 28 | + * @author Google, Inc. |
| 29 | + */ |
| 30 | +@SuppressWarnings("javadoc") |
| 31 | +public final class AuthzPolicy extends com.google.api.client.json.GenericJson { |
| 32 | + |
| 33 | + /** |
| 34 | + * Required. Can be one of ALLOW, DENY, CUSTOM. When the action is CUSTOM, customProvider must be |
| 35 | + * specified. When the action is ALLOW, only requests matching the policy will be allowed. When |
| 36 | + * the action is DENY, only requests matching the policy will be denied. When a request arrives, |
| 37 | + * the policies are evaluated in the following order: 1. If there is a CUSTOM policy that matches |
| 38 | + * the request, the CUSTOM policy is evaluated using the custom authorization providers and the |
| 39 | + * request is denied if the provider rejects the request. 2. If there are any DENY policies that |
| 40 | + * match the request, the request is denied. 3. If there are no ALLOW policies for the resource or |
| 41 | + * if any of the ALLOW policies match the request, the request is allowed. 4. Else the request is |
| 42 | + * denied by default if none of the configured AuthzPolicies with ALLOW action match the request. |
| 43 | + * The value may be {@code null}. |
| 44 | + */ |
| 45 | + @com.google.api.client.util.Key |
| 46 | + private java.lang.String action; |
| 47 | + |
| 48 | + /** |
| 49 | + * Output only. The timestamp when the resource was created. |
| 50 | + * The value may be {@code null}. |
| 51 | + */ |
| 52 | + @com.google.api.client.util.Key |
| 53 | + private String createTime; |
| 54 | + |
| 55 | + /** |
| 56 | + * Optional. Required if the action is CUSTOM. Allows delegating authorization decisions to Cloud |
| 57 | + * IAP or to Service Extensions. One of cloudIap or authzExtension must be specified. |
| 58 | + * The value may be {@code null}. |
| 59 | + */ |
| 60 | + @com.google.api.client.util.Key |
| 61 | + private AuthzPolicyCustomProvider customProvider; |
| 62 | + |
| 63 | + /** |
| 64 | + * Optional. A human-readable description of the resource. |
| 65 | + * The value may be {@code null}. |
| 66 | + */ |
| 67 | + @com.google.api.client.util.Key |
| 68 | + private java.lang.String description; |
| 69 | + |
| 70 | + /** |
| 71 | + * Optional. A list of authorization HTTP rules to match against the incoming request. A policy |
| 72 | + * match occurs when at least one HTTP rule matches the request or when no HTTP rules are |
| 73 | + * specified in the policy. At least one HTTP Rule is required for Allow or Deny Action. |
| 74 | + * The value may be {@code null}. |
| 75 | + */ |
| 76 | + @com.google.api.client.util.Key |
| 77 | + private java.util.List<AuthzPolicyAuthzRule> httpRules; |
| 78 | + |
| 79 | + /** |
| 80 | + * Optional. Set of labels associated with the `AuthzPolicy` resource. The format must comply with |
| 81 | + * [the following requirements](/compute/docs/labeling-resources#requirements). |
| 82 | + * The value may be {@code null}. |
| 83 | + */ |
| 84 | + @com.google.api.client.util.Key |
| 85 | + private java.util.Map<String, java.lang.String> labels; |
| 86 | + |
| 87 | + /** |
| 88 | + * Required. Identifier. Name of the `AuthzPolicy` resource in the following format: |
| 89 | + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. |
| 90 | + * The value may be {@code null}. |
| 91 | + */ |
| 92 | + @com.google.api.client.util.Key |
| 93 | + private java.lang.String name; |
| 94 | + |
| 95 | + /** |
| 96 | + * Required. Specifies the set of resources to which this policy should be applied to. |
| 97 | + * The value may be {@code null}. |
| 98 | + */ |
| 99 | + @com.google.api.client.util.Key |
| 100 | + private AuthzPolicyTarget target; |
| 101 | + |
| 102 | + /** |
| 103 | + * Output only. The timestamp when the resource was updated. |
| 104 | + * The value may be {@code null}. |
| 105 | + */ |
| 106 | + @com.google.api.client.util.Key |
| 107 | + private String updateTime; |
| 108 | + |
| 109 | + /** |
| 110 | + * Required. Can be one of ALLOW, DENY, CUSTOM. When the action is CUSTOM, customProvider must be |
| 111 | + * specified. When the action is ALLOW, only requests matching the policy will be allowed. When |
| 112 | + * the action is DENY, only requests matching the policy will be denied. When a request arrives, |
| 113 | + * the policies are evaluated in the following order: 1. If there is a CUSTOM policy that matches |
| 114 | + * the request, the CUSTOM policy is evaluated using the custom authorization providers and the |
| 115 | + * request is denied if the provider rejects the request. 2. If there are any DENY policies that |
| 116 | + * match the request, the request is denied. 3. If there are no ALLOW policies for the resource or |
| 117 | + * if any of the ALLOW policies match the request, the request is allowed. 4. Else the request is |
| 118 | + * denied by default if none of the configured AuthzPolicies with ALLOW action match the request. |
| 119 | + * @return value or {@code null} for none |
| 120 | + */ |
| 121 | + public java.lang.String getAction() { |
| 122 | + return action; |
| 123 | + } |
| 124 | + |
| 125 | + /** |
| 126 | + * Required. Can be one of ALLOW, DENY, CUSTOM. When the action is CUSTOM, customProvider must be |
| 127 | + * specified. When the action is ALLOW, only requests matching the policy will be allowed. When |
| 128 | + * the action is DENY, only requests matching the policy will be denied. When a request arrives, |
| 129 | + * the policies are evaluated in the following order: 1. If there is a CUSTOM policy that matches |
| 130 | + * the request, the CUSTOM policy is evaluated using the custom authorization providers and the |
| 131 | + * request is denied if the provider rejects the request. 2. If there are any DENY policies that |
| 132 | + * match the request, the request is denied. 3. If there are no ALLOW policies for the resource or |
| 133 | + * if any of the ALLOW policies match the request, the request is allowed. 4. Else the request is |
| 134 | + * denied by default if none of the configured AuthzPolicies with ALLOW action match the request. |
| 135 | + * @param action action or {@code null} for none |
| 136 | + */ |
| 137 | + public AuthzPolicy setAction(java.lang.String action) { |
| 138 | + this.action = action; |
| 139 | + return this; |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * Output only. The timestamp when the resource was created. |
| 144 | + * @return value or {@code null} for none |
| 145 | + */ |
| 146 | + public String getCreateTime() { |
| 147 | + return createTime; |
| 148 | + } |
| 149 | + |
| 150 | + /** |
| 151 | + * Output only. The timestamp when the resource was created. |
| 152 | + * @param createTime createTime or {@code null} for none |
| 153 | + */ |
| 154 | + public AuthzPolicy setCreateTime(String createTime) { |
| 155 | + this.createTime = createTime; |
| 156 | + return this; |
| 157 | + } |
| 158 | + |
| 159 | + /** |
| 160 | + * Optional. Required if the action is CUSTOM. Allows delegating authorization decisions to Cloud |
| 161 | + * IAP or to Service Extensions. One of cloudIap or authzExtension must be specified. |
| 162 | + * @return value or {@code null} for none |
| 163 | + */ |
| 164 | + public AuthzPolicyCustomProvider getCustomProvider() { |
| 165 | + return customProvider; |
| 166 | + } |
| 167 | + |
| 168 | + /** |
| 169 | + * Optional. Required if the action is CUSTOM. Allows delegating authorization decisions to Cloud |
| 170 | + * IAP or to Service Extensions. One of cloudIap or authzExtension must be specified. |
| 171 | + * @param customProvider customProvider or {@code null} for none |
| 172 | + */ |
| 173 | + public AuthzPolicy setCustomProvider(AuthzPolicyCustomProvider customProvider) { |
| 174 | + this.customProvider = customProvider; |
| 175 | + return this; |
| 176 | + } |
| 177 | + |
| 178 | + /** |
| 179 | + * Optional. A human-readable description of the resource. |
| 180 | + * @return value or {@code null} for none |
| 181 | + */ |
| 182 | + public java.lang.String getDescription() { |
| 183 | + return description; |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * Optional. A human-readable description of the resource. |
| 188 | + * @param description description or {@code null} for none |
| 189 | + */ |
| 190 | + public AuthzPolicy setDescription(java.lang.String description) { |
| 191 | + this.description = description; |
| 192 | + return this; |
| 193 | + } |
| 194 | + |
| 195 | + /** |
| 196 | + * Optional. A list of authorization HTTP rules to match against the incoming request. A policy |
| 197 | + * match occurs when at least one HTTP rule matches the request or when no HTTP rules are |
| 198 | + * specified in the policy. At least one HTTP Rule is required for Allow or Deny Action. |
| 199 | + * @return value or {@code null} for none |
| 200 | + */ |
| 201 | + public java.util.List<AuthzPolicyAuthzRule> getHttpRules() { |
| 202 | + return httpRules; |
| 203 | + } |
| 204 | + |
| 205 | + /** |
| 206 | + * Optional. A list of authorization HTTP rules to match against the incoming request. A policy |
| 207 | + * match occurs when at least one HTTP rule matches the request or when no HTTP rules are |
| 208 | + * specified in the policy. At least one HTTP Rule is required for Allow or Deny Action. |
| 209 | + * @param httpRules httpRules or {@code null} for none |
| 210 | + */ |
| 211 | + public AuthzPolicy setHttpRules(java.util.List<AuthzPolicyAuthzRule> httpRules) { |
| 212 | + this.httpRules = httpRules; |
| 213 | + return this; |
| 214 | + } |
| 215 | + |
| 216 | + /** |
| 217 | + * Optional. Set of labels associated with the `AuthzPolicy` resource. The format must comply with |
| 218 | + * [the following requirements](/compute/docs/labeling-resources#requirements). |
| 219 | + * @return value or {@code null} for none |
| 220 | + */ |
| 221 | + public java.util.Map<String, java.lang.String> getLabels() { |
| 222 | + return labels; |
| 223 | + } |
| 224 | + |
| 225 | + /** |
| 226 | + * Optional. Set of labels associated with the `AuthzPolicy` resource. The format must comply with |
| 227 | + * [the following requirements](/compute/docs/labeling-resources#requirements). |
| 228 | + * @param labels labels or {@code null} for none |
| 229 | + */ |
| 230 | + public AuthzPolicy setLabels(java.util.Map<String, java.lang.String> labels) { |
| 231 | + this.labels = labels; |
| 232 | + return this; |
| 233 | + } |
| 234 | + |
| 235 | + /** |
| 236 | + * Required. Identifier. Name of the `AuthzPolicy` resource in the following format: |
| 237 | + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. |
| 238 | + * @return value or {@code null} for none |
| 239 | + */ |
| 240 | + public java.lang.String getName() { |
| 241 | + return name; |
| 242 | + } |
| 243 | + |
| 244 | + /** |
| 245 | + * Required. Identifier. Name of the `AuthzPolicy` resource in the following format: |
| 246 | + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. |
| 247 | + * @param name name or {@code null} for none |
| 248 | + */ |
| 249 | + public AuthzPolicy setName(java.lang.String name) { |
| 250 | + this.name = name; |
| 251 | + return this; |
| 252 | + } |
| 253 | + |
| 254 | + /** |
| 255 | + * Required. Specifies the set of resources to which this policy should be applied to. |
| 256 | + * @return value or {@code null} for none |
| 257 | + */ |
| 258 | + public AuthzPolicyTarget getTarget() { |
| 259 | + return target; |
| 260 | + } |
| 261 | + |
| 262 | + /** |
| 263 | + * Required. Specifies the set of resources to which this policy should be applied to. |
| 264 | + * @param target target or {@code null} for none |
| 265 | + */ |
| 266 | + public AuthzPolicy setTarget(AuthzPolicyTarget target) { |
| 267 | + this.target = target; |
| 268 | + return this; |
| 269 | + } |
| 270 | + |
| 271 | + /** |
| 272 | + * Output only. The timestamp when the resource was updated. |
| 273 | + * @return value or {@code null} for none |
| 274 | + */ |
| 275 | + public String getUpdateTime() { |
| 276 | + return updateTime; |
| 277 | + } |
| 278 | + |
| 279 | + /** |
| 280 | + * Output only. The timestamp when the resource was updated. |
| 281 | + * @param updateTime updateTime or {@code null} for none |
| 282 | + */ |
| 283 | + public AuthzPolicy setUpdateTime(String updateTime) { |
| 284 | + this.updateTime = updateTime; |
| 285 | + return this; |
| 286 | + } |
| 287 | + |
| 288 | + @Override |
| 289 | + public AuthzPolicy set(String fieldName, Object value) { |
| 290 | + return (AuthzPolicy) super.set(fieldName, value); |
| 291 | + } |
| 292 | + |
| 293 | + @Override |
| 294 | + public AuthzPolicy clone() { |
| 295 | + return (AuthzPolicy) super.clone(); |
| 296 | + } |
| 297 | + |
| 298 | +} |
0 commit comments