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

package com.azure.resourcemanager.logic.models;

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

/** The list key vault keys definition. */
@Fluent
public final class ListKeyVaultKeysDefinition {
    /*
     * The key vault reference.
     */
    @JsonProperty(value = "keyVault", required = true)
    private KeyVaultReference keyVault;

    /*
     * The skip token.
     */
    @JsonProperty(value = "skipToken")
    private String skipToken;

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

    /**
     * Get the keyVault property: The key vault reference.
     *
     * @return the keyVault value.
     */
    public KeyVaultReference keyVault() {
        return this.keyVault;
    }

    /**
     * Set the keyVault property: The key vault reference.
     *
     * @param keyVault the keyVault value to set.
     * @return the ListKeyVaultKeysDefinition object itself.
     */
    public ListKeyVaultKeysDefinition withKeyVault(KeyVaultReference keyVault) {
        this.keyVault = keyVault;
        return this;
    }

    /**
     * Get the skipToken property: The skip token.
     *
     * @return the skipToken value.
     */
    public String skipToken() {
        return this.skipToken;
    }

    /**
     * Set the skipToken property: The skip token.
     *
     * @param skipToken the skipToken value to set.
     * @return the ListKeyVaultKeysDefinition object itself.
     */
    public ListKeyVaultKeysDefinition withSkipToken(String skipToken) {
        this.skipToken = skipToken;
        return this;
    }

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

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