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

package com.azure.resourcemanager.appconfiguration.models;

import com.azure.core.util.Context;
import com.azure.resourcemanager.appconfiguration.fluent.models.KeyValueInner;
import java.time.OffsetDateTime;
import java.util.Map;

/** An immutable client-side representation of KeyValue. */
public interface KeyValue {
    /**
     * 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 key property: The primary identifier of a key-value. The key is used in unison with the label to
     * uniquely identify a key-value.
     *
     * @return the key value.
     */
    String key();

    /**
     * Gets the label property: A value used to group key-values. The label is used in unison with the key to uniquely
     * identify a key-value.
     *
     * @return the label value.
     */
    String label();

    /**
     * Gets the value property: The value of the key-value.
     *
     * @return the value value.
     */
    String value();

    /**
     * Gets the contentType property: The content type of the key-value's value. Providing a proper content-type can
     * enable transformations of values when they are retrieved by applications.
     *
     * @return the contentType value.
     */
    String contentType();

    /**
     * Gets the etag property: An ETag indicating the state of a key-value within a configuration store.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the lastModified property: The last time a modifying operation was performed on the given key-value.
     *
     * @return the lastModified value.
     */
    OffsetDateTime lastModified();

    /**
     * Gets the locked property: A value indicating whether the key-value is locked. A locked key-value may not be
     * modified until it is unlocked.
     *
     * @return the locked value.
     */
    Boolean locked();

    /**
     * Gets the tags property: A dictionary of tags that can help identify what a key-value may be applicable for.
     *
     * @return the tags value.
     */
    Map<String, String> tags();

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

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

    /** The entirety of the KeyValue definition. */
    interface Definition
        extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
    }
    /** The KeyValue definition stages. */
    interface DefinitionStages {
        /** The first stage of the KeyValue definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the KeyValue definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, configStoreName.
             *
             * @param resourceGroupName The name of the resource group to which the container registry belongs.
             * @param configStoreName The name of the configuration store.
             * @return the next definition stage.
             */
            WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName);
        }
        /**
         * The stage of the KeyValue 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.WithValue, DefinitionStages.WithContentType {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            KeyValue create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            KeyValue create(Context context);
        }
        /** The stage of the KeyValue definition allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: A dictionary of tags that can help identify what a key-value may be
             * applicable for..
             *
             * @param tags A dictionary of tags that can help identify what a key-value may be applicable for.
             * @return the next definition stage.
             */
            WithCreate withTags(Map<String, String> tags);
        }
        /** The stage of the KeyValue definition allowing to specify value. */
        interface WithValue {
            /**
             * Specifies the value property: The value of the key-value..
             *
             * @param value The value of the key-value.
             * @return the next definition stage.
             */
            WithCreate withValue(String value);
        }
        /** The stage of the KeyValue definition allowing to specify contentType. */
        interface WithContentType {
            /**
             * Specifies the contentType property: The content type of the key-value's value. Providing a proper
             * content-type can enable transformations of values when they are retrieved by applications..
             *
             * @param contentType The content type of the key-value's value. Providing a proper content-type can enable
             *     transformations of values when they are retrieved by applications.
             * @return the next definition stage.
             */
            WithCreate withContentType(String contentType);
        }
    }
    /**
     * Begins update for the KeyValue resource.
     *
     * @return the stage of resource update.
     */
    KeyValue.Update update();

    /** The template for KeyValue update. */
    interface Update extends UpdateStages.WithTags, UpdateStages.WithValue, UpdateStages.WithContentType {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        KeyValue apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        KeyValue apply(Context context);
    }
    /** The KeyValue update stages. */
    interface UpdateStages {
        /** The stage of the KeyValue update allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: A dictionary of tags that can help identify what a key-value may be
             * applicable for..
             *
             * @param tags A dictionary of tags that can help identify what a key-value may be applicable for.
             * @return the next definition stage.
             */
            Update withTags(Map<String, String> tags);
        }
        /** The stage of the KeyValue update allowing to specify value. */
        interface WithValue {
            /**
             * Specifies the value property: The value of the key-value..
             *
             * @param value The value of the key-value.
             * @return the next definition stage.
             */
            Update withValue(String value);
        }
        /** The stage of the KeyValue update allowing to specify contentType. */
        interface WithContentType {
            /**
             * Specifies the contentType property: The content type of the key-value's value. Providing a proper
             * content-type can enable transformations of values when they are retrieved by applications..
             *
             * @param contentType The content type of the key-value's value. Providing a proper content-type can enable
             *     transformations of values when they are retrieved by applications.
             * @return the next definition stage.
             */
            Update withContentType(String contentType);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    KeyValue refresh();

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