|
| 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.connectors.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * * TrafficShapingConfig defines the configuration for shaping API traffic by specifying a quota |
| 21 | + * limit and the duration over which this limit is enforced. This configuration helps to control and |
| 22 | + * manage the rate at which API calls are made on the client side, preventing service overload on |
| 23 | + * the backend. For example: - if the quota limit is 100 calls per 10 seconds, then the message |
| 24 | + * would be: { quota_limit: 100 duration: { seconds: 10 } } - if the quota limit is 100 calls per 5 |
| 25 | + * minutes, then the message would be: { quota_limit: 100 duration: { seconds: 300 } } - if the |
| 26 | + * quota limit is 10000 calls per day, then the message would be: { quota_limit: 10000 duration: { |
| 27 | + * seconds: 86400 } and so on. |
| 28 | + * |
| 29 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 30 | + * transmitted over HTTP when working with the Connectors API. For a detailed explanation see: |
| 31 | + * <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> |
| 32 | + * </p> |
| 33 | + * |
| 34 | + * @author Google, Inc. |
| 35 | + */ |
| 36 | +@SuppressWarnings("javadoc") |
| 37 | +public final class TrafficShapingConfig extends com.google.api.client.json.GenericJson { |
| 38 | + |
| 39 | + /** |
| 40 | + * Required. * The duration over which the API call quota limits are calculated. This duration is |
| 41 | + * used to define the time window for evaluating if the number of API calls made by a user is |
| 42 | + * within the allowed quota limits. For example: - To define a quota sampled over 16 seconds, set |
| 43 | + * `seconds` to 16 - To define a quota sampled over 5 minutes, set `seconds` to 300 (5 * 60) - To |
| 44 | + * define a quota sampled over 1 day, set `seconds` to 86400 (24 * 60 * 60) and so on. It is |
| 45 | + * important to note that this duration is not the time the quota is valid for, but rather the |
| 46 | + * time window over which the quota is evaluated. For example, if the quota is 100 calls per 10 |
| 47 | + * seconds, then this duration field would be set to 10 seconds. |
| 48 | + * The value may be {@code null}. |
| 49 | + */ |
| 50 | + @com.google.api.client.util.Key |
| 51 | + private String duration; |
| 52 | + |
| 53 | + /** |
| 54 | + * Required. Maximum number of api calls allowed. |
| 55 | + * The value may be {@code null}. |
| 56 | + */ |
| 57 | + @com.google.api.client.util.Key @com.google.api.client.json.JsonString |
| 58 | + private java.lang.Long quotaLimit; |
| 59 | + |
| 60 | + /** |
| 61 | + * Required. * The duration over which the API call quota limits are calculated. This duration is |
| 62 | + * used to define the time window for evaluating if the number of API calls made by a user is |
| 63 | + * within the allowed quota limits. For example: - To define a quota sampled over 16 seconds, set |
| 64 | + * `seconds` to 16 - To define a quota sampled over 5 minutes, set `seconds` to 300 (5 * 60) - To |
| 65 | + * define a quota sampled over 1 day, set `seconds` to 86400 (24 * 60 * 60) and so on. It is |
| 66 | + * important to note that this duration is not the time the quota is valid for, but rather the |
| 67 | + * time window over which the quota is evaluated. For example, if the quota is 100 calls per 10 |
| 68 | + * seconds, then this duration field would be set to 10 seconds. |
| 69 | + * @return value or {@code null} for none |
| 70 | + */ |
| 71 | + public String getDuration() { |
| 72 | + return duration; |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * Required. * The duration over which the API call quota limits are calculated. This duration is |
| 77 | + * used to define the time window for evaluating if the number of API calls made by a user is |
| 78 | + * within the allowed quota limits. For example: - To define a quota sampled over 16 seconds, set |
| 79 | + * `seconds` to 16 - To define a quota sampled over 5 minutes, set `seconds` to 300 (5 * 60) - To |
| 80 | + * define a quota sampled over 1 day, set `seconds` to 86400 (24 * 60 * 60) and so on. It is |
| 81 | + * important to note that this duration is not the time the quota is valid for, but rather the |
| 82 | + * time window over which the quota is evaluated. For example, if the quota is 100 calls per 10 |
| 83 | + * seconds, then this duration field would be set to 10 seconds. |
| 84 | + * @param duration duration or {@code null} for none |
| 85 | + */ |
| 86 | + public TrafficShapingConfig setDuration(String duration) { |
| 87 | + this.duration = duration; |
| 88 | + return this; |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * Required. Maximum number of api calls allowed. |
| 93 | + * @return value or {@code null} for none |
| 94 | + */ |
| 95 | + public java.lang.Long getQuotaLimit() { |
| 96 | + return quotaLimit; |
| 97 | + } |
| 98 | + |
| 99 | + /** |
| 100 | + * Required. Maximum number of api calls allowed. |
| 101 | + * @param quotaLimit quotaLimit or {@code null} for none |
| 102 | + */ |
| 103 | + public TrafficShapingConfig setQuotaLimit(java.lang.Long quotaLimit) { |
| 104 | + this.quotaLimit = quotaLimit; |
| 105 | + return this; |
| 106 | + } |
| 107 | + |
| 108 | + @Override |
| 109 | + public TrafficShapingConfig set(String fieldName, Object value) { |
| 110 | + return (TrafficShapingConfig) super.set(fieldName, value); |
| 111 | + } |
| 112 | + |
| 113 | + @Override |
| 114 | + public TrafficShapingConfig clone() { |
| 115 | + return (TrafficShapingConfig) super.clone(); |
| 116 | + } |
| 117 | + |
| 118 | +} |
0 commit comments