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

package com.azure.resourcemanager.providerhub.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.providerhub.fluent.models.OperationsDefinitionInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The OperationsPutContent model. */
@Fluent
public final class OperationsPutContent {
    /*
     * The contents property.
     */
    @JsonProperty(value = "contents", required = true)
    private List<OperationsDefinitionInner> contents;

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

    /**
     * Get the contents property: The contents property.
     *
     * @return the contents value.
     */
    public List<OperationsDefinitionInner> contents() {
        return this.contents;
    }

    /**
     * Set the contents property: The contents property.
     *
     * @param contents the contents value to set.
     * @return the OperationsPutContent object itself.
     */
    public OperationsPutContent withContents(List<OperationsDefinitionInner> contents) {
        this.contents = contents;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (contents() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property contents in model OperationsPutContent"));
        } else {
            contents().forEach(e -> e.validate());
        }
    }

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