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

package com.azure.resourcemanager.customerinsights.models;

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

/** Definition of the link mapping of prediction. */
@Fluent
public final class PredictionMappings {
    /*
     * The score of the link mapping.
     */
    @JsonProperty(value = "score", required = true)
    private String score;

    /*
     * The grade of the link mapping.
     */
    @JsonProperty(value = "grade", required = true)
    private String grade;

    /*
     * The reason of the link mapping.
     */
    @JsonProperty(value = "reason", required = true)
    private String reason;

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

    /**
     * Get the score property: The score of the link mapping.
     *
     * @return the score value.
     */
    public String score() {
        return this.score;
    }

    /**
     * Set the score property: The score of the link mapping.
     *
     * @param score the score value to set.
     * @return the PredictionMappings object itself.
     */
    public PredictionMappings withScore(String score) {
        this.score = score;
        return this;
    }

    /**
     * Get the grade property: The grade of the link mapping.
     *
     * @return the grade value.
     */
    public String grade() {
        return this.grade;
    }

    /**
     * Set the grade property: The grade of the link mapping.
     *
     * @param grade the grade value to set.
     * @return the PredictionMappings object itself.
     */
    public PredictionMappings withGrade(String grade) {
        this.grade = grade;
        return this;
    }

    /**
     * Get the reason property: The reason of the link mapping.
     *
     * @return the reason value.
     */
    public String reason() {
        return this.reason;
    }

    /**
     * Set the reason property: The reason of the link mapping.
     *
     * @param reason the reason value to set.
     * @return the PredictionMappings object itself.
     */
    public PredictionMappings withReason(String reason) {
        this.reason = reason;
        return this;
    }

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

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