// 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 com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;
import java.util.Map;

/** The response for an ACI service. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType")
@JsonTypeName("ACI")
@Fluent
public final class AciServiceResponse extends ServiceResponseBase {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AciServiceResponse.class);

    /*
     * The container resource requirements.
     */
    @JsonProperty(value = "containerResourceRequirements")
    private ContainerResourceRequirements containerResourceRequirements;

    /*
     * The Uri for sending scoring requests.
     */
    @JsonProperty(value = "scoringUri", access = JsonProperty.Access.WRITE_ONLY)
    private String scoringUri;

    /*
     * The name of the Azure location/region.
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * Whether or not authentication is enabled on the service.
     */
    @JsonProperty(value = "authEnabled")
    private Boolean authEnabled;

    /*
     * Whether or not SSL is enabled.
     */
    @JsonProperty(value = "sslEnabled")
    private Boolean sslEnabled;

    /*
     * Whether or not Application Insights is enabled.
     */
    @JsonProperty(value = "appInsightsEnabled")
    private Boolean appInsightsEnabled;

    /*
     * Details of the data collection options specified.
     */
    @JsonProperty(value = "dataCollection")
    private AciServiceResponseDataCollection dataCollection;

    /*
     * The public SSL certificate in PEM format to use if SSL is enabled.
     */
    @JsonProperty(value = "sslCertificate")
    private String sslCertificate;

    /*
     * The public SSL key in PEM format for the certificate.
     */
    @JsonProperty(value = "sslKey")
    private String sslKey;

    /*
     * The CName for the service.
     */
    @JsonProperty(value = "cname")
    private String cname;

    /*
     * The public IP address for the service.
     */
    @JsonProperty(value = "publicIp")
    private String publicIp;

    /*
     * The public Fqdn for the service.
     */
    @JsonProperty(value = "publicFqdn")
    private String publicFqdn;

    /*
     * The Uri for sending swagger requests.
     */
    @JsonProperty(value = "swaggerUri", access = JsonProperty.Access.WRITE_ONLY)
    private String swaggerUri;

    /*
     * Details on the models and configurations.
     */
    @JsonProperty(value = "modelConfigMap", access = JsonProperty.Access.WRITE_ONLY)
    private Map<String, Object> modelConfigMap;

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

    /*
     * The Environment, models and assets used for inferencing.
     */
    @JsonProperty(value = "environmentImageRequest")
    private AciServiceResponseEnvironmentImageRequest environmentImageRequest;

    /*
     * The virtual network configuration.
     */
    @JsonProperty(value = "vnetConfiguration")
    private AciServiceResponseVnetConfiguration vnetConfiguration;

    /*
     * The encryption properties.
     */
    @JsonProperty(value = "encryptionProperties")
    private AciServiceResponseEncryptionProperties encryptionProperties;

    /**
     * Get the containerResourceRequirements property: The container resource requirements.
     *
     * @return the containerResourceRequirements value.
     */
    public ContainerResourceRequirements containerResourceRequirements() {
        return this.containerResourceRequirements;
    }

    /**
     * Set the containerResourceRequirements property: The container resource requirements.
     *
     * @param containerResourceRequirements the containerResourceRequirements value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withContainerResourceRequirements(
        ContainerResourceRequirements containerResourceRequirements) {
        this.containerResourceRequirements = containerResourceRequirements;
        return this;
    }

    /**
     * Get the scoringUri property: The Uri for sending scoring requests.
     *
     * @return the scoringUri value.
     */
    public String scoringUri() {
        return this.scoringUri;
    }

    /**
     * Get the location property: The name of the Azure location/region.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The name of the Azure location/region.
     *
     * @param location the location value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the authEnabled property: Whether or not authentication is enabled on the service.
     *
     * @return the authEnabled value.
     */
    public Boolean authEnabled() {
        return this.authEnabled;
    }

    /**
     * Set the authEnabled property: Whether or not authentication is enabled on the service.
     *
     * @param authEnabled the authEnabled value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withAuthEnabled(Boolean authEnabled) {
        this.authEnabled = authEnabled;
        return this;
    }

    /**
     * Get the sslEnabled property: Whether or not SSL is enabled.
     *
     * @return the sslEnabled value.
     */
    public Boolean sslEnabled() {
        return this.sslEnabled;
    }

    /**
     * Set the sslEnabled property: Whether or not SSL is enabled.
     *
     * @param sslEnabled the sslEnabled value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withSslEnabled(Boolean sslEnabled) {
        this.sslEnabled = sslEnabled;
        return this;
    }

    /**
     * Get the appInsightsEnabled property: Whether or not Application Insights is enabled.
     *
     * @return the appInsightsEnabled value.
     */
    public Boolean appInsightsEnabled() {
        return this.appInsightsEnabled;
    }

    /**
     * Set the appInsightsEnabled property: Whether or not Application Insights is enabled.
     *
     * @param appInsightsEnabled the appInsightsEnabled value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withAppInsightsEnabled(Boolean appInsightsEnabled) {
        this.appInsightsEnabled = appInsightsEnabled;
        return this;
    }

    /**
     * Get the dataCollection property: Details of the data collection options specified.
     *
     * @return the dataCollection value.
     */
    public AciServiceResponseDataCollection dataCollection() {
        return this.dataCollection;
    }

    /**
     * Set the dataCollection property: Details of the data collection options specified.
     *
     * @param dataCollection the dataCollection value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withDataCollection(AciServiceResponseDataCollection dataCollection) {
        this.dataCollection = dataCollection;
        return this;
    }

    /**
     * Get the sslCertificate property: The public SSL certificate in PEM format to use if SSL is enabled.
     *
     * @return the sslCertificate value.
     */
    public String sslCertificate() {
        return this.sslCertificate;
    }

    /**
     * Set the sslCertificate property: The public SSL certificate in PEM format to use if SSL is enabled.
     *
     * @param sslCertificate the sslCertificate value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withSslCertificate(String sslCertificate) {
        this.sslCertificate = sslCertificate;
        return this;
    }

    /**
     * Get the sslKey property: The public SSL key in PEM format for the certificate.
     *
     * @return the sslKey value.
     */
    public String sslKey() {
        return this.sslKey;
    }

    /**
     * Set the sslKey property: The public SSL key in PEM format for the certificate.
     *
     * @param sslKey the sslKey value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withSslKey(String sslKey) {
        this.sslKey = sslKey;
        return this;
    }

    /**
     * Get the cname property: The CName for the service.
     *
     * @return the cname value.
     */
    public String cname() {
        return this.cname;
    }

    /**
     * Set the cname property: The CName for the service.
     *
     * @param cname the cname value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withCname(String cname) {
        this.cname = cname;
        return this;
    }

    /**
     * Get the publicIp property: The public IP address for the service.
     *
     * @return the publicIp value.
     */
    public String publicIp() {
        return this.publicIp;
    }

    /**
     * Set the publicIp property: The public IP address for the service.
     *
     * @param publicIp the publicIp value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withPublicIp(String publicIp) {
        this.publicIp = publicIp;
        return this;
    }

    /**
     * Get the publicFqdn property: The public Fqdn for the service.
     *
     * @return the publicFqdn value.
     */
    public String publicFqdn() {
        return this.publicFqdn;
    }

    /**
     * Set the publicFqdn property: The public Fqdn for the service.
     *
     * @param publicFqdn the publicFqdn value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withPublicFqdn(String publicFqdn) {
        this.publicFqdn = publicFqdn;
        return this;
    }

    /**
     * Get the swaggerUri property: The Uri for sending swagger requests.
     *
     * @return the swaggerUri value.
     */
    public String swaggerUri() {
        return this.swaggerUri;
    }

    /**
     * Get the modelConfigMap property: Details on the models and configurations.
     *
     * @return the modelConfigMap value.
     */
    public Map<String, Object> modelConfigMap() {
        return this.modelConfigMap;
    }

    /**
     * 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 AciServiceResponse object itself.
     */
    public AciServiceResponse withModels(List<Model> models) {
        this.models = models;
        return this;
    }

    /**
     * Get the environmentImageRequest property: The Environment, models and assets used for inferencing.
     *
     * @return the environmentImageRequest value.
     */
    public AciServiceResponseEnvironmentImageRequest environmentImageRequest() {
        return this.environmentImageRequest;
    }

    /**
     * Set the environmentImageRequest property: The Environment, models and assets used for inferencing.
     *
     * @param environmentImageRequest the environmentImageRequest value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withEnvironmentImageRequest(
        AciServiceResponseEnvironmentImageRequest environmentImageRequest) {
        this.environmentImageRequest = environmentImageRequest;
        return this;
    }

    /**
     * Get the vnetConfiguration property: The virtual network configuration.
     *
     * @return the vnetConfiguration value.
     */
    public AciServiceResponseVnetConfiguration vnetConfiguration() {
        return this.vnetConfiguration;
    }

    /**
     * Set the vnetConfiguration property: The virtual network configuration.
     *
     * @param vnetConfiguration the vnetConfiguration value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withVnetConfiguration(AciServiceResponseVnetConfiguration vnetConfiguration) {
        this.vnetConfiguration = vnetConfiguration;
        return this;
    }

    /**
     * Get the encryptionProperties property: The encryption properties.
     *
     * @return the encryptionProperties value.
     */
    public AciServiceResponseEncryptionProperties encryptionProperties() {
        return this.encryptionProperties;
    }

    /**
     * Set the encryptionProperties property: The encryption properties.
     *
     * @param encryptionProperties the encryptionProperties value to set.
     * @return the AciServiceResponse object itself.
     */
    public AciServiceResponse withEncryptionProperties(AciServiceResponseEncryptionProperties encryptionProperties) {
        this.encryptionProperties = encryptionProperties;
        return this;
    }

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

    /** {@inheritDoc} */
    @Override
    public AciServiceResponse withKvTags(Map<String, String> kvTags) {
        super.withKvTags(kvTags);
        return this;
    }

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

    /** {@inheritDoc} */
    @Override
    public AciServiceResponse withDeploymentType(DeploymentType deploymentType) {
        super.withDeploymentType(deploymentType);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (containerResourceRequirements() != null) {
            containerResourceRequirements().validate();
        }
        if (dataCollection() != null) {
            dataCollection().validate();
        }
        if (models() != null) {
            models().forEach(e -> e.validate());
        }
        if (environmentImageRequest() != null) {
            environmentImageRequest().validate();
        }
        if (vnetConfiguration() != null) {
            vnetConfiguration().validate();
        }
        if (encryptionProperties() != null) {
            encryptionProperties().validate();
        }
    }
}
