// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.servicefabric.models;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner;
import java.util.List;
import java.util.Map;

/** An immutable client-side representation of ApplicationResource. */
public interface ApplicationResource {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the identity property: Describes the managed identities for an Azure resource.
     *
     * @return the identity value.
     */
    ManagedIdentity identity();

    /**
     * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource.
     *
     * @return the location value.
     */
    String location();

    /**
     * Gets the tags property: Azure resource tags.
     *
     * @return the tags value.
     */
    Map<String, String> tags();

    /**
     * Gets the etag property: Azure resource etag.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the
     * response.
     *
     * @return the provisioningState value.
     */
    String provisioningState();

    /**
     * Gets the typeName property: The application type name as defined in the application manifest.
     *
     * @return the typeName value.
     */
    String typeName();

    /**
     * Gets the typeVersion property: The version of the application type as defined in the application manifest.
     *
     * @return the typeVersion value.
     */
    String typeVersion();

    /**
     * Gets the parameters property: List of application parameters with overridden values from their default values
     * specified in the application manifest.
     *
     * @return the parameters value.
     */
    Map<String, String> parameters();

    /**
     * Gets the upgradePolicy property: Describes the policy for a monitored application upgrade.
     *
     * @return the upgradePolicy value.
     */
    ApplicationUpgradePolicy upgradePolicy();

    /**
     * Gets the minimumNodes property: The minimum number of nodes where Service Fabric will reserve capacity for this
     * application. Note that this does not mean that the services of this application will be placed on all of those
     * nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more
     * than the value of the MaximumNodes property.
     *
     * @return the minimumNodes value.
     */
    Long minimumNodes();

    /**
     * Gets the maximumNodes property: The maximum number of nodes where Service Fabric will reserve capacity for this
     * application. Note that this does not mean that the services of this application will be placed on all of those
     * nodes. By default, the value of this property is zero and it means that the services can be placed on any node.
     *
     * @return the maximumNodes value.
     */
    Long maximumNodes();

    /**
     * Gets the removeApplicationCapacity property: Remove the current application capacity settings.
     *
     * @return the removeApplicationCapacity value.
     */
    Boolean removeApplicationCapacity();

    /**
     * Gets the metrics property: List of application capacity metric description.
     *
     * @return the metrics value.
     */
    List<ApplicationMetricDescription> metrics();

    /**
     * Gets the managedIdentities property: List of user assigned identities for the application, each mapped to a
     * friendly name.
     *
     * @return the managedIdentities value.
     */
    List<ApplicationUserAssignedIdentity> managedIdentities();

    /**
     * Gets the region of the resource.
     *
     * @return the region of the resource.
     */
    Region region();

    /**
     * Gets the name of the resource region.
     *
     * @return the name of the resource region.
     */
    String regionName();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ApplicationResourceInner object.
     *
     * @return the inner object.
     */
    ApplicationResourceInner innerModel();

    /** The entirety of the ApplicationResource definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The ApplicationResource definition stages. */
    interface DefinitionStages {
        /** The first stage of the ApplicationResource definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the ApplicationResource definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, clusterName.
             *
             * @param resourceGroupName The name of the resource group.
             * @param clusterName The name of the cluster resource.
             * @return the next definition stage.
             */
            WithCreate withExistingCluster(String resourceGroupName, String clusterName);
        }
        /**
         * The stage of the ApplicationResource definition which contains all the minimum required properties for the
         * resource to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithLocation,
                DefinitionStages.WithTags,
                DefinitionStages.WithIdentity,
                DefinitionStages.WithTypeName,
                DefinitionStages.WithTypeVersion,
                DefinitionStages.WithParameters,
                DefinitionStages.WithUpgradePolicy,
                DefinitionStages.WithMinimumNodes,
                DefinitionStages.WithMaximumNodes,
                DefinitionStages.WithRemoveApplicationCapacity,
                DefinitionStages.WithMetrics,
                DefinitionStages.WithManagedIdentities {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ApplicationResource create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ApplicationResource create(Context context);
        }
        /** The stage of the ApplicationResource definition allowing to specify location. */
        interface WithLocation {
            /**
             * Specifies the region for the resource.
             *
             * @param location It will be deprecated in New API, resource location depends on the parent resource.
             * @return the next definition stage.
             */
            WithCreate withRegion(Region location);

