![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.models.HybridRunbookWorkerGroupCreateOrUpdateParameters 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.fluent.models.HybridRunbookWorkerGroupCreateOrUpdateProperties;
import java.io.IOException;
/**
* The parameters supplied to the create hybrid runbook worker group operation.
*/
@Fluent
public final class HybridRunbookWorkerGroupCreateOrUpdateParameters
implements JsonSerializable {
/*
* Gets or sets hybrid runbook worker group create or update properties.
*/
private HybridRunbookWorkerGroupCreateOrUpdateProperties innerProperties;
/*
* Gets or sets the name of the resource.
*/
private String name;
/**
* Creates an instance of HybridRunbookWorkerGroupCreateOrUpdateParameters class.
*/
public HybridRunbookWorkerGroupCreateOrUpdateParameters() {
}
/**
* Get the innerProperties property: Gets or sets hybrid runbook worker group create or update properties.
*
* @return the innerProperties value.
*/
private HybridRunbookWorkerGroupCreateOrUpdateProperties 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 HybridRunbookWorkerGroupCreateOrUpdateParameters object itself.
*/
public HybridRunbookWorkerGroupCreateOrUpdateParameters withName(String name) {
this.name = name;
return this;
}
/**
* Get the credential property: Sets the credential of a worker group.
*
* @return the credential value.
*/
public RunAsCredentialAssociationProperty credential() {
return this.innerProperties() == null ? null : this.innerProperties().credential();
}
/**
* Set the credential property: Sets the credential of a worker group.
*
* @param credential the credential value to set.
* @return the HybridRunbookWorkerGroupCreateOrUpdateParameters object itself.
*/
public HybridRunbookWorkerGroupCreateOrUpdateParameters
withCredential(RunAsCredentialAssociationProperty credential) {
if (this.innerProperties() == null) {
this.innerProperties = new HybridRunbookWorkerGroupCreateOrUpdateProperties();
}
this.innerProperties().withCredential(credential);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@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 HybridRunbookWorkerGroupCreateOrUpdateParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of HybridRunbookWorkerGroupCreateOrUpdateParameters 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 HybridRunbookWorkerGroupCreateOrUpdateParameters.
*/
public static HybridRunbookWorkerGroupCreateOrUpdateParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
HybridRunbookWorkerGroupCreateOrUpdateParameters deserializedHybridRunbookWorkerGroupCreateOrUpdateParameters
= new HybridRunbookWorkerGroupCreateOrUpdateParameters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedHybridRunbookWorkerGroupCreateOrUpdateParameters.innerProperties
= HybridRunbookWorkerGroupCreateOrUpdateProperties.fromJson(reader);
} else if ("name".equals(fieldName)) {
deserializedHybridRunbookWorkerGroupCreateOrUpdateParameters.name = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedHybridRunbookWorkerGroupCreateOrUpdateParameters;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy