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

package com.azure.resourcemanager.newrelicobservability.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of the NewRelic account. */
@Fluent
public final class NewRelicAccountProperties {
    /*
     * User id
     */
    @JsonProperty(value = "userId")
    private String userId;

    /*
     * NewRelic Account Information
     */
    @JsonProperty(value = "accountInfo")
    private AccountInfo accountInfo;

    /*
     * NewRelic Organization Information
     */
    @JsonProperty(value = "organizationInfo")
    private OrganizationInfo organizationInfo;

    /*
     * date when plan was applied
     */
    @JsonProperty(value = "singleSignOnProperties")
    private NewRelicSingleSignOnProperties singleSignOnProperties;

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

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

    /**
     * Set the userId property: User id.
     *
     * @param userId the userId value to set.
     * @return the NewRelicAccountProperties object itself.
     */
    public NewRelicAccountProperties withUserId(String userId) {
        this.userId = userId;
        return this;
    }

    /**
     * Get the accountInfo property: NewRelic Account Information.
     *
     * @return the accountInfo value.
     */
    public AccountInfo accountInfo() {
        return this.accountInfo;
    }

    /**
     * Set the accountInfo property: NewRelic Account Information.
     *
     * @param accountInfo the accountInfo value to set.
     * @return the NewRelicAccountProperties object itself.
     */
    public NewRelicAccountProperties withAccountInfo(AccountInfo accountInfo) {
        this.accountInfo = accountInfo;
        return this;
    }

    /**
     * Get the organizationInfo property: NewRelic Organization Information.
     *
     * @return the organizationInfo value.
     */
    public OrganizationInfo organizationInfo() {
        return this.organizationInfo;
    }

    /**
     * Set the organizationInfo property: NewRelic Organization Information.
     *
     * @param organizationInfo the organizationInfo value to set.
     * @return the NewRelicAccountProperties object itself.
     */
    public NewRelicAccountProperties withOrganizationInfo(OrganizationInfo organizationInfo) {
        this.organizationInfo = organizationInfo;
        return this;
    }

    /**
     * Get the singleSignOnProperties property: date when plan was applied.
     *
     * @return the singleSignOnProperties value.
     */
    public NewRelicSingleSignOnProperties singleSignOnProperties() {
        return this.singleSignOnProperties;
    }

    /**
     * Set the singleSignOnProperties property: date when plan was applied.
     *
     * @param singleSignOnProperties the singleSignOnProperties value to set.
     * @return the NewRelicAccountProperties object itself.
     */
    public NewRelicAccountProperties withSingleSignOnProperties(NewRelicSingleSignOnProperties singleSignOnProperties) {
        this.singleSignOnProperties = singleSignOnProperties;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (accountInfo() != null) {
            accountInfo().validate();
        }
        if (organizationInfo() != null) {
            organizationInfo().validate();
        }
        if (singleSignOnProperties() != null) {
            singleSignOnProperties().validate();
        }
    }
}
