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

package com.azure.resourcemanager.videoanalyzer.models;

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

/** A list of PEM formatted certificates. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@type")
@JsonTypeName("#Microsoft.VideoAnalyzer.PemCertificateList")
@Fluent
public final class PemCertificateList extends CertificateSource {
    /*
     * PEM formatted public certificates. One certificate per entry.
     */
    @JsonProperty(value = "certificates", required = true)
    private List<String> certificates;

    /**
     * Get the certificates property: PEM formatted public certificates. One certificate per entry.
     *
     * @return the certificates value.
     */
    public List<String> certificates() {
        return this.certificates;
    }

    /**
     * Set the certificates property: PEM formatted public certificates. One certificate per entry.
     *
     * @param certificates the certificates value to set.
     * @return the PemCertificateList object itself.
     */
    public PemCertificateList withCertificates(List<String> certificates) {
        this.certificates = certificates;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (certificates() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property certificates in model PemCertificateList"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(PemCertificateList.class);
}
