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

package com.azure.resourcemanager.automation.models;

import com.azure.core.util.Context;
import com.azure.resourcemanager.automation.fluent.models.ConnectionTypeInner;
import java.time.OffsetDateTime;
import java.util.Map;

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

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

    /**
     * Gets the type property: Resource type.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the isGlobal property: Gets or sets a Boolean value to indicate if the connection type is global.
     *
     * @return the isGlobal value.
     */
    Boolean isGlobal();

    /**
     * Gets the fieldDefinitions property: Gets the field definitions of the connection type.
     *
     * @return the fieldDefinitions value.
     */
    Map<String, FieldDefinition> fieldDefinitions();

    /**
     * Gets the creationTime property: Gets the creation time.
     *
     * @return the creationTime value.
     */
    OffsetDateTime creationTime();

    /**
     * Gets the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @return the lastModifiedTime value.
     */
    OffsetDateTime lastModifiedTime();

    /**
     * Gets the description property: Gets or sets the description.
     *
     * @return the description value.
     */
    String description();

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

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

    /** The entirety of the ConnectionType definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithName,
            DefinitionStages.WithFieldDefinitions,
            DefinitionStages.WithCreate {
    }
    /** The ConnectionType definition stages. */
    interface DefinitionStages {
        /** The first stage of the ConnectionType definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the ConnectionType definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, automationAccountName.
             *
             * @param resourceGroupName Name of an Azure Resource group.
             * @param automationAccountName The name of the automation account.
             * @return the next definition stage.
             */
            WithName withExistingAutomationAccount(String resourceGroupName, String automationAccountName);
        }
        /** The stage of the ConnectionType definition allowing to specify name. */
        interface WithName {
            /**
             * Specifies the name property: Gets or sets the name of the connection type..
             *
             * @param name Gets or sets the name of the connection type.
             * @return the next definition stage.
             */
            WithFieldDefinitions withName(String name);
        }
        /** The stage of the ConnectionType definition allowing to specify fieldDefinitions. */
        interface WithFieldDefinitions {
            /**
             * Specifies the fieldDefinitions property: Gets or sets the field definitions of the connection type..
             *
             * @param fieldDefinitions Gets or sets the field definitions of the connection type.
             * @return the next definition stage.
             */
            WithCreate withFieldDefinitions(Map<String, FieldDefinition> fieldDefinitions);
        }
        /**
         * The stage of the ConnectionType 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.WithIsGlobal {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            ConnectionType create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            ConnectionType create(Context context);
        }
        /** The stage of the ConnectionType definition allowing to specify isGlobal. */
        interface WithIsGlobal {
            /**
             * Specifies the isGlobal property: Gets or sets a Boolean value to indicate if the connection type is
             * global..
             *
             * @param isGlobal Gets or sets a Boolean value to indicate if the connection type is global.
             * @return the next definition stage.
             */
            WithCreate withIsGlobal(Boolean isGlobal);
        }
    }
    /**
     * Begins update for the ConnectionType resource.
     *
     * @return the stage of resource update.
     */
    ConnectionType.Update update();

    /** The template for ConnectionType update. */
    interface Update extends UpdateStages.WithName, UpdateStages.WithIsGlobal, UpdateStages.WithFieldDefinitions {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        ConnectionType apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        ConnectionType apply(Context context);
    }
    /** The ConnectionType update stages. */
    interface UpdateStages {
        /** The stage of the ConnectionType update allowing to specify name. */
        interface WithName {
            /**
             * Specifies the name property: Gets or sets the name of the connection type..
             *
             * @param name Gets or sets the name of the connection type.
             * @return the next definition stage.
             */
            Update withName(String name);
        }
        /** The stage of the ConnectionType update allowing to specify isGlobal. */
        interface WithIsGlobal {
            /**
             * Specifies the isGlobal property: Gets or sets a Boolean value to indicate if the connection type is
             * global..
             *
             * @param isGlobal Gets or sets a Boolean value to indicate if the connection type is global.
             * @return the next definition stage.
             */
            Update withIsGlobal(Boolean isGlobal);
        }
        /** The stage of the ConnectionType update allowing to specify fieldDefinitions. */
        interface WithFieldDefinitions {
            /**
             * Specifies the fieldDefinitions property: Gets or sets the field definitions of the connection type..
             *
             * @param fieldDefinitions Gets or sets the field definitions of the connection type.
             * @return the next definition stage.
             */
            Update withFieldDefinitions(Map<String, FieldDefinition> fieldDefinitions);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    ConnectionType refresh();

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