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

package com.azure.resourcemanager.machinelearningservices.models;

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

/** Request to create a Docker image based on Environment. */
@Fluent
public class EnvironmentImageResponse {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentImageResponse.class);

    /*
     * The name of the driver file.
     */
    @JsonProperty(value = "driverProgram")
    private String driverProgram;

    /*
     * The list of assets.
     */
    @JsonProperty(value = "assets")
    private List<ImageAsset> assets;

    /*
     * The list of model Ids.
     */
    @JsonProperty(value = "modelIds")
    private List<String> modelIds;

    /*
     * The list of models.
     */
    @JsonProperty(value = "models")
    private List<Model> models;

    /*
     * The details of the AZURE ML environment.
     */
    @JsonProperty(value = "environment")
    private EnvironmentImageResponseEnvironment environment;

    /*
     * The unique identifying details of the AZURE ML environment.
     */
    @JsonProperty(value = "environmentReference")
    private EnvironmentImageResponseEnvironmentReference environmentReference;

    /**
     * Get the driverProgram property: The name of the driver file.
     *
     * @return the driverProgram value.
     */
    public String driverProgram() {
        return this.driverProgram;
    }

    /**
     * Set the driverProgram property: The name of the driver file.
     *
     * @param driverProgram the driverProgram value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withDriverProgram(String driverProgram) {
        this.driverProgram = driverProgram;
        return this;
    }

    /**
     * Get the assets property: The list of assets.
     *
     * @return the assets value.
     */
    public List<ImageAsset> assets() {
        return this.assets;
    }

    /**
     * Set the assets property: The list of assets.
     *
     * @param assets the assets value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withAssets(List<ImageAsset> assets) {
        this.assets = assets;
        return this;
    }

    /**
     * Get the modelIds property: The list of model Ids.
     *
     * @return the modelIds value.
     */
    public List<String> modelIds() {
        return this.modelIds;
    }

    /**
     * Set the modelIds property: The list of model Ids.
     *
     * @param modelIds the modelIds value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withModelIds(List<String> modelIds) {
        this.modelIds = modelIds;
        return this;
    }

    /**
     * Get the models property: The list of models.
     *
     * @return the models value.
     */
    public List<Model> models() {
        return this.models;
    }

    /**
     * Set the models property: The list of models.
     *
     * @param models the models value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withModels(List<Model> models) {
        this.models = models;
        return this;
    }

    /**
     * Get the environment property: The details of the AZURE ML environment.
     *
     * @return the environment value.
     */
    public EnvironmentImageResponseEnvironment environment() {
        return this.environment;
    }

    /**
     * Set the environment property: The details of the AZURE ML environment.
     *
     * @param environment the environment value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withEnvironment(EnvironmentImageResponseEnvironment environment) {
        this.environment = environment;
        return this;
    }

    /**
     * Get the environmentReference property: The unique identifying details of the AZURE ML environment.
     *
     * @return the environmentReference value.
     */
    public EnvironmentImageResponseEnvironmentReference environmentReference() {
        return this.environmentReference;
    }

    /**
     * Set the environmentReference property: The unique identifying details of the AZURE ML environment.
     *
     * @param environmentReference the environmentReference value to set.
     * @return the EnvironmentImageResponse object itself.
     */
    public EnvironmentImageResponse withEnvironmentReference(
        EnvironmentImageResponseEnvironmentReference environmentReference) {
        this.environmentReference = environmentReference;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (assets() != null) {
            assets().forEach(e -> e.validate());
        }
        if (models() != null) {
            models().forEach(e -> e.validate());
        }
        if (environment() != null) {
            environment().validate();
        }
        if (environmentReference() != null) {
            environmentReference().validate();
        }
    }
}
