// 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;

/** Base definition for endpoint deployment. */
@Fluent
public class EndpointDeploymentPropertiesBase {
    /*
     * Code configuration for the endpoint deployment.
     */
    @JsonProperty(value = "codeConfiguration")
    private CodeConfiguration codeConfiguration;

    /*
     * Description of the endpoint deployment.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * ARM resource ID or AssetId of the environment specification for the endpoint deployment.
     */
    @JsonProperty(value = "environmentId")
    private String environmentId;

    /*
     * Environment variables configuration for the deployment.
     */
    @JsonProperty(value = "environmentVariables")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> environmentVariables;

    /*
     * Property dictionary. Properties can be added, but not removed or altered.
     */
    @JsonProperty(value = "properties")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> properties;

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

    /**
     * Get the codeConfiguration property: Code configuration for the endpoint deployment.
     *
     * @return the codeConfiguration value.
     */
    public CodeConfiguration codeConfiguration() {
        return this.codeConfiguration;
    }

    /**
     * Set the codeConfiguration property: Code configuration for the endpoint deployment.
     *
     * @param codeConfiguration the codeConfiguration value to set.
     * @return the EndpointDeploymentPropertiesBase object itself.
     */
    public EndpointDeploymentPropertiesBase withCodeConfiguration(CodeConfiguration codeConfiguration) {
        this.codeConfiguration = codeConfiguration;
        return this;
    }

    /**
     * Get the description property: Description of the endpoint deployment.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Description of the endpoint deployment.
     *
     * @param description the description value to set.
     * @return the EndpointDeploymentPropertiesBase object itself.
     */
    public EndpointDeploymentPropertiesBase withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint
     * deployment.
     *
     * @return the environmentId value.
     */
    public String environmentId() {
        return this.environmentId;
    }

    /**
     * Set the environmentId property: ARM resource ID or AssetId of the environment specification for the endpoint
     * deployment.
     *
     * @param environmentId the environmentId value to set.
     * @return the EndpointDeploymentPropertiesBase object itself.
     */
    public EndpointDeploymentPropertiesBase withEnvironmentId(String environmentId) {
        this.environmentId = environmentId;
        return this;
    }

    /**
     * Get the environmentVariables property: Environment variables configuration for the deployment.
     *
     * @return the environmentVariables value.
     */
    public Map<String, String> environmentVariables() {
        return this.environmentVariables;
    }

    /**
     * Set the environmentVariables property: Environment variables configuration for the deployment.
     *
     * @param environmentVariables the environmentVariables value to set.
     * @return the EndpointDeploymentPropertiesBase object itself.
     */
    public EndpointDeploymentPropertiesBase withEnvironmentVariables(Map<String, String> environmentVariables) {
        this.environmentVariables = environmentVariables;
        return this;
    }

    /**
     * Get the properties property: Property dictionary. Properties can be added, but not removed or altered.
     *
     * @return the properties value.
     */
    public Map<String, String> properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Property dictionary. Properties can be added, but not removed or altered.
     *
     * @param properties the properties value to set.
     * @return the EndpointDeploymentPropertiesBase object itself.
     */
    public EndpointDeploymentPropertiesBase withProperties(Map<String, String> properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (codeConfiguration() != null) {
            codeConfiguration().validate();
        }
    }
}
