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

package com.azure.resourcemanager.voiceservices.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
import com.azure.resourcemanager.voiceservices.models.TestLinePurpose;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Details of the TestLine resource. */
@Fluent
public final class TestLineProperties {
    /*
     * Resource provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The phone number
     */
    @JsonProperty(value = "phoneNumber", required = true)
    private String phoneNumber;

    /*
     * Purpose of this test line, e.g. automated or manual testing
     */
    @JsonProperty(value = "purpose", required = true)
    private TestLinePurpose purpose;

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

    /**
     * Get the provisioningState property: Resource provisioning state.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the phoneNumber property: The phone number.
     *
     * @return the phoneNumber value.
     */
    public String phoneNumber() {
        return this.phoneNumber;
    }

    /**
     * Set the phoneNumber property: The phone number.
     *
     * @param phoneNumber the phoneNumber value to set.
     * @return the TestLineProperties object itself.
     */
    public TestLineProperties withPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this;
    }

    /**
     * Get the purpose property: Purpose of this test line, e.g. automated or manual testing.
     *
     * @return the purpose value.
     */
    public TestLinePurpose purpose() {
        return this.purpose;
    }

    /**
     * Set the purpose property: Purpose of this test line, e.g. automated or manual testing.
     *
     * @param purpose the purpose value to set.
     * @return the TestLineProperties object itself.
     */
    public TestLineProperties withPurpose(TestLinePurpose purpose) {
        this.purpose = purpose;
        return this;
    }

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

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