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

package com.azure.resourcemanager.appcontainers.models;

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

/** Container App container definition. */
@Fluent
public final class Container extends BaseContainer {
    /*
     * List of probes for the container.
     */
    @JsonProperty(value = "probes")
    private List<ContainerAppProbe> probes;

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

    /**
     * Get the probes property: List of probes for the container.
     *
     * @return the probes value.
     */
    public List<ContainerAppProbe> probes() {
        return this.probes;
    }

    /**
     * Set the probes property: List of probes for the container.
     *
     * @param probes the probes value to set.
     * @return the Container object itself.
     */
    public Container withProbes(List<ContainerAppProbe> probes) {
        this.probes = probes;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withImage(String image) {
        super.withImage(image);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withName(String name) {
        super.withName(name);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withCommand(List<String> command) {
        super.withCommand(command);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withArgs(List<String> args) {
        super.withArgs(args);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withEnv(List<EnvironmentVar> env) {
        super.withEnv(env);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withResources(ContainerResources resources) {
        super.withResources(resources);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Container withVolumeMounts(List<VolumeMount> volumeMounts) {
        super.withVolumeMounts(volumeMounts);
        return this;
    }

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