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

package com.azure.resourcemanager.databox.models;

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

/** Contact Info. */
@Fluent
public final class ContactInfo {
    /*
     * Contact name of the person.
     */
    @JsonProperty(value = "contactName", required = true)
    private String contactName;

    /*
     * Phone number of the contact person.
     */
    @JsonProperty(value = "phone", required = true)
    private String phone;

    /*
     * Phone extension number of the contact person.
     */
    @JsonProperty(value = "phoneExtension")
    private String phoneExtension;

    /*
     * Mobile number of the contact person.
     */
    @JsonProperty(value = "mobile")
    private String mobile;

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

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

    /**
     * Set the contactName property: Contact name of the person.
     *
     * @param contactName the contactName value to set.
     * @return the ContactInfo object itself.
     */
    public ContactInfo withContactName(String contactName) {
        this.contactName = contactName;
        return this;
    }

    /**
     * Get the phone property: Phone number of the contact person.
     *
     * @return the phone value.
     */
    public String phone() {
        return this.phone;
    }

    /**
     * Set the phone property: Phone number of the contact person.
     *
     * @param phone the phone value to set.
     * @return the ContactInfo object itself.
     */
    public ContactInfo withPhone(String phone) {
        this.phone = phone;
        return this;
    }

    /**
     * Get the phoneExtension property: Phone extension number of the contact person.
     *
     * @return the phoneExtension value.
     */
    public String phoneExtension() {
        return this.phoneExtension;
    }

    /**
     * Set the phoneExtension property: Phone extension number of the contact person.
     *
     * @param phoneExtension the phoneExtension value to set.
     * @return the ContactInfo object itself.
     */
    public ContactInfo withPhoneExtension(String phoneExtension) {
        this.phoneExtension = phoneExtension;
        return this;
    }

    /**
     * Get the mobile property: Mobile number of the contact person.
     *
     * @return the mobile value.
     */
    public String mobile() {
        return this.mobile;
    }

    /**
     * Set the mobile property: Mobile number of the contact person.
     *
     * @param mobile the mobile value to set.
     * @return the ContactInfo object itself.
     */
    public ContactInfo withMobile(String mobile) {
        this.mobile = mobile;
        return this;
    }

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

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