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

com.azure.resourcemanager.automation.models.LinuxProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.

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.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;

/**
 * Linux specific update configuration.
 */
@Fluent
public final class LinuxProperties implements JsonSerializable {
    /*
     * Update classifications included in the software update configuration.
     */
    private LinuxUpdateClasses includedPackageClassifications;

    /*
     * packages excluded from the software update configuration.
     */
    private List excludedPackageNameMasks;

    /*
     * packages included from the software update configuration.
     */
    private List includedPackageNameMasks;

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

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

    /**
     * Get the includedPackageClassifications property: Update classifications included in the software update
     * configuration.
     * 
     * @return the includedPackageClassifications value.
     */
    public LinuxUpdateClasses includedPackageClassifications() {
        return this.includedPackageClassifications;
    }

    /**
     * Set the includedPackageClassifications property: Update classifications included in the software update
     * configuration.
     * 
     * @param includedPackageClassifications the includedPackageClassifications value to set.
     * @return the LinuxProperties object itself.
     */
    public LinuxProperties withIncludedPackageClassifications(LinuxUpdateClasses includedPackageClassifications) {
        this.includedPackageClassifications = includedPackageClassifications;
        return this;
    }

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

    /**
     * Set the excludedPackageNameMasks property: packages excluded from the software update configuration.
     * 
     * @param excludedPackageNameMasks the excludedPackageNameMasks value to set.
     * @return the LinuxProperties object itself.
     */
    public LinuxProperties withExcludedPackageNameMasks(List excludedPackageNameMasks) {
        this.excludedPackageNameMasks = excludedPackageNameMasks;
        return this;
    }

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

    /**
     * Set the includedPackageNameMasks property: packages included from the software update configuration.
     * 
     * @param includedPackageNameMasks the includedPackageNameMasks value to set.
     * @return the LinuxProperties object itself.
     */
    public LinuxProperties withIncludedPackageNameMasks(List includedPackageNameMasks) {
        this.includedPackageNameMasks = includedPackageNameMasks;
        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 LinuxProperties object itself.
     */
    public LinuxProperties 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("includedPackageClassifications",
            this.includedPackageClassifications == null ? null : this.includedPackageClassifications.toString());
        jsonWriter.writeArrayField("excludedPackageNameMasks", this.excludedPackageNameMasks,
            (writer, element) -> writer.writeString(element));
        jsonWriter.writeArrayField("includedPackageNameMasks", this.includedPackageNameMasks,
            (writer, element) -> writer.writeString(element));
        jsonWriter.writeStringField("rebootSetting", this.rebootSetting);
        return jsonWriter.writeEndObject();
    }

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

                if ("includedPackageClassifications".equals(fieldName)) {
                    deserializedLinuxProperties.includedPackageClassifications
                        = LinuxUpdateClasses.fromString(reader.getString());
                } else if ("excludedPackageNameMasks".equals(fieldName)) {
                    List excludedPackageNameMasks = reader.readArray(reader1 -> reader1.getString());
                    deserializedLinuxProperties.excludedPackageNameMasks = excludedPackageNameMasks;
                } else if ("includedPackageNameMasks".equals(fieldName)) {
                    List includedPackageNameMasks = reader.readArray(reader1 -> reader1.getString());
                    deserializedLinuxProperties.includedPackageNameMasks = includedPackageNameMasks;
                } else if ("rebootSetting".equals(fieldName)) {
                    deserializedLinuxProperties.rebootSetting = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedLinuxProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy