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

package com.azure.resourcemanager.dnsresolver.models;

import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.dnsresolver.fluent.models.ForwardingRuleInner;
import java.util.List;
import java.util.Map;

/** An immutable client-side representation of ForwardingRule. */
public interface ForwardingRule {
    /**
     * 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 etag property: ETag of the forwarding rule.
     *
     * @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 domainName property: The domain name for the forwarding rule.
     *
     * @return the domainName value.
     */
    String domainName();

    /**
     * Gets the targetDnsServers property: DNS servers to forward the DNS query to.
     *
     * @return the targetDnsServers value.
     */
    List<TargetDnsServer> targetDnsServers();

    /**
     * Gets the metadata property: Metadata attached to the forwarding rule.
     *
     * @return the metadata value.
     */
    Map<String, String> metadata();

    /**
     * Gets the forwardingRuleState property: The state of forwarding rule.
     *
     * @return the forwardingRuleState value.
     */
    ForwardingRuleState forwardingRuleState();

    /**
     * Gets the provisioningState property: The current provisioning state of the forwarding rule. This is a read-only
     * property and any attempt to set this value will be ignored.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

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

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

    /** The entirety of the ForwardingRule definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithDomainName,
            DefinitionStages.WithTargetDnsServers,
            DefinitionStages.WithCreate {
    }
    /** The ForwardingRule definition stages. */
    interface DefinitionStages {
        /** The first stage of the ForwardingRule definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the ForwardingRule definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, dnsForwardingRulesetName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param dnsForwardingRulesetName The name of the DNS forwarding ruleset.
             * @return the next definition stage.
             */
            WithDomainName withExistingDnsForwardingRuleset(String resourceGroupName, String dnsForwardingRulesetName);
        }
        /** The stage of the ForwardingRule definition allowing to specify domainName. */
        interface WithDomainName {
            /**
             * Specifies the domainName property: The domain name for the forwarding rule..
             *
             * @param domainName The domain name for the forwarding rule.
             * @return the next definition stage.
             */
            WithTargetDnsServers withDomainName(String domainName);
        }
        /** The stage of the ForwardingRule definition allowing to specify targetDnsServers. */
        interface WithTargetDnsServers {
            /**
             * Specifies the targetDnsServers property: DNS servers to forward the DNS query to..
             *
             * @param targetDnsServers DNS servers to forward the DNS query to.
             * @return the next definition stage.
             */
            WithCreate withTargetDnsServers(List<TargetDnsServer> targetDnsServers);
        }
        /**
         * The stage of the ForwardingRule 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.WithMetadata,
                DefinitionStages.WithForwardingRuleState,
                DefinitionStages.WithIfMatch,
                DefinitionStages.WithIfNoneMatch {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ForwardingRule create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ForwardingRule create(Context context);
        }
        /** The stage of the ForwardingRule definition allowing to specify metadata. */
        interface WithMetadata {
            /**
             * Specifies the metadata property: Metadata attached to the forwarding rule..
             *
             * @param metadata Metadata attached to the forwarding rule.
             * @return the next definition stage.
             */
            WithCreate withMetadata(Map<String, String> metadata);
        }
        /** The stage of the ForwardingRule definition allowing to specify forwardingRuleState. */
        interface WithForwardingRuleState {
            /**
             * Specifies the forwardingRuleState property: The state of forwarding rule..
             *
             * @param forwardingRuleState The state of forwarding rule.
             * @return the next definition stage.
             */
            WithCreate withForwardingRuleState(ForwardingRuleState forwardingRuleState);
        }
        /** The stage of the ForwardingRule definition allowing to specify ifMatch. */
        interface WithIfMatch {
            /**
             * Specifies the ifMatch property: ETag of the resource. Omit this value to always overwrite the current
             * resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes..
             *
             * @param ifMatch ETag of the resource. Omit this value to always overwrite the current resource. Specify
             *     the last-seen ETag value to prevent accidentally overwriting any concurrent changes.
             * @return the next definition stage.
             */
            WithCreate withIfMatch(String ifMatch);
        }
        /** The stage of the ForwardingRule definition allowing to specify ifNoneMatch. */
        interface WithIfNoneMatch {
            /**
             * Specifies the ifNoneMatch property: Set to '*' to allow a new resource to be created, but to prevent
             * updating an existing resource. Other values will be ignored..
             *
             * @param ifNoneMatch Set to '*' to allow a new resource to be created, but to prevent updating an existing
             *     resource. Other values will be ignored.
             * @return the next definition stage.
             */
            WithCreate withIfNoneMatch(String ifNoneMatch);
        }
    }
    /**
     * Begins update for the ForwardingRule resource.
     *
     * @return the stage of resource update.
     */
    ForwardingRule.Update update();

    /** The template for ForwardingRule update. */
    interface Update
        extends UpdateStages.WithTargetDnsServers,
            UpdateStages.WithMetadata,
            UpdateStages.WithForwardingRuleState,
            UpdateStages.WithIfMatch {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ForwardingRule apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ForwardingRule apply(Context context);
    }
    /** The ForwardingRule update stages. */
    interface UpdateStages {
        /** The stage of the ForwardingRule update allowing to specify targetDnsServers. */
        interface WithTargetDnsServers {
            /**
             * Specifies the targetDnsServers property: DNS servers to forward the DNS query to..
             *
             * @param targetDnsServers DNS servers to forward the DNS query to.
             * @return the next definition stage.
             */
            Update withTargetDnsServers(List<TargetDnsServer> targetDnsServers);
        }
        /** The stage of the ForwardingRule update allowing to specify metadata. */
        interface WithMetadata {
            /**
             * Specifies the metadata property: Metadata attached to the forwarding rule..
             *
             * @param metadata Metadata attached to the forwarding rule.
             * @return the next definition stage.
             */
            Update withMetadata(Map<String, String> metadata);
        }
        /** The stage of the ForwardingRule update allowing to specify forwardingRuleState. */
        interface WithForwardingRuleState {
            /**
             * Specifies the forwardingRuleState property: The state of forwarding rule..
             *
             * @param forwardingRuleState The state of forwarding rule.
             * @return the next definition stage.
             */
            Update withForwardingRuleState(ForwardingRuleState forwardingRuleState);
        }
        /** The stage of the ForwardingRule update allowing to specify ifMatch. */
        interface WithIfMatch {
            /**
             * Specifies the ifMatch property: ETag of the resource. Omit this value to always overwrite the current
             * resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes..
             *
             * @param ifMatch ETag of the resource. Omit this value to always overwrite the current resource. Specify
             *     the last-seen ETag value to prevent accidentally overwriting any concurrent changes.
             * @return the next definition stage.
             */
            Update withIfMatch(String ifMatch);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ForwardingRule refresh();

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