![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.desktopvirtualization.models.AppAttachPackagePatchProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04.
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.desktopvirtualization.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;
import java.util.List;
/**
* Schema for patchable fields on an App Attach Package.
*/
@Fluent
public final class AppAttachPackagePatchProperties implements JsonSerializable {
/*
* Detailed properties for App Attach Package
*/
private AppAttachPackageInfoProperties image;
/*
* List of Hostpool resource Ids.
*/
private List hostPoolReferences;
/*
* URL path to certificate name located in keyVault
*/
private String keyVaultUrl;
/*
* Parameter indicating how the health check should behave if this package fails staging
*/
private FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure;
/**
* Creates an instance of AppAttachPackagePatchProperties class.
*/
public AppAttachPackagePatchProperties() {
}
/**
* Get the image property: Detailed properties for App Attach Package.
*
* @return the image value.
*/
public AppAttachPackageInfoProperties image() {
return this.image;
}
/**
* Set the image property: Detailed properties for App Attach Package.
*
* @param image the image value to set.
* @return the AppAttachPackagePatchProperties object itself.
*/
public AppAttachPackagePatchProperties withImage(AppAttachPackageInfoProperties image) {
this.image = image;
return this;
}
/**
* Get the hostPoolReferences property: List of Hostpool resource Ids.
*
* @return the hostPoolReferences value.
*/
public List hostPoolReferences() {
return this.hostPoolReferences;
}
/**
* Set the hostPoolReferences property: List of Hostpool resource Ids.
*
* @param hostPoolReferences the hostPoolReferences value to set.
* @return the AppAttachPackagePatchProperties object itself.
*/
public AppAttachPackagePatchProperties withHostPoolReferences(List hostPoolReferences) {
this.hostPoolReferences = hostPoolReferences;
return this;
}
/**
* Get the keyVaultUrl property: URL path to certificate name located in keyVault.
*
* @return the keyVaultUrl value.
*/
public String keyVaultUrl() {
return this.keyVaultUrl;
}
/**
* Set the keyVaultUrl property: URL path to certificate name located in keyVault.
*
* @param keyVaultUrl the keyVaultUrl value to set.
* @return the AppAttachPackagePatchProperties object itself.
*/
public AppAttachPackagePatchProperties withKeyVaultUrl(String keyVaultUrl) {
this.keyVaultUrl = keyVaultUrl;
return this;
}
/**
* Get the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this
* package fails staging.
*
* @return the failHealthCheckOnStagingFailure value.
*/
public FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure() {
return this.failHealthCheckOnStagingFailure;
}
/**
* Set the failHealthCheckOnStagingFailure property: Parameter indicating how the health check should behave if this
* package fails staging.
*
* @param failHealthCheckOnStagingFailure the failHealthCheckOnStagingFailure value to set.
* @return the AppAttachPackagePatchProperties object itself.
*/
public AppAttachPackagePatchProperties
withFailHealthCheckOnStagingFailure(FailHealthCheckOnStagingFailure failHealthCheckOnStagingFailure) {
this.failHealthCheckOnStagingFailure = failHealthCheckOnStagingFailure;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (image() != null) {
image().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("image", this.image);
jsonWriter.writeArrayField("hostPoolReferences", this.hostPoolReferences,
(writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("keyVaultURL", this.keyVaultUrl);
jsonWriter.writeStringField("failHealthCheckOnStagingFailure",
this.failHealthCheckOnStagingFailure == null ? null : this.failHealthCheckOnStagingFailure.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AppAttachPackagePatchProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AppAttachPackagePatchProperties 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 AppAttachPackagePatchProperties.
*/
public static AppAttachPackagePatchProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AppAttachPackagePatchProperties deserializedAppAttachPackagePatchProperties
= new AppAttachPackagePatchProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("image".equals(fieldName)) {
deserializedAppAttachPackagePatchProperties.image = AppAttachPackageInfoProperties.fromJson(reader);
} else if ("hostPoolReferences".equals(fieldName)) {
List hostPoolReferences = reader.readArray(reader1 -> reader1.getString());
deserializedAppAttachPackagePatchProperties.hostPoolReferences = hostPoolReferences;
} else if ("keyVaultURL".equals(fieldName)) {
deserializedAppAttachPackagePatchProperties.keyVaultUrl = reader.getString();
} else if ("failHealthCheckOnStagingFailure".equals(fieldName)) {
deserializedAppAttachPackagePatchProperties.failHealthCheckOnStagingFailure
= FailHealthCheckOnStagingFailure.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedAppAttachPackagePatchProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy