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

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

/** redeem request. */
@Fluent
public final class RedeemRequest {
    /*
     * redeem code
     */
    @JsonProperty(value = "redeemCode", required = true)
    private String redeemCode;

    /*
     * first name of requester
     */
    @JsonProperty(value = "firstName", required = true)
    private String firstName;

    /*
     * last name of requester
     */
    @JsonProperty(value = "lastName", required = true)
    private String lastName;

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

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

    /**
     * Set the redeemCode property: redeem code.
     *
     * @param redeemCode the redeemCode value to set.
     * @return the RedeemRequest object itself.
     */
    public RedeemRequest withRedeemCode(String redeemCode) {
        this.redeemCode = redeemCode;
        return this;
    }

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

    /**
     * Set the firstName property: first name of requester.
     *
     * @param firstName the firstName value to set.
     * @return the RedeemRequest object itself.
     */
    public RedeemRequest withFirstName(String firstName) {
        this.firstName = firstName;
        return this;
    }

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

    /**
     * Set the lastName property: last name of requester.
     *
     * @param lastName the lastName value to set.
     * @return the RedeemRequest object itself.
     */
    public RedeemRequest withLastName(String lastName) {
        this.lastName = lastName;
        return this;
    }

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

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