com.azure.resourcemanager.automation.fluent.models.WatcherUpdateProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-automation Show documentation
Show all versions of azure-resourcemanager-automation Show documentation
This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.automation.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* The properties of the update watcher operation.
*/
@Fluent
public final class WatcherUpdateProperties implements JsonSerializable {
/*
* Gets or sets the frequency at which the watcher is invoked.
*/
private Long executionFrequencyInSeconds;
/**
* Creates an instance of WatcherUpdateProperties class.
*/
public WatcherUpdateProperties() {
}
/**
* Get the executionFrequencyInSeconds property: Gets or sets the frequency at which the watcher is invoked.
*
* @return the executionFrequencyInSeconds value.
*/
public Long executionFrequencyInSeconds() {
return this.executionFrequencyInSeconds;
}
/**
* Set the executionFrequencyInSeconds property: Gets or sets the frequency at which the watcher is invoked.
*
* @param executionFrequencyInSeconds the executionFrequencyInSeconds value to set.
* @return the WatcherUpdateProperties object itself.
*/
public WatcherUpdateProperties withExecutionFrequencyInSeconds(Long executionFrequencyInSeconds) {
this.executionFrequencyInSeconds = executionFrequencyInSeconds;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeNumberField("executionFrequencyInSeconds", this.executionFrequencyInSeconds);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of WatcherUpdateProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of WatcherUpdateProperties if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IOException If an error occurs while reading the WatcherUpdateProperties.
*/
public static WatcherUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
WatcherUpdateProperties deserializedWatcherUpdateProperties = new WatcherUpdateProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("executionFrequencyInSeconds".equals(fieldName)) {
deserializedWatcherUpdateProperties.executionFrequencyInSeconds
= reader.getNullable(JsonReader::getLong);
} else {
reader.skipChildren();
}
}
return deserializedWatcherUpdateProperties;
});
}
}