![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.models.HybridRunbookWorkerCreateParameters Maven / Gradle / Ivy
// 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.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.fluent.models.HybridRunbookWorkerCreateOrUpdateParameters;
import java.io.IOException;
/**
* The parameters supplied to the create hybrid runbook worker operation.
*/
@Fluent
public final class HybridRunbookWorkerCreateParameters
implements JsonSerializable {
/*
* Gets or sets hybrid runbook worker group create or update properties.
*/
private HybridRunbookWorkerCreateOrUpdateParameters innerProperties
= new HybridRunbookWorkerCreateOrUpdateParameters();
/*
* Gets or sets the name of the resource.
*/
private String name;
/**
* Creates an instance of HybridRunbookWorkerCreateParameters class.
*/
public HybridRunbookWorkerCreateParameters() {
}
/**
* Get the innerProperties property: Gets or sets hybrid runbook worker group create or update properties.
*
* @return the innerProperties value.
*/
private HybridRunbookWorkerCreateOrUpdateParameters innerProperties() {
return this.innerProperties;
}
/**
* Get the name property: Gets or sets the name of the resource.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Gets or sets the name of the resource.
*
* @param name the name value to set.
* @return the HybridRunbookWorkerCreateParameters object itself.
*/
public HybridRunbookWorkerCreateParameters withName(String name) {
this.name = name;
return this;
}
/**
* Get the vmResourceId property: Azure Resource Manager Id for a virtual machine.
*
* @return the vmResourceId value.
*/
public String vmResourceId() {
return this.innerProperties() == null ? null : this.innerProperties().vmResourceId();
}
/**
* Set the vmResourceId property: Azure Resource Manager Id for a virtual machine.
*
* @param vmResourceId the vmResourceId value to set.
* @return the HybridRunbookWorkerCreateParameters object itself.
*/
public HybridRunbookWorkerCreateParameters withVmResourceId(String vmResourceId) {
if (this.innerProperties() == null) {
this.innerProperties = new HybridRunbookWorkerCreateOrUpdateParameters();
}
this.innerProperties().withVmResourceId(vmResourceId);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property innerProperties in model HybridRunbookWorkerCreateParameters"));
} else {
innerProperties().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(HybridRunbookWorkerCreateParameters.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
jsonWriter.writeStringField("name", this.name);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of HybridRunbookWorkerCreateParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of HybridRunbookWorkerCreateParameters if the JsonReader was pointing to an instance of it,
* or null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the HybridRunbookWorkerCreateParameters.
*/
public static HybridRunbookWorkerCreateParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
HybridRunbookWorkerCreateParameters deserializedHybridRunbookWorkerCreateParameters
= new HybridRunbookWorkerCreateParameters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedHybridRunbookWorkerCreateParameters.innerProperties
= HybridRunbookWorkerCreateOrUpdateParameters.fromJson(reader);
} else if ("name".equals(fieldName)) {
deserializedHybridRunbookWorkerCreateParameters.name = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedHybridRunbookWorkerCreateParameters;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy