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

package com.azure.resourcemanager.paloaltonetworks.ngfw.models;

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

/** List of custom and predefined url category. */
@Fluent
public final class AdvSecurityObjectModel {
    /*
     * type of object
     */
    @JsonProperty(value = "type")
    private String type;

    /*
     * URL entry
     */
    @JsonProperty(value = "entry", required = true)
    private List<NameDescriptionObject> entry;

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

    /**
     * Get the type property: type of object.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Set the type property: type of object.
     *
     * @param type the type value to set.
     * @return the AdvSecurityObjectModel object itself.
     */
    public AdvSecurityObjectModel withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * Get the entry property: URL entry.
     *
     * @return the entry value.
     */
    public List<NameDescriptionObject> entry() {
        return this.entry;
    }

    /**
     * Set the entry property: URL entry.
     *
     * @param entry the entry value to set.
     * @return the AdvSecurityObjectModel object itself.
     */
    public AdvSecurityObjectModel withEntry(List<NameDescriptionObject> entry) {
        this.entry = entry;
        return this;
    }

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

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