// 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.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Model asset version details. */
@Fluent
public final class ModelVersionProperties extends AssetBase {
    /*
     * Mapping of model flavors to their properties.
     */
    @JsonProperty(value = "flavors")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, FlavorData> flavors;

    /*
     * Name of the training job which produced this model
     */
    @JsonProperty(value = "jobName")
    private String jobName;

    /*
     * The storage format for this entity. Used for NCD.
     */
    @JsonProperty(value = "modelType")
    private String modelType;

    /*
     * The URI path to the model contents.
     */
    @JsonProperty(value = "modelUri")
    private String modelUri;

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

    /**
     * Get the flavors property: Mapping of model flavors to their properties.
     *
     * @return the flavors value.
     */
    public Map<String, FlavorData> flavors() {
        return this.flavors;
    }

    /**
     * Set the flavors property: Mapping of model flavors to their properties.
     *
     * @param flavors the flavors value to set.
     * @return the ModelVersionProperties object itself.
     */
    public ModelVersionProperties withFlavors(Map<String, FlavorData> flavors) {
        this.flavors = flavors;
        return this;
    }

    /**
     * Get the jobName property: Name of the training job which produced this model.
     *
     * @return the jobName value.
     */
    public String jobName() {
        return this.jobName;
    }

    /**
     * Set the jobName property: Name of the training job which produced this model.
     *
     * @param jobName the jobName value to set.
     * @return the ModelVersionProperties object itself.
     */
    public ModelVersionProperties withJobName(String jobName) {
        this.jobName = jobName;
        return this;
    }

    /**
     * Get the modelType property: The storage format for this entity. Used for NCD.
     *
     * @return the modelType value.
     */
    public String modelType() {
        return this.modelType;
    }

    /**
     * Set the modelType property: The storage format for this entity. Used for NCD.
     *
     * @param modelType the modelType value to set.
     * @return the ModelVersionProperties object itself.
     */
    public ModelVersionProperties withModelType(String modelType) {
        this.modelType = modelType;
        return this;
    }

    /**
     * Get the modelUri property: The URI path to the model contents.
     *
     * @return the modelUri value.
     */
    public String modelUri() {
        return this.modelUri;
    }

    /**
     * Set the modelUri property: The URI path to the model contents.
     *
     * @param modelUri the modelUri value to set.
     * @return the ModelVersionProperties object itself.
     */
    public ModelVersionProperties withModelUri(String modelUri) {
        this.modelUri = modelUri;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ModelVersionProperties withIsAnonymous(Boolean isAnonymous) {
        super.withIsAnonymous(isAnonymous);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ModelVersionProperties withIsArchived(Boolean isArchived) {
        super.withIsArchived(isArchived);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ModelVersionProperties withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ModelVersionProperties withProperties(Map<String, String> properties) {
        super.withProperties(properties);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ModelVersionProperties withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (flavors() != null) {
            flavors()
                .values()
                .forEach(
                    e -> {
                        if (e != null) {
                            e.validate();
                        }
                    });
        }
    }
}
