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

package com.azure.resourcemanager.machinelearning.models;

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

/** Reference to an asset via its ARM resource ID. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "referenceType")
@JsonTypeName("Id")
@Fluent
public final class IdAssetReference extends AssetReferenceBase {
    /*
     * [Required] ARM resource ID of the asset.
     */
    @JsonProperty(value = "assetId", required = true)
    private String assetId;

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

    /**
     * Get the assetId property: [Required] ARM resource ID of the asset.
     *
     * @return the assetId value.
     */
    public String assetId() {
        return this.assetId;
    }

    /**
     * Set the assetId property: [Required] ARM resource ID of the asset.
     *
     * @param assetId the assetId value to set.
     * @return the IdAssetReference object itself.
     */
    public IdAssetReference withAssetId(String assetId) {
        this.assetId = assetId;
        return this;
    }

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

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