All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.runtimeconfig.v1beta1.model.Waiter Maven / Gradle / Ivy

There is a newer version: v1-rev20241219-2.0.0
Show newest version
/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/google/apis-client-generator/
 * (build: 2018-10-08 17:45:39 UTC)
 * on 2018-10-23 at 22:36:16 UTC 
 * Modify at your own risk.
 */

package com.google.api.services.runtimeconfig.v1beta1.model;

/**
 * A Waiter resource waits for some end condition within a RuntimeConfig resource to be met before
 * it returns. For example, assume you have a distributed system where each node writes to a
 * Variable resource indicating the node's readiness as part of the startup process.
 *
 * You then configure a Waiter resource with the success condition set to wait until some number of
 * nodes have checked in. Afterwards, your application runs some arbitrary code after the condition
 * has been met and the waiter returns successfully.
 *
 * Once created, a Waiter resource is immutable.
 *
 * To learn more about using waiters, read the [Creating a Waiter](/deployment-manager/runtime-
 * configurator/creating-a-waiter) documentation.
 *
 * 

This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Runtime Configuration API. For a detailed * explanation see: * https://developers.google.com/api-client-library/java/google-http-java-client/json *

* * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class Waiter extends com.google.api.client.json.GenericJson { /** * Output only. The instant at which this Waiter resource was created. Adding the value of * `timeout` to this instant yields the timeout deadline for the waiter. * The value may be {@code null}. */ @com.google.api.client.util.Key private String createTime; /** * Output only. If the value is `false`, it means the waiter is still waiting for one of its * conditions to be met. * * If true, the waiter has finished. If the waiter finished due to a timeout or failure, `error` * will be set. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Boolean done; /** * Output only. If the waiter ended due to a failure or timeout, this value will be set. * The value may be {@code null}. */ @com.google.api.client.util.Key private Status error; /** * [Optional] The failure condition of this waiter. If this condition is met, `done` will be set * to `true` and the `error` code will be set to `ABORTED`. The failure condition takes precedence * over the success condition. If both conditions are met, a failure will be indicated. This value * is optional; if no failure condition is set, the only failure scenario will be a timeout. * The value may be {@code null}. */ @com.google.api.client.util.Key private EndCondition failure; /** * The name of the Waiter resource, in the format: * * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] * * The `[PROJECT_ID]` must be a valid Google Cloud project ID, the `[CONFIG_NAME]` must be a valid * RuntimeConfig resource, the `[WAITER_NAME]` must match RFC 1035 segment specification, and the * length of `[WAITER_NAME]` must be less than 64 bytes. * * After you create a Waiter resource, you cannot change the resource name. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String name; /** * [Required] The success condition. If this condition is met, `done` will be set to `true` and * the `error` value will remain unset. The failure condition takes precedence over the success * condition. If both conditions are met, a failure will be indicated. * The value may be {@code null}. */ @com.google.api.client.util.Key private EndCondition success; /** * [Required] Specifies the timeout of the waiter in seconds, beginning from the instant that * `waiters().create` method is called. If this time elapses before the success or failure * conditions are met, the waiter fails and sets the `error` code to `DEADLINE_EXCEEDED`. * The value may be {@code null}. */ @com.google.api.client.util.Key private String timeout; /** * Output only. The instant at which this Waiter resource was created. Adding the value of * `timeout` to this instant yields the timeout deadline for the waiter. * @return value or {@code null} for none */ public String getCreateTime() { return createTime; } /** * Output only. The instant at which this Waiter resource was created. Adding the value of * `timeout` to this instant yields the timeout deadline for the waiter. * @param createTime createTime or {@code null} for none */ public Waiter setCreateTime(String createTime) { this.createTime = createTime; return this; } /** * Output only. If the value is `false`, it means the waiter is still waiting for one of its * conditions to be met. * * If true, the waiter has finished. If the waiter finished due to a timeout or failure, `error` * will be set. * @return value or {@code null} for none */ public java.lang.Boolean getDone() { return done; } /** * Output only. If the value is `false`, it means the waiter is still waiting for one of its * conditions to be met. * * If true, the waiter has finished. If the waiter finished due to a timeout or failure, `error` * will be set. * @param done done or {@code null} for none */ public Waiter setDone(java.lang.Boolean done) { this.done = done; return this; } /** * Output only. If the waiter ended due to a failure or timeout, this value will be set. * @return value or {@code null} for none */ public Status getError() { return error; } /** * Output only. If the waiter ended due to a failure or timeout, this value will be set. * @param error error or {@code null} for none */ public Waiter setError(Status error) { this.error = error; return this; } /** * [Optional] The failure condition of this waiter. If this condition is met, `done` will be set * to `true` and the `error` code will be set to `ABORTED`. The failure condition takes precedence * over the success condition. If both conditions are met, a failure will be indicated. This value * is optional; if no failure condition is set, the only failure scenario will be a timeout. * @return value or {@code null} for none */ public EndCondition getFailure() { return failure; } /** * [Optional] The failure condition of this waiter. If this condition is met, `done` will be set * to `true` and the `error` code will be set to `ABORTED`. The failure condition takes precedence * over the success condition. If both conditions are met, a failure will be indicated. This value * is optional; if no failure condition is set, the only failure scenario will be a timeout. * @param failure failure or {@code null} for none */ public Waiter setFailure(EndCondition failure) { this.failure = failure; return this; } /** * The name of the Waiter resource, in the format: * * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] * * The `[PROJECT_ID]` must be a valid Google Cloud project ID, the `[CONFIG_NAME]` must be a valid * RuntimeConfig resource, the `[WAITER_NAME]` must match RFC 1035 segment specification, and the * length of `[WAITER_NAME]` must be less than 64 bytes. * * After you create a Waiter resource, you cannot change the resource name. * @return value or {@code null} for none */ public java.lang.String getName() { return name; } /** * The name of the Waiter resource, in the format: * * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] * * The `[PROJECT_ID]` must be a valid Google Cloud project ID, the `[CONFIG_NAME]` must be a valid * RuntimeConfig resource, the `[WAITER_NAME]` must match RFC 1035 segment specification, and the * length of `[WAITER_NAME]` must be less than 64 bytes. * * After you create a Waiter resource, you cannot change the resource name. * @param name name or {@code null} for none */ public Waiter setName(java.lang.String name) { this.name = name; return this; } /** * [Required] The success condition. If this condition is met, `done` will be set to `true` and * the `error` value will remain unset. The failure condition takes precedence over the success * condition. If both conditions are met, a failure will be indicated. * @return value or {@code null} for none */ public EndCondition getSuccess() { return success; } /** * [Required] The success condition. If this condition is met, `done` will be set to `true` and * the `error` value will remain unset. The failure condition takes precedence over the success * condition. If both conditions are met, a failure will be indicated. * @param success success or {@code null} for none */ public Waiter setSuccess(EndCondition success) { this.success = success; return this; } /** * [Required] Specifies the timeout of the waiter in seconds, beginning from the instant that * `waiters().create` method is called. If this time elapses before the success or failure * conditions are met, the waiter fails and sets the `error` code to `DEADLINE_EXCEEDED`. * @return value or {@code null} for none */ public String getTimeout() { return timeout; } /** * [Required] Specifies the timeout of the waiter in seconds, beginning from the instant that * `waiters().create` method is called. If this time elapses before the success or failure * conditions are met, the waiter fails and sets the `error` code to `DEADLINE_EXCEEDED`. * @param timeout timeout or {@code null} for none */ public Waiter setTimeout(String timeout) { this.timeout = timeout; return this; } @Override public Waiter set(String fieldName, Object value) { return (Waiter) super.set(fieldName, value); } @Override public Waiter clone() { return (Waiter) super.clone(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy