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

com.azure.resourcemanager.automation.models.WindowsProperties 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 java.io.IOException;
import java.util.List;

/**
 * Windows specific update configuration.
 */
@Fluent
public final class WindowsProperties implements JsonSerializable {
    /*
     * Update classification included in the software update configuration. A comma separated string with required
     * values
     */
    private WindowsUpdateClasses includedUpdateClassifications;

    /*
     * KB numbers excluded from the software update configuration.
     */
    private List excludedKbNumbers;

    /*
     * KB numbers included from the software update configuration.
     */
    private List includedKbNumbers;

    /*
     * Reboot setting for the software update configuration.
     */
    private String rebootSetting;

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

    /**
     * Get the includedUpdateClassifications property: Update classification included in the software update
     * configuration. A comma separated string with required values.
     * 
     * @return the includedUpdateClassifications value.
     */
    public WindowsUpdateClasses includedUpdateClassifications() {
        return this.includedUpdateClassifications;
    }

    /**
     * Set the includedUpdateClassifications property: Update classification included in the software update
     * configuration. A comma separated string with required values.
     * 
     * @param includedUpdateClassifications the includedUpdateClassifications value to set.
     * @return the WindowsProperties object itself.
     */
    public WindowsProperties withIncludedUpdateClassifications(WindowsUpdateClasses includedUpdateClassifications) {
        this.includedUpdateClassifications = includedUpdateClassifications;
        return this;
    }

    /**
     * Get the excludedKbNumbers property: KB numbers excluded from the software update configuration.
     * 
     * @return the excludedKbNumbers value.
     */
    public List excludedKbNumbers() {
        return this.excludedKbNumbers;
    }

    /**
     * Set the excludedKbNumbers property: KB numbers excluded from the software update configuration.
     * 
     * @param excludedKbNumbers the excludedKbNumbers value to set.
     * @return the WindowsProperties object itself.
     */
    public WindowsProperties withExcludedKbNumbers(List excludedKbNumbers) {
        this.excludedKbNumbers = excludedKbNumbers;
        return this;
    }

    /**
     * Get the includedKbNumbers property: KB numbers included from the software update configuration.
     * 
     * @return the includedKbNumbers value.
     */
    public List includedKbNumbers() {
        return this.includedKbNumbers;
    }

    /**
     * Set the includedKbNumbers property: KB numbers included from the software update configuration.
     * 
     * @param includedKbNumbers the includedKbNumbers value to set.
     * @return the WindowsProperties object itself.
     */
    public WindowsProperties withIncludedKbNumbers(List includedKbNumbers) {
        this.includedKbNumbers = includedKbNumbers;
        return this;
    }

    /**
     * Get the rebootSetting property: Reboot setting for the software update configuration.
     * 
     * @return the rebootSetting value.
     */
    public String rebootSetting() {
        return this.rebootSetting;
    }

    /**
     * Set the rebootSetting property: Reboot setting for the software update configuration.
     * 
     * @param rebootSetting the rebootSetting value to set.
     * @return the WindowsProperties object itself.
     */
    public WindowsProperties withRebootSetting(String rebootSetting) {
        this.rebootSetting = rebootSetting;
        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.writeStringField("includedUpdateClassifications",
            this.includedUpdateClassifications == null ? null : this.includedUpdateClassifications.toString());
        jsonWriter.writeArrayField("excludedKbNumbers", this.excludedKbNumbers,
            (writer, element) -> writer.writeString(element));
        jsonWriter.writeArrayField("includedKbNumbers", this.includedKbNumbers,
            (writer, element) -> writer.writeString(element));
        jsonWriter.writeStringField("rebootSetting", this.rebootSetting);
        return jsonWriter.writeEndObject();
    }

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

                if ("includedUpdateClassifications".equals(fieldName)) {
                    deserializedWindowsProperties.includedUpdateClassifications
                        = WindowsUpdateClasses.fromString(reader.getString());
                } else if ("excludedKbNumbers".equals(fieldName)) {
                    List excludedKbNumbers = reader.readArray(reader1 -> reader1.getString());
                    deserializedWindowsProperties.excludedKbNumbers = excludedKbNumbers;
                } else if ("includedKbNumbers".equals(fieldName)) {
                    List includedKbNumbers = reader.readArray(reader1 -> reader1.getString());
                    deserializedWindowsProperties.includedKbNumbers = includedKbNumbers;
                } else if ("rebootSetting".equals(fieldName)) {
                    deserializedWindowsProperties.rebootSetting = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedWindowsProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy