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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.education.models.JoinRequestStatus;
import com.fasterxml.jackson.annotation.JsonProperty;

/** join requests. */
@Fluent
public final class JoinRequestDetailsInner extends ProxyResource {
    /*
     * join request properties.
     */
    @JsonProperty(value = "properties")
    private JoinRequestProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: join request properties.
     *
     * @return the innerProperties value.
     */
    private JoinRequestProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the firstName property: First Name.
     *
     * @return the firstName value.
     */
    public String firstName() {
        return this.innerProperties() == null ? null : this.innerProperties().firstName();
    }

    /**
     * Set the firstName property: First Name.
     *
     * @param firstName the firstName value to set.
     * @return the JoinRequestDetailsInner object itself.
     */
    public JoinRequestDetailsInner withFirstName(String firstName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JoinRequestProperties();
        }
        this.innerProperties().withFirstName(firstName);
        return this;
    }

    /**
     * Get the lastName property: Last Name.
     *
     * @return the lastName value.
     */
    public String lastName() {
        return this.innerProperties() == null ? null : this.innerProperties().lastName();
    }

    /**
     * Set the lastName property: Last Name.
     *
     * @param lastName the lastName value to set.
     * @return the JoinRequestDetailsInner object itself.
     */
    public JoinRequestDetailsInner withLastName(String lastName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JoinRequestProperties();
        }
        this.innerProperties().withLastName(lastName);
        return this;
    }

    /**
     * Get the email property: join request email.
     *
     * @return the email value.
     */
    public String email() {
        return this.innerProperties() == null ? null : this.innerProperties().email();
    }

    /**
     * Set the email property: join request email.
     *
     * @param email the email value to set.
     * @return the JoinRequestDetailsInner object itself.
     */
    public JoinRequestDetailsInner withEmail(String email) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JoinRequestProperties();
        }
        this.innerProperties().withEmail(email);
        return this;
    }

    /**
     * Get the status property: Join request status.
     *
     * @return the status value.
     */
    public JoinRequestStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Set the status property: Join request status.
     *
     * @param status the status value to set.
     * @return the JoinRequestDetailsInner object itself.
     */
    public JoinRequestDetailsInner withStatus(JoinRequestStatus status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JoinRequestProperties();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

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