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

package com.azure.resourcemanager.hdinsight.containers.models;

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

/** The storage profile. */
@Fluent
public final class FlinkStorageProfile {
    /*
     * Storage account uri which is used for savepoint and checkpoint state.
     */
    @JsonProperty(value = "storageUri", required = true)
    private String storageUri;

    /*
     * Storage key is only required for wasb(s) storage.
     */
    @JsonProperty(value = "storagekey")
    private String storagekey;

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

    /**
     * Get the storageUri property: Storage account uri which is used for savepoint and checkpoint state.
     *
     * @return the storageUri value.
     */
    public String storageUri() {
        return this.storageUri;
    }

    /**
     * Set the storageUri property: Storage account uri which is used for savepoint and checkpoint state.
     *
     * @param storageUri the storageUri value to set.
     * @return the FlinkStorageProfile object itself.
     */
    public FlinkStorageProfile withStorageUri(String storageUri) {
        this.storageUri = storageUri;
        return this;
    }

    /**
     * Get the storagekey property: Storage key is only required for wasb(s) storage.
     *
     * @return the storagekey value.
     */
    public String storagekey() {
        return this.storagekey;
    }

    /**
     * Set the storagekey property: Storage key is only required for wasb(s) storage.
     *
     * @param storagekey the storagekey value to set.
     * @return the FlinkStorageProfile object itself.
     */
    public FlinkStorageProfile withStoragekey(String storagekey) {
        this.storagekey = storagekey;
        return this;
    }

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

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