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

com.azure.resourcemanager.desktopvirtualization.fluent.models.ApplicationInner Maven / Gradle / Ivy

Go to download

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.desktopvirtualization.models.CommandLineSetting;
import com.azure.resourcemanager.desktopvirtualization.models.RemoteApplicationType;
import java.io.IOException;

/**
 * Schema for Application properties.
 */
@Fluent
public final class ApplicationInner extends ProxyResource {
    private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];

    /*
     * Detailed properties for Application
     */
    private ApplicationProperties innerProperties = new ApplicationProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the innerProperties property: Detailed properties for Application.
     * 
     * @return the innerProperties value.
     */
    private ApplicationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * Get the objectId property: ObjectId of Application. (internal use).
     * 
     * @return the objectId value.
     */
    public String objectId() {
        return this.innerProperties() == null ? null : this.innerProperties().objectId();
    }

    /**
     * Get the description property: Description of Application.
     * 
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description of Application.
     * 
     * @param description the description value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the friendlyName property: Friendly name of Application.
     * 
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

    /**
     * Set the friendlyName property: Friendly name of Application.
     * 
     * @param friendlyName the friendlyName value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

    /**
     * Get the filePath property: Specifies a path for the executable file for the application.
     * 
     * @return the filePath value.
     */
    public String filePath() {
        return this.innerProperties() == null ? null : this.innerProperties().filePath();
    }

    /**
     * Set the filePath property: Specifies a path for the executable file for the application.
     * 
     * @param filePath the filePath value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withFilePath(String filePath) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withFilePath(filePath);
        return this;
    }

    /**
     * Get the msixPackageFamilyName property: Specifies the package family name for MSIX applications.
     * 
     * @return the msixPackageFamilyName value.
     */
    public String msixPackageFamilyName() {
        return this.innerProperties() == null ? null : this.innerProperties().msixPackageFamilyName();
    }

    /**
     * Set the msixPackageFamilyName property: Specifies the package family name for MSIX applications.
     * 
     * @param msixPackageFamilyName the msixPackageFamilyName value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withMsixPackageFamilyName(String msixPackageFamilyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withMsixPackageFamilyName(msixPackageFamilyName);
        return this;
    }

    /**
     * Get the msixPackageApplicationId property: Specifies the package application Id for MSIX applications.
     * 
     * @return the msixPackageApplicationId value.
     */
    public String msixPackageApplicationId() {
        return this.innerProperties() == null ? null : this.innerProperties().msixPackageApplicationId();
    }

    /**
     * Set the msixPackageApplicationId property: Specifies the package application Id for MSIX applications.
     * 
     * @param msixPackageApplicationId the msixPackageApplicationId value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withMsixPackageApplicationId(String msixPackageApplicationId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withMsixPackageApplicationId(msixPackageApplicationId);
        return this;
    }

    /**
     * Get the applicationType property: Resource Type of Application.
     * 
     * @return the applicationType value.
     */
    public RemoteApplicationType applicationType() {
        return this.innerProperties() == null ? null : this.innerProperties().applicationType();
    }

    /**
     * Set the applicationType property: Resource Type of Application.
     * 
     * @param applicationType the applicationType value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withApplicationType(RemoteApplicationType applicationType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withApplicationType(applicationType);
        return this;
    }

    /**
     * Get the commandLineSetting property: Specifies whether this published application can be launched with command
     * line arguments provided by the client, command line arguments specified at publish time, or no command line
     * arguments at all.
     * 
     * @return the commandLineSetting value.
     */
    public CommandLineSetting commandLineSetting() {
        return this.innerProperties() == null ? null : this.innerProperties().commandLineSetting();
    }

    /**
     * Set the commandLineSetting property: Specifies whether this published application can be launched with command
     * line arguments provided by the client, command line arguments specified at publish time, or no command line
     * arguments at all.
     * 
     * @param commandLineSetting the commandLineSetting value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withCommandLineSetting(CommandLineSetting commandLineSetting) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withCommandLineSetting(commandLineSetting);
        return this;
    }

    /**
     * Get the commandLineArguments property: Command Line Arguments for Application.
     * 
     * @return the commandLineArguments value.
     */
    public String commandLineArguments() {
        return this.innerProperties() == null ? null : this.innerProperties().commandLineArguments();
    }

    /**
     * Set the commandLineArguments property: Command Line Arguments for Application.
     * 
     * @param commandLineArguments the commandLineArguments value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withCommandLineArguments(String commandLineArguments) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withCommandLineArguments(commandLineArguments);
        return this;
    }

    /**
     * Get the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server.
     * 
     * @return the showInPortal value.
     */
    public Boolean showInPortal() {
        return this.innerProperties() == null ? null : this.innerProperties().showInPortal();
    }

    /**
     * Set the showInPortal property: Specifies whether to show the RemoteApp program in the RD Web Access server.
     * 
     * @param showInPortal the showInPortal value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withShowInPortal(Boolean showInPortal) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withShowInPortal(showInPortal);
        return this;
    }

    /**
     * Get the iconPath property: Path to icon.
     * 
     * @return the iconPath value.
     */
    public String iconPath() {
        return this.innerProperties() == null ? null : this.innerProperties().iconPath();
    }

    /**
     * Set the iconPath property: Path to icon.
     * 
     * @param iconPath the iconPath value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withIconPath(String iconPath) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withIconPath(iconPath);
        return this;
    }

    /**
     * Get the iconIndex property: Index of the icon.
     * 
     * @return the iconIndex value.
     */
    public Integer iconIndex() {
        return this.innerProperties() == null ? null : this.innerProperties().iconIndex();
    }

    /**
     * Set the iconIndex property: Index of the icon.
     * 
     * @param iconIndex the iconIndex value to set.
     * @return the ApplicationInner object itself.
     */
    public ApplicationInner withIconIndex(Integer iconIndex) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationProperties();
        }
        this.innerProperties().withIconIndex(iconIndex);
        return this;
    }

    /**
     * Get the iconHash property: Hash of the icon.
     * 
     * @return the iconHash value.
     */
    public String iconHash() {
        return this.innerProperties() == null ? null : this.innerProperties().iconHash();
    }

    /**
     * Get the iconContent property: the icon a 64 bit string as a byte array.
     * 
     * @return the iconContent value.
     */
    public byte[] iconContent() {
        return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().iconContent();
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property innerProperties in model ApplicationInner"));
        } else {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ApplicationInner.class);

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

    /**
     * Reads an instance of ApplicationInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ApplicationInner if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the ApplicationInner.
     */
    public static ApplicationInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ApplicationInner deserializedApplicationInner = new ApplicationInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedApplicationInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedApplicationInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedApplicationInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedApplicationInner.innerProperties = ApplicationProperties.fromJson(reader);
                } else if ("systemData".equals(fieldName)) {
                    deserializedApplicationInner.systemData = SystemData.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedApplicationInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy