// 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;

/** object type info. */
@Fluent
public final class NameDescriptionObject {
    /*
     * name value
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /*
     * description value
     */
    @JsonProperty(value = "description")
    private String description;

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

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

    /**
     * Set the name property: name value.
     *
     * @param name the name value to set.
     * @return the NameDescriptionObject object itself.
     */
    public NameDescriptionObject withName(String name) {
        this.name = name;
        return this;
    }

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

    /**
     * Set the description property: description value.
     *
     * @param description the description value to set.
     * @return the NameDescriptionObject object itself.
     */
    public NameDescriptionObject withDescription(String description) {
        this.description = description;
        return this;
    }

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

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