            /**
             * Specifies the region for the resource.
             *
             * @param location It will be deprecated in New API, resource location depends on the parent resource.
             * @return the next definition stage.
             */
            WithCreate withRegion(String location);
        }
        /** The stage of the ApplicationResource definition allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: Azure resource tags..
             *
             * @param tags Azure resource tags.
             * @return the next definition stage.
             */
            WithCreate withTags(Map<String, String> tags);
        }
        /** The stage of the ApplicationResource definition allowing to specify identity. */
        interface WithIdentity {
            /**
             * Specifies the identity property: Describes the managed identities for an Azure resource..
             *
             * @param identity Describes the managed identities for an Azure resource.
             * @return the next definition stage.
             */
            WithCreate withIdentity(ManagedIdentity identity);
        }
        /** The stage of the ApplicationResource definition allowing to specify typeName. */
        interface WithTypeName {
            /**
             * Specifies the typeName property: The application type name as defined in the application manifest..
             *
             * @param typeName The application type name as defined in the application manifest.
             * @return the next definition stage.
             */
            WithCreate withTypeName(String typeName);
        }
        /** The stage of the ApplicationResource definition allowing to specify typeVersion. */
        interface WithTypeVersion {
            /**
             * Specifies the typeVersion property: The version of the application type as defined in the application
             * manifest..
             *
             * @param typeVersion The version of the application type as defined in the application manifest.
             * @return the next definition stage.
             */
            WithCreate withTypeVersion(String typeVersion);
        }
        /** The stage of the ApplicationResource definition allowing to specify parameters. */
        interface WithParameters {
            /**
             * Specifies the parameters property: List of application parameters with overridden values from their
             * default values specified in the application manifest..
             *
             * @param parameters List of application parameters with overridden values from their default values
             *     specified in the application manifest.
             * @return the next definition stage.
             */
            WithCreate withParameters(Map<String, String> parameters);
        }
        /** The stage of the ApplicationResource definition allowing to specify upgradePolicy. */
        interface WithUpgradePolicy {
            /**
             * Specifies the upgradePolicy property: Describes the policy for a monitored application upgrade..
             *
             * @param upgradePolicy Describes the policy for a monitored application upgrade.
             * @return the next definition stage.
             */
            WithCreate withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy);
        }
        /** The stage of the ApplicationResource definition allowing to specify minimumNodes. */
        interface WithMinimumNodes {
            /**
             * Specifies the minimumNodes property: The minimum number of nodes where Service Fabric will reserve
             * capacity for this application. Note that this does not mean that the services of this application will be
             * placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of
             * this property cannot be more than the value of the MaximumNodes property..
             *
             * @param minimumNodes The minimum number of nodes where Service Fabric will reserve capacity for this
             *     application. Note that this does not mean that the services of this application will be placed on all
             *     of those nodes. If this property is set to zero, no capacity will be reserved. The value of this
             *     property cannot be more than the value of the MaximumNodes property.
             * @return the next definition stage.
             */
            WithCreate withMinimumNodes(Long minimumNodes);
        }
        /** The stage of the ApplicationResource definition allowing to specify maximumNodes. */
        interface WithMaximumNodes {
            /**
             * Specifies the maximumNodes property: The maximum number of nodes where Service Fabric will reserve
             * capacity for this application. Note that this does not mean that the services of this application will be
             * placed on all of those nodes. By default, the value of this property is zero and it means that the
             * services can be placed on any node..
             *
             * @param maximumNodes The maximum number of nodes where Service Fabric will reserve capacity for this
             *     application. Note that this does not mean that the services of this application will be placed on all
             *     of those nodes. By default, the value of this property is zero and it means that the services can be
             *     placed on any node.
             * @return the next definition stage.
             */
            WithCreate withMaximumNodes(Long maximumNodes);
        }
        /** The stage of the ApplicationResource definition allowing to specify removeApplicationCapacity. */
        interface WithRemoveApplicationCapacity {
            /**
             * Specifies the removeApplicationCapacity property: Remove the current application capacity settings..
             *
             * @param removeApplicationCapacity Remove the current application capacity settings.
             * @return the next definition stage.
             */
            WithCreate withRemoveApplicationCapacity(Boolean removeApplicationCapacity);
        }
        /** The stage of the ApplicationResource definition allowing to specify metrics. */
        interface WithMetrics {
            /**
             * Specifies the metrics property: List of application capacity metric description..
             *
             * @param metrics List of application capacity metric description.
             * @return the next definition stage.
             */
            WithCreate withMetrics(List<ApplicationMetricDescription> metrics);
        }
        /** The stage of the ApplicationResource definition allowing to specify managedIdentities. */
        interface WithManagedIdentities {
            /**
             * Specifies the managedIdentities property: List of user assigned identities for the application, each
             * mapped to a friendly name..
             *
             * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly
             *     name.
             * @return the next definition stage.
             */
            WithCreate withManagedIdentities(List<ApplicationUserAssignedIdentity> managedIdentities);
        }
    }
    /**
     * Begins update for the ApplicationResource resource.
     *
     * @return the stage of resource update.
     */
    ApplicationResource.Update update();

    /** The template for ApplicationResource update. */
    interface Update
        extends UpdateStages.WithTypeVersion,
            UpdateStages.WithParameters,
            UpdateStages.WithUpgradePolicy,
            UpdateStages.WithMinimumNodes,
            UpdateStages.WithMaximumNodes,
            UpdateStages.WithRemoveApplicationCapacity,
            UpdateStages.WithMetrics,
            UpdateStages.WithManagedIdentities {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ApplicationResource apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ApplicationResource apply(Context context);
    }
    /** The ApplicationResource update stages. */
    interface UpdateStages {
        /** The stage of the ApplicationResource update allowing to specify typeVersion. */
        interface WithTypeVersion {
            /**
             * Specifies the typeVersion property: The version of the application type as defined in the application
             * manifest..
             *
             * @param typeVersion The version of the application type as defined in the application manifest.
             * @return the next definition stage.
             */
            Update withTypeVersion(String typeVersion);
        }
        /** The stage of the ApplicationResource update allowing to specify parameters. */
        interface WithParameters {
            /**
             * Specifies the parameters property: List of application parameters with overridden values from their
             * default values specified in the application manifest..
             *
             * @param parameters List of application parameters with overridden values from their default values
             *     specified in the application manifest.
             * @return the next definition stage.
             */
            Update withParameters(Map<String, String> parameters);
        }
        /** The stage of the ApplicationResource update allowing to specify upgradePolicy. */
        interface WithUpgradePolicy {
            /**
             * Specifies the upgradePolicy property: Describes the policy for a monitored application upgrade..
             *
             * @param upgradePolicy Describes the policy for a monitored application upgrade.
             * @return the next definition stage.
             */
            Update withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy);
        }
        /** The stage of the ApplicationResource update allowing to specify minimumNodes. */
        interface WithMinimumNodes {
            /**
             * Specifies the minimumNodes property: The minimum number of nodes where Service Fabric will reserve
             * capacity for this application. Note that this does not mean that the services of this application will be
             * placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of
             * this property cannot be more than the value of the MaximumNodes property..
             *
             * @param minimumNodes The minimum number of nodes where Service Fabric will reserve capacity for this
             *     application. Note that this does not mean that the services of this application will be placed on all
             *     of those nodes. If this property is set to zero, no capacity will be reserved. The value of this
             *     property cannot be more than the value of the MaximumNodes property.
             * @return the next definition stage.
             */
            Update withMinimumNodes(Long minimumNodes);
        }
        /** The stage of the ApplicationResource update allowing to specify maximumNodes. */
        interface WithMaximumNodes {
            /**
             * Specifies the maximumNodes property: The maximum number of nodes where Service Fabric will reserve
             * capacity for this application. Note that this does not mean that the services of this application will be
             * placed on all of those nodes. By default, the value of this property is zero and it means that the
             * services can be placed on any node..
             *
             * @param maximumNodes The maximum number of nodes where Service Fabric will reserve capacity for this
             *     application. Note that this does not mean that the services of this application will be placed on all
             *     of those nodes. By default, the value of this property is zero and it means that the services can be
             *     placed on any node.
             * @return the next definition stage.
             */
            Update withMaximumNodes(Long maximumNodes);
        }
        /** The stage of the ApplicationResource update allowing to specify removeApplicationCapacity. */
        interface WithRemoveApplicationCapacity {
            /**
             * Specifies the removeApplicationCapacity property: Remove the current application capacity settings..
             *
             * @param removeApplicationCapacity Remove the current application capacity settings.
             * @return the next definition stage.
             */
            Update withRemoveApplicationCapacity(Boolean removeApplicationCapacity);
        }
        /** The stage of the ApplicationResource update allowing to specify metrics. */
        interface WithMetrics {
            /**
             * Specifies the metrics property: List of application capacity metric description..
             *
             * @param metrics List of application capacity metric description.
             * @return the next definition stage.
             */
            Update withMetrics(List<ApplicationMetricDescription> metrics);
        }
        /** The stage of the ApplicationResource update allowing to specify managedIdentities. */
        interface WithManagedIdentities {
            /**
             * Specifies the managedIdentities property: List of user assigned identities for the application, each
             * mapped to a friendly name..
             *
             * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly
             *     name.
             * @return the next definition stage.
             */
            Update withManagedIdentities(List<ApplicationUserAssignedIdentity> managedIdentities);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ApplicationResource refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    ApplicationResource refresh(Context context);
}
