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

package com.azure.resourcemanager.redisenterprise.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Regenerate access keys request
 *
 * <p>Specifies which access keys to reset to a new random value.
 */
@Fluent
public final class RegenerateKeyParameters {
    /*
     * Which access key to regenerate.
     */
    @JsonProperty(value = "keyType", required = true)
    private AccessKeyType keyType;

    /** Creates an instance of RegenerateKeyParameters class. */
    public RegenerateKeyParameters() {
    }

    /**
     * Get the keyType property: Which access key to regenerate.
     *
     * @return the keyType value.
     */
    public AccessKeyType keyType() {
        return this.keyType;
    }

    /**
     * Set the keyType property: Which access key to regenerate.
     *
     * @param keyType the keyType value to set.
     * @return the RegenerateKeyParameters object itself.
     */
    public RegenerateKeyParameters withKeyType(AccessKeyType keyType) {
        this.keyType = keyType;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (keyType() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property keyType in model RegenerateKeyParameters"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RegenerateKeyParameters.class);
}
