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

package com.azure.resourcemanager.managedapplications.models;

import com.azure.core.management.Region;
import com.azure.core.util.Context;
import com.azure.resourcemanager.managedapplications.fluent.models.ApplicationDefinitionInner;
import java.util.List;
import java.util.Map;

/** An immutable client-side representation of ApplicationDefinition. */
public interface ApplicationDefinition {
    /**
     * 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 location property: The geo-location where the resource lives.
     *
     * @return the location value.
     */
    String location();

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

    /**
     * Gets the managedBy property: ID of the resource that manages this resource.
     *
     * @return the managedBy value.
     */
    String managedBy();

    /**
     * Gets the sku property: The SKU of the resource.
     *
     * @return the sku value.
     */
    Sku sku();

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

    /**
     * Gets the lockLevel property: The managed application lock level.
     *
     * @return the lockLevel value.
     */
    ApplicationLockLevel lockLevel();

    /**
     * Gets the displayName property: The managed application definition display name.
     *
     * @return the displayName value.
     */
    String displayName();

    /**
     * Gets the isEnabled property: A value indicating whether the package is enabled or not.
     *
     * @return the isEnabled value.
     */
    String isEnabled();

    /**
     * Gets the authorizations property: The managed application provider authorizations.
     *
     * @return the authorizations value.
     */
    List<ApplicationProviderAuthorization> authorizations();

    /**
     * Gets the artifacts property: The collection of managed application artifacts. The portal will use the files
     * specified as artifacts to construct the user experience of creating a managed application from a managed
     * application definition.
     *
     * @return the artifacts value.
     */
    List<ApplicationArtifact> artifacts();

    /**
     * Gets the description property: The managed application definition description.
     *
     * @return the description value.
     */
    String description();

    /**
     * Gets the packageFileUri property: The managed application definition package file Uri. Use this element.
     *
     * @return the packageFileUri value.
     */
    String packageFileUri();

    /**
     * Gets the mainTemplate property: The inline main template json which has resources to be provisioned. It can be a
     * JObject or well-formed JSON string.
     *
     * @return the mainTemplate value.
     */
    Object mainTemplate();

    /**
     * Gets the createUiDefinition property: The createUiDefinition json for the backing template with
     * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string.
     *
     * @return the createUiDefinition value.
     */
    Object createUiDefinition();

    /**
     * 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.managedapplications.fluent.models.ApplicationDefinitionInner object.
     *
     * @return the inner object.
     */
    ApplicationDefinitionInner innerModel();

    /** The entirety of the ApplicationDefinition definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithLocation,
            DefinitionStages.WithResourceGroup,
            DefinitionStages.WithLockLevel,
            DefinitionStages.WithAuthorizations,
            DefinitionStages.WithCreate {
    }
    /** The ApplicationDefinition definition stages. */
    interface DefinitionStages {
        /** The first stage of the ApplicationDefinition definition. */
        interface Blank extends WithLocation {
        }
        /** The stage of the ApplicationDefinition definition allowing to specify location. */
        interface WithLocation {
            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithResourceGroup withRegion(Region location);

            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithResourceGroup withRegion(String location);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify parent resource. */
        interface WithResourceGroup {
            /**
             * Specifies resourceGroupName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @return the next definition stage.
             */
            WithLockLevel withExistingResourceGroup(String resourceGroupName);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify lockLevel. */
        interface WithLockLevel {
            /**
             * Specifies the lockLevel property: The managed application lock level..
             *
             * @param lockLevel The managed application lock level.
             * @return the next definition stage.
             */
            WithAuthorizations withLockLevel(ApplicationLockLevel lockLevel);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify authorizations. */
        interface WithAuthorizations {
            /**
             * Specifies the authorizations property: The managed application provider authorizations..
             *
             * @param authorizations The managed application provider authorizations.
             * @return the next definition stage.
             */
            WithCreate withAuthorizations(List<ApplicationProviderAuthorization> authorizations);
        }
        /**
         * The stage of the ApplicationDefinition 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.WithTags,
                DefinitionStages.WithManagedBy,
                DefinitionStages.WithSku,
                DefinitionStages.WithIdentity,
                DefinitionStages.WithDisplayName,
                DefinitionStages.WithIsEnabled,
                DefinitionStages.WithArtifacts,
                DefinitionStages.WithDescription,
                DefinitionStages.WithPackageFileUri,
                DefinitionStages.WithMainTemplate,
                DefinitionStages.WithCreateUiDefinition {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ApplicationDefinition create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ApplicationDefinition create(Context context);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: Resource tags..
             *
             * @param tags Resource tags.
             * @return the next definition stage.
             */
            WithCreate withTags(Map<String, String> tags);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify managedBy. */
        interface WithManagedBy {
            /**
             * Specifies the managedBy property: ID of the resource that manages this resource..
             *
             * @param managedBy ID of the resource that manages this resource.
             * @return the next definition stage.
             */
            WithCreate withManagedBy(String managedBy);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: The SKU of the resource..
             *
             * @param sku The SKU of the resource.
             * @return the next definition stage.
             */
            WithCreate withSku(Sku sku);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify identity. */
        interface WithIdentity {
            /**
             * Specifies the identity property: The identity of the resource..
             *
             * @param identity The identity of the resource.
             * @return the next definition stage.
             */
            WithCreate withIdentity(Identity identity);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify displayName. */
        interface WithDisplayName {
            /**
             * Specifies the displayName property: The managed application definition display name..
             *
             * @param displayName The managed application definition display name.
             * @return the next definition stage.
             */
            WithCreate withDisplayName(String displayName);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify isEnabled. */
        interface WithIsEnabled {
            /**
             * Specifies the isEnabled property: A value indicating whether the package is enabled or not..
             *
             * @param isEnabled A value indicating whether the package is enabled or not.
             * @return the next definition stage.
             */
            WithCreate withIsEnabled(String isEnabled);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify artifacts. */
        interface WithArtifacts {
            /**
             * Specifies the artifacts property: The collection of managed application artifacts. The portal will use
             * the files specified as artifacts to construct the user experience of creating a managed application from
             * a managed application definition..
             *
             * @param artifacts The collection of managed application artifacts. The portal will use the files specified
             *     as artifacts to construct the user experience of creating a managed application from a managed
             *     application definition.
             * @return the next definition stage.
             */
            WithCreate withArtifacts(List<ApplicationArtifact> artifacts);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: The managed application definition description..
             *
             * @param description The managed application definition description.
             * @return the next definition stage.
             */
            WithCreate withDescription(String description);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify packageFileUri. */
        interface WithPackageFileUri {
            /**
             * Specifies the packageFileUri property: The managed application definition package file Uri. Use this
             * element.
             *
             * @param packageFileUri The managed application definition package file Uri. Use this element.
             * @return the next definition stage.
             */
            WithCreate withPackageFileUri(String packageFileUri);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify mainTemplate. */
        interface WithMainTemplate {
            /**
             * Specifies the mainTemplate property: The inline main template json which has resources to be provisioned.
             * It can be a JObject or well-formed JSON string..
             *
             * @param mainTemplate The inline main template json which has resources to be provisioned. It can be a
             *     JObject or well-formed JSON string.
             * @return the next definition stage.
             */
            WithCreate withMainTemplate(Object mainTemplate);
        }
        /** The stage of the ApplicationDefinition definition allowing to specify createUiDefinition. */
        interface WithCreateUiDefinition {
            /**
             * Specifies the createUiDefinition property: The createUiDefinition json for the backing template with
             * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string..
             *
             * @param createUiDefinition The createUiDefinition json for the backing template with
             *     Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string.
             * @return the next definition stage.
             */
            WithCreate withCreateUiDefinition(Object createUiDefinition);
        }
    }
    /**
     * Begins update for the ApplicationDefinition resource.
     *
     * @return the stage of resource update.
     */
    ApplicationDefinition.Update update();

    /** The template for ApplicationDefinition update. */
    interface Update
        extends UpdateStages.WithTags,
            UpdateStages.WithManagedBy,
            UpdateStages.WithSku,
            UpdateStages.WithIdentity,
            UpdateStages.WithLockLevel,
            UpdateStages.WithDisplayName,
            UpdateStages.WithIsEnabled,
            UpdateStages.WithAuthorizations,
            UpdateStages.WithArtifacts,
            UpdateStages.WithDescription,
            UpdateStages.WithPackageFileUri,
            UpdateStages.WithMainTemplate,
            UpdateStages.WithCreateUiDefinition {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ApplicationDefinition apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ApplicationDefinition apply(Context context);
    }
    /** The ApplicationDefinition update stages. */
    interface UpdateStages {
        /** The stage of the ApplicationDefinition update allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: Resource tags..
             *
             * @param tags Resource tags.
             * @return the next definition stage.
             */
            Update withTags(Map<String, String> tags);
        }
        /** The stage of the ApplicationDefinition update allowing to specify managedBy. */
        interface WithManagedBy {
            /**
             * Specifies the managedBy property: ID of the resource that manages this resource..
             *
             * @param managedBy ID of the resource that manages this resource.
             * @return the next definition stage.
             */
            Update withManagedBy(String managedBy);
        }
        /** The stage of the ApplicationDefinition update allowing to specify sku. */
        interface WithSku {
            /**
             * Specifies the sku property: The SKU of the resource..
             *
             * @param sku The SKU of the resource.
             * @return the next definition stage.
             */
            Update withSku(Sku sku);
        }
        /** The stage of the ApplicationDefinition update allowing to specify identity. */
        interface WithIdentity {
            /**
             * Specifies the identity property: The identity of the resource..
             *
             * @param identity The identity of the resource.
             * @return the next definition stage.
             */
            Update withIdentity(Identity identity);
        }
        /** The stage of the ApplicationDefinition update allowing to specify lockLevel. */
        interface WithLockLevel {
            /**
             * Specifies the lockLevel property: The managed application lock level..
             *
             * @param lockLevel The managed application lock level.
             * @return the next definition stage.
             */
            Update withLockLevel(ApplicationLockLevel lockLevel);
        }
        /** The stage of the ApplicationDefinition update allowing to specify displayName. */
        interface WithDisplayName {
            /**
             * Specifies the displayName property: The managed application definition display name..
             *
             * @param displayName The managed application definition display name.
             * @return the next definition stage.
             */
            Update withDisplayName(String displayName);
        }
        /** The stage of the ApplicationDefinition update allowing to specify isEnabled. */
        interface WithIsEnabled {
            /**
             * Specifies the isEnabled property: A value indicating whether the package is enabled or not..
             *
             * @param isEnabled A value indicating whether the package is enabled or not.
             * @return the next definition stage.
             */
            Update withIsEnabled(String isEnabled);
        }
        /** The stage of the ApplicationDefinition update allowing to specify authorizations. */
        interface WithAuthorizations {
            /**
             * Specifies the authorizations property: The managed application provider authorizations..
             *
             * @param authorizations The managed application provider authorizations.
             * @return the next definition stage.
             */
            Update withAuthorizations(List<ApplicationProviderAuthorization> authorizations);
        }
        /** The stage of the ApplicationDefinition update allowing to specify artifacts. */
        interface WithArtifacts {
            /**
             * Specifies the artifacts property: The collection of managed application artifacts. The portal will use
             * the files specified as artifacts to construct the user experience of creating a managed application from
             * a managed application definition..
             *
             * @param artifacts The collection of managed application artifacts. The portal will use the files specified
             *     as artifacts to construct the user experience of creating a managed application from a managed
             *     application definition.
             * @return the next definition stage.
             */
            Update withArtifacts(List<ApplicationArtifact> artifacts);
        }
        /** The stage of the ApplicationDefinition update allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: The managed application definition description..
             *
             * @param description The managed application definition description.
             * @return the next definition stage.
             */
            Update withDescription(String description);
        }
        /** The stage of the ApplicationDefinition update allowing to specify packageFileUri. */
        interface WithPackageFileUri {
            /**
             * Specifies the packageFileUri property: The managed application definition package file Uri. Use this
             * element.
             *
             * @param packageFileUri The managed application definition package file Uri. Use this element.
             * @return the next definition stage.
             */
            Update withPackageFileUri(String packageFileUri);
        }
        /** The stage of the ApplicationDefinition update allowing to specify mainTemplate. */
        interface WithMainTemplate {
            /**
             * Specifies the mainTemplate property: The inline main template json which has resources to be provisioned.
             * It can be a JObject or well-formed JSON string..
             *
             * @param mainTemplate The inline main template json which has resources to be provisioned. It can be a
             *     JObject or well-formed JSON string.
             * @return the next definition stage.
             */
            Update withMainTemplate(Object mainTemplate);
        }
        /** The stage of the ApplicationDefinition update allowing to specify createUiDefinition. */
        interface WithCreateUiDefinition {
            /**
             * Specifies the createUiDefinition property: The createUiDefinition json for the backing template with
             * Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string..
             *
             * @param createUiDefinition The createUiDefinition json for the backing template with
             *     Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string.
             * @return the next definition stage.
             */
            Update withCreateUiDefinition(Object createUiDefinition);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ApplicationDefinition refresh();

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