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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.securityinsights.fluent.models.AutomationRuleInner;
import java.time.OffsetDateTime;
import java.util.List;

/** An immutable client-side representation of AutomationRule. */
public interface AutomationRule {
    /**
     * 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 azure resource.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the displayName property: The display name of the automation rule.
     *
     * @return the displayName value.
     */
    String displayName();

    /**
     * Gets the order property: The order of execution of the automation rule.
     *
     * @return the order value.
     */
    int order();

    /**
     * Gets the triggeringLogic property: Describes automation rule triggering logic.
     *
     * @return the triggeringLogic value.
     */
    AutomationRuleTriggeringLogic triggeringLogic();

    /**
     * Gets the actions property: The actions to execute when the automation rule is triggered.
     *
     * @return the actions value.
     */
    List<AutomationRuleAction> actions();

    /**
     * Gets the lastModifiedTimeUtc property: The last time the automation rule was updated.
     *
     * @return the lastModifiedTimeUtc value.
     */
    OffsetDateTime lastModifiedTimeUtc();

    /**
     * Gets the createdTimeUtc property: The time the automation rule was created.
     *
     * @return the createdTimeUtc value.
     */
    OffsetDateTime createdTimeUtc();

    /**
     * Gets the lastModifiedBy property: Information on the client (user or application) that made some action.
     *
     * @return the lastModifiedBy value.
     */
    ClientInfo lastModifiedBy();

    /**
     * Gets the createdBy property: Information on the client (user or application) that made some action.
     *
     * @return the createdBy value.
     */
    ClientInfo createdBy();

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

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

    /** The entirety of the AutomationRule definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithDisplayName,
            DefinitionStages.WithOrder,
            DefinitionStages.WithTriggeringLogic,
            DefinitionStages.WithActions,
            DefinitionStages.WithCreate {
    }
    /** The AutomationRule definition stages. */
    interface DefinitionStages {
        /** The first stage of the AutomationRule definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the AutomationRule definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, workspaceName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param workspaceName The name of the workspace.
             * @return the next definition stage.
             */
            WithDisplayName withExistingWorkspace(String resourceGroupName, String workspaceName);
        }
        /** The stage of the AutomationRule definition allowing to specify displayName. */
        interface WithDisplayName {
            /**
             * Specifies the displayName property: The display name of the automation rule..
             *
             * @param displayName The display name of the automation rule.
             * @return the next definition stage.
             */
            WithOrder withDisplayName(String displayName);
        }
        /** The stage of the AutomationRule definition allowing to specify order. */
        interface WithOrder {
            /**
             * Specifies the order property: The order of execution of the automation rule..
             *
             * @param order The order of execution of the automation rule.
             * @return the next definition stage.
             */
            WithTriggeringLogic withOrder(int order);
        }
        /** The stage of the AutomationRule definition allowing to specify triggeringLogic. */
        interface WithTriggeringLogic {
            /**
             * Specifies the triggeringLogic property: Describes automation rule triggering logic..
             *
             * @param triggeringLogic Describes automation rule triggering logic.
             * @return the next definition stage.
             */
            WithActions withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic);
        }
        /** The stage of the AutomationRule definition allowing to specify actions. */
        interface WithActions {
            /**
             * Specifies the actions property: The actions to execute when the automation rule is triggered..
             *
             * @param actions The actions to execute when the automation rule is triggered.
             * @return the next definition stage.
             */
            WithCreate withActions(List<AutomationRuleAction> actions);
        }
        /**
         * The stage of the AutomationRule 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.WithEtag {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            AutomationRule create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            AutomationRule create(Context context);
        }
        /** The stage of the AutomationRule definition allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: Etag of the azure resource.
             *
             * @param etag Etag of the azure resource.
             * @return the next definition stage.
             */
            WithCreate withEtag(String etag);
        }
    }
    /**
     * Begins update for the AutomationRule resource.
     *
     * @return the stage of resource update.
     */
    AutomationRule.Update update();

    /** The template for AutomationRule update. */
    interface Update
        extends UpdateStages.WithEtag,
            UpdateStages.WithDisplayName,
            UpdateStages.WithOrder,
            UpdateStages.WithTriggeringLogic,
            UpdateStages.WithActions {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        AutomationRule apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        AutomationRule apply(Context context);
    }
    /** The AutomationRule update stages. */
    interface UpdateStages {
        /** The stage of the AutomationRule update allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: Etag of the azure resource.
             *
             * @param etag Etag of the azure resource.
             * @return the next definition stage.
             */
            Update withEtag(String etag);
        }
        /** The stage of the AutomationRule update allowing to specify displayName. */
        interface WithDisplayName {
            /**
             * Specifies the displayName property: The display name of the automation rule..
             *
             * @param displayName The display name of the automation rule.
             * @return the next definition stage.
             */
            Update withDisplayName(String displayName);
        }
        /** The stage of the AutomationRule update allowing to specify order. */
        interface WithOrder {
            /**
             * Specifies the order property: The order of execution of the automation rule..
             *
             * @param order The order of execution of the automation rule.
             * @return the next definition stage.
             */
            Update withOrder(int order);
        }
        /** The stage of the AutomationRule update allowing to specify triggeringLogic. */
        interface WithTriggeringLogic {
            /**
             * Specifies the triggeringLogic property: Describes automation rule triggering logic..
             *
             * @param triggeringLogic Describes automation rule triggering logic.
             * @return the next definition stage.
             */
            Update withTriggeringLogic(AutomationRuleTriggeringLogic triggeringLogic);
        }
        /** The stage of the AutomationRule update allowing to specify actions. */
        interface WithActions {
            /**
             * Specifies the actions property: The actions to execute when the automation rule is triggered..
             *
             * @param actions The actions to execute when the automation rule is triggered.
             * @return the next definition stage.
             */
            Update withActions(List<AutomationRuleAction> actions);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    AutomationRule refresh();

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