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

com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataProperties 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.security.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE.
 */
@Fluent
public final class MdeOnboardingDataProperties implements JsonSerializable {
    /*
     * The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for
     * onboarding using the dedicated VM Extension
     */
    private byte[] onboardingPackageWindows;

    /*
     * The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for
     * onboarding using the dedicated VM Extension
     */
    private byte[] onboardingPackageLinux;

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

    /**
     * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded
     * in base64. This can also be used for onboarding using the dedicated VM Extension.
     * 
     * @return the onboardingPackageWindows value.
     */
    public byte[] onboardingPackageWindows() {
        return CoreUtils.clone(this.onboardingPackageWindows);
    }

    /**
     * Set the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded
     * in base64. This can also be used for onboarding using the dedicated VM Extension.
     * 
     * @param onboardingPackageWindows the onboardingPackageWindows value to set.
     * @return the MdeOnboardingDataProperties object itself.
     */
    public MdeOnboardingDataProperties withOnboardingPackageWindows(byte[] onboardingPackageWindows) {
        this.onboardingPackageWindows = CoreUtils.clone(onboardingPackageWindows);
        return this;
    }

    /**
     * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in
     * base64. This can also be used for onboarding using the dedicated VM Extension.
     * 
     * @return the onboardingPackageLinux value.
     */
    public byte[] onboardingPackageLinux() {
        return CoreUtils.clone(this.onboardingPackageLinux);
    }

    /**
     * Set the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in
     * base64. This can also be used for onboarding using the dedicated VM Extension.
     * 
     * @param onboardingPackageLinux the onboardingPackageLinux value to set.
     * @return the MdeOnboardingDataProperties object itself.
     */
    public MdeOnboardingDataProperties withOnboardingPackageLinux(byte[] onboardingPackageLinux) {
        this.onboardingPackageLinux = CoreUtils.clone(onboardingPackageLinux);
        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.writeBinaryField("onboardingPackageWindows", this.onboardingPackageWindows);
        jsonWriter.writeBinaryField("onboardingPackageLinux", this.onboardingPackageLinux);
        return jsonWriter.writeEndObject();
    }

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

                if ("onboardingPackageWindows".equals(fieldName)) {
                    deserializedMdeOnboardingDataProperties.onboardingPackageWindows = reader.getBinary();
                } else if ("onboardingPackageLinux".equals(fieldName)) {
                    deserializedMdeOnboardingDataProperties.onboardingPackageLinux = reader.getBinary();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMdeOnboardingDataProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy