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

package com.azure.resourcemanager.extendedlocation.models;

import com.azure.core.management.Region;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.extendedlocation.fluent.models.ResourceSyncRuleInner;
import java.util.Map;

/** An immutable client-side representation of ResourceSyncRule. */
public interface ResourceSyncRule {
    /**
     * 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 systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the priority property: Priority represents a priority of the Resource Sync Rule.
     *
     * @return the priority value.
     */
    Integer priority();

    /**
     * Gets the provisioningState property: Provisioning State for the Resource Sync Rule.
     *
     * @return the provisioningState value.
     */
    String provisioningState();

    /**
     * Gets the selector property: A label selector is composed of two parts, matchLabels and matchExpressions. The
     * first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent
     * to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains
     * only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators
     * include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The
     * values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels
     * and matchExpressions must all be satisfied in order to match.
     *
     * @return the selector value.
     */
    ResourceSyncRulePropertiesSelector selector();

    /**
     * Gets the targetResourceGroup property: For an unmapped custom resource, its labels will be used to find matching
     * resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the
     * unmapped custom resource will be projected to the target resource group associated with this resource sync rule.
     * The user creating this resource sync rule should have write permissions on the target resource group and this
     * write permission will be validated when creating the resource sync rule.
     *
     * @return the targetResourceGroup value.
     */
    String targetResourceGroup();

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

    /** The entirety of the ResourceSyncRule definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithLocation,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithCreate {
    }
    /** The ResourceSyncRule definition stages. */
    interface DefinitionStages {
        /** The first stage of the ResourceSyncRule definition. */
        interface Blank extends WithLocation {
        }
        /** The stage of the ResourceSyncRule 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.
             */
            WithParentResource withRegion(Region location);

            /**
             * Specifies the region for the resource.
             *
             * @param location The geo-location where the resource lives.
             * @return the next definition stage.
             */
            WithParentResource withRegion(String location);
        }
        /** The stage of the ResourceSyncRule definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, resourceName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param resourceName Custom Locations name.
             * @return the next definition stage.
             */
            WithCreate withExistingCustomLocation(String resourceGroupName, String resourceName);
        }
        /**
         * The stage of the ResourceSyncRule 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.WithPriority,
                DefinitionStages.WithSelector,
                DefinitionStages.WithTargetResourceGroup {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ResourceSyncRule create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ResourceSyncRule create(Context context);
        }
        /** The stage of the ResourceSyncRule 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 ResourceSyncRule definition allowing to specify priority. */
        interface WithPriority {
            /**
             * Specifies the priority property: Priority represents a priority of the Resource Sync Rule.
             *
             * @param priority Priority represents a priority of the Resource Sync Rule.
             * @return the next definition stage.
             */
            WithCreate withPriority(Integer priority);
        }
        /** The stage of the ResourceSyncRule definition allowing to specify selector. */
        interface WithSelector {
            /**
             * Specifies the selector property: A label selector is composed of two parts, matchLabels and
             * matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the
             * matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator
             * is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of
             * resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values
             * set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and
             * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied
             * in order to match..
             *
             * @param selector A label selector is composed of two parts, matchLabels and matchExpressions. The first
             *     part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
             *     equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the
             *     values array contains only 'value'. The second part, matchExpressions is a list of resource selector
             *     requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be
             *     non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and
             *     DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be
             *     satisfied in order to match.
             * @return the next definition stage.
             */
            WithCreate withSelector(ResourceSyncRulePropertiesSelector selector);
        }
        /** The stage of the ResourceSyncRule definition allowing to specify targetResourceGroup. */
        interface WithTargetResourceGroup {
            /**
             * Specifies the targetResourceGroup property: For an unmapped custom resource, its labels will be used to
             * find matching resource sync rules. If this resource sync rule is one of the matching rules with highest
             * priority, then the unmapped custom resource will be projected to the target resource group associated
             * with this resource sync rule. The user creating this resource sync rule should have write permissions on
             * the target resource group and this write permission will be validated when creating the resource sync
             * rule..
             *
             * @param targetResourceGroup For an unmapped custom resource, its labels will be used to find matching
             *     resource sync rules. If this resource sync rule is one of the matching rules with highest priority,
             *     then the unmapped custom resource will be projected to the target resource group associated with this
             *     resource sync rule. The user creating this resource sync rule should have write permissions on the
             *     target resource group and this write permission will be validated when creating the resource sync
             *     rule.
             * @return the next definition stage.
             */
            WithCreate withTargetResourceGroup(String targetResourceGroup);
        }
    }
    /**
     * Begins update for the ResourceSyncRule resource.
     *
     * @return the stage of resource update.
     */
    ResourceSyncRule.Update update();

    /** The template for ResourceSyncRule update. */
    interface Update
        extends UpdateStages.WithTags,
            UpdateStages.WithPriority,
            UpdateStages.WithSelector,
            UpdateStages.WithTargetResourceGroup {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ResourceSyncRule apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ResourceSyncRule apply(Context context);
    }
    /** The ResourceSyncRule update stages. */
    interface UpdateStages {
        /** The stage of the ResourceSyncRule 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 ResourceSyncRule update allowing to specify priority. */
        interface WithPriority {
            /**
             * Specifies the priority property: Priority represents a priority of the Resource Sync Rule.
             *
             * @param priority Priority represents a priority of the Resource Sync Rule.
             * @return the next definition stage.
             */
            Update withPriority(Integer priority);
        }
        /** The stage of the ResourceSyncRule update allowing to specify selector. */
        interface WithSelector {
            /**
             * Specifies the selector property: A label selector is composed of two parts, matchLabels and
             * matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the
             * matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator
             * is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of
             * resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values
             * set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and
             * DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied
             * in order to match..
             *
             * @param selector A label selector is composed of two parts, matchLabels and matchExpressions. The first
             *     part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is
             *     equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the
             *     values array contains only 'value'. The second part, matchExpressions is a list of resource selector
             *     requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be
             *     non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and
             *     DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be
             *     satisfied in order to match.
             * @return the next definition stage.
             */
            Update withSelector(ResourceSyncRulePropertiesSelector selector);
        }
        /** The stage of the ResourceSyncRule update allowing to specify targetResourceGroup. */
        interface WithTargetResourceGroup {
            /**
             * Specifies the targetResourceGroup property: For an unmapped custom resource, its labels will be used to
             * find matching resource sync rules. If this resource sync rule is one of the matching rules with highest
             * priority, then the unmapped custom resource will be projected to the target resource group associated
             * with this resource sync rule. The user creating this resource sync rule should have write permissions on
             * the target resource group and this write permission will be validated when creating the resource sync
             * rule..
             *
             * @param targetResourceGroup For an unmapped custom resource, its labels will be used to find matching
             *     resource sync rules. If this resource sync rule is one of the matching rules with highest priority,
             *     then the unmapped custom resource will be projected to the target resource group associated with this
             *     resource sync rule. The user creating this resource sync rule should have write permissions on the
             *     target resource group and this write permission will be validated when creating the resource sync
             *     rule.
             * @return the next definition stage.
             */
            Update withTargetResourceGroup(String targetResourceGroup);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ResourceSyncRule refresh();

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