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

com.azure.resourcemanager.servicefabricmanagedclusters.fluent.models.ApplicationResourceInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Service Fabric Managed Clusters Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Managed Clusters Management Client. Package tag package-2024-04.

There is a newer version: 1.0.0
Show 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.servicefabricmanagedclusters.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.ApplicationUpgradePolicy;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.ApplicationUserAssignedIdentity;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.ManagedIdentity;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * The application resource.
 */
@Fluent
public final class ApplicationResourceInner extends ProxyResource {
    /*
     * Describes the managed identities for an Azure resource.
     */
    private ManagedIdentity identity;

    /*
     * The application resource properties.
     */
    private ApplicationResourceProperties innerProperties;

    /*
     * Resource location depends on the parent resource.
     */
    private String location;

    /*
     * Azure resource tags.
     */
    private Map tags;

    /*
     * Metadata pertaining to creation and last modification of the resource.
     */
    private SystemData systemData;

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

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

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

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

    /**
     * Get the identity property: Describes the managed identities for an Azure resource.
     * 
     * @return the identity value.
     */
    public ManagedIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: Describes the managed identities for an Azure resource.
     * 
     * @param identity the identity value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withIdentity(ManagedIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the innerProperties property: The application resource properties.
     * 
     * @return the innerProperties value.
     */
    private ApplicationResourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the location property: Resource location depends on the parent resource.
     * 
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Resource location depends on the parent resource.
     * 
     * @param location the location value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: Azure resource tags.
     * 
     * @return the tags value.
     */
    public Map tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Azure resource tags.
     * 
     * @param tags the tags value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withTags(Map tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
     * 
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

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

    /**
     * Get the provisioningState property: The current deployment or provisioning state, which only appears in the
     * response.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the version property: The version of the application type as defined in the application manifest.
     * This name must be the full Arm Resource ID for the referenced application type version.
     * 
     * @return the version value.
     */
    public String version() {
        return this.innerProperties() == null ? null : this.innerProperties().version();
    }

    /**
     * Set the version property: The version of the application type as defined in the application manifest.
     * This name must be the full Arm Resource ID for the referenced application type version.
     * 
     * @param version the version value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withVersion(String version) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationResourceProperties();
        }
        this.innerProperties().withVersion(version);
        return this;
    }

    /**
     * Get the parameters property: List of application parameters with overridden values from their default values
     * specified in the application manifest.
     * 
     * @return the parameters value.
     */
    public Map parameters() {
        return this.innerProperties() == null ? null : this.innerProperties().parameters();
    }

    /**
     * Set the parameters property: List of application parameters with overridden values from their default values
     * specified in the application manifest.
     * 
     * @param parameters the parameters value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withParameters(Map parameters) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationResourceProperties();
        }
        this.innerProperties().withParameters(parameters);
        return this;
    }

    /**
     * Get the upgradePolicy property: Describes the policy for a monitored application upgrade.
     * 
     * @return the upgradePolicy value.
     */
    public ApplicationUpgradePolicy upgradePolicy() {
        return this.innerProperties() == null ? null : this.innerProperties().upgradePolicy();
    }

    /**
     * Set the upgradePolicy property: Describes the policy for a monitored application upgrade.
     * 
     * @param upgradePolicy the upgradePolicy value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationResourceProperties();
        }
        this.innerProperties().withUpgradePolicy(upgradePolicy);
        return this;
    }

    /**
     * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a
     * friendly name.
     * 
     * @return the managedIdentities value.
     */
    public List managedIdentities() {
        return this.innerProperties() == null ? null : this.innerProperties().managedIdentities();
    }

    /**
     * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a
     * friendly name.
     * 
     * @param managedIdentities the managedIdentities value to set.
     * @return the ApplicationResourceInner object itself.
     */
    public ApplicationResourceInner withManagedIdentities(List managedIdentities) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationResourceProperties();
        }
        this.innerProperties().withManagedIdentities(managedIdentities);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("identity", this.identity);
        jsonWriter.writeJsonField("properties", this.innerProperties);
        jsonWriter.writeStringField("location", this.location);
        jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedApplicationResourceInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedApplicationResourceInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedApplicationResourceInner.type = reader.getString();
                } else if ("identity".equals(fieldName)) {
                    deserializedApplicationResourceInner.identity = ManagedIdentity.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedApplicationResourceInner.innerProperties
                        = ApplicationResourceProperties.fromJson(reader);
                } else if ("location".equals(fieldName)) {
                    deserializedApplicationResourceInner.location = reader.getString();
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedApplicationResourceInner.tags = tags;
                } else if ("systemData".equals(fieldName)) {
                    deserializedApplicationResourceInner.systemData = SystemData.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedApplicationResourceInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy