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

com.azure.resourcemanager.hybridcompute.models.OSProfileWindowsConfiguration Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-05.

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.hybridcompute.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.hybridcompute.fluent.models.PatchSettings;
import java.io.IOException;

/**
 * Specifies the windows configuration for update management.
 */
@Fluent
public final class OSProfileWindowsConfiguration implements JsonSerializable {
    /*
     * Specifies the patch settings.
     */
    private PatchSettings innerPatchSettings;

    /**
     * Creates an instance of OSProfileWindowsConfiguration class.
     */
    public OSProfileWindowsConfiguration() {
    }

    /**
     * Get the innerPatchSettings property: Specifies the patch settings.
     * 
     * @return the innerPatchSettings value.
     */
    private PatchSettings innerPatchSettings() {
        return this.innerPatchSettings;
    }

    /**
     * Get the assessmentMode property: Specifies the assessment mode.
     * 
     * @return the assessmentMode value.
     */
    public AssessmentModeTypes assessmentMode() {
        return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode();
    }

    /**
     * Set the assessmentMode property: Specifies the assessment mode.
     * 
     * @param assessmentMode the assessmentMode value to set.
     * @return the OSProfileWindowsConfiguration object itself.
     */
    public OSProfileWindowsConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) {
        if (this.innerPatchSettings() == null) {
            this.innerPatchSettings = new PatchSettings();
        }
        this.innerPatchSettings().withAssessmentMode(assessmentMode);
        return this;
    }

    /**
     * Get the patchMode property: Specifies the patch mode.
     * 
     * @return the patchMode value.
     */
    public PatchModeTypes patchMode() {
        return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode();
    }

    /**
     * Set the patchMode property: Specifies the patch mode.
     * 
     * @param patchMode the patchMode value to set.
     * @return the OSProfileWindowsConfiguration object itself.
     */
    public OSProfileWindowsConfiguration withPatchMode(PatchModeTypes patchMode) {
        if (this.innerPatchSettings() == null) {
            this.innerPatchSettings = new PatchSettings();
        }
        this.innerPatchSettings().withPatchMode(patchMode);
        return this;
    }

    /**
     * Get the enableHotpatching property: Captures the hotpatch capability enrollment intent of the customers, which
     * enables customers to patch their Windows machines without requiring a reboot.
     * 
     * @return the enableHotpatching value.
     */
    public Boolean enableHotpatching() {
        return this.innerPatchSettings() == null ? null : this.innerPatchSettings().enableHotpatching();
    }

    /**
     * Set the enableHotpatching property: Captures the hotpatch capability enrollment intent of the customers, which
     * enables customers to patch their Windows machines without requiring a reboot.
     * 
     * @param enableHotpatching the enableHotpatching value to set.
     * @return the OSProfileWindowsConfiguration object itself.
     */
    public OSProfileWindowsConfiguration withEnableHotpatching(Boolean enableHotpatching) {
        if (this.innerPatchSettings() == null) {
            this.innerPatchSettings = new PatchSettings();
        }
        this.innerPatchSettings().withEnableHotpatching(enableHotpatching);
        return this;
    }

    /**
     * Get the status property: Status of the hotpatch capability enrollment or disenrollment.
     * 
     * @return the status value.
     */
    public PatchSettingsStatus status() {
        return this.innerPatchSettings() == null ? null : this.innerPatchSettings().status();
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerPatchSettings() != null) {
            innerPatchSettings().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("patchSettings", this.innerPatchSettings);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of OSProfileWindowsConfiguration from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of OSProfileWindowsConfiguration 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 OSProfileWindowsConfiguration.
     */
    public static OSProfileWindowsConfiguration fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            OSProfileWindowsConfiguration deserializedOSProfileWindowsConfiguration
                = new OSProfileWindowsConfiguration();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("patchSettings".equals(fieldName)) {
                    deserializedOSProfileWindowsConfiguration.innerPatchSettings = PatchSettings.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedOSProfileWindowsConfiguration;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy