/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.cognitiveservices.vision.computervision.models;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The API request error.
 */
public class ComputerVisionError {
    /**
     * The error code. Possible values include: 'InvalidRequest',
     * 'InvalidArgument', 'InternalServerError', 'ServiceUnavailable'.
     */
    @JsonProperty(value = "code", required = true)
    private ComputerVisionErrorCodes code;

    /**
     * A message explaining the error reported by the service.
     */
    @JsonProperty(value = "message", required = true)
    private String message;

    /**
     * Inner error contains more specific information.
     */
    @JsonProperty(value = "innererror")
    private ComputerVisionInnerError innererror;

    /**
     * Get the code value.
     *
     * @return the code value
     */
    public ComputerVisionErrorCodes code() {
        return this.code;
    }

    /**
     * Set the code value.
     *
     * @param code the code value to set
     * @return the ComputerVisionError object itself.
     */
    public ComputerVisionError withCode(ComputerVisionErrorCodes code) {
        this.code = code;
        return this;
    }

    /**
     * Get the message value.
     *
     * @return the message value
     */
    public String message() {
        return this.message;
    }

    /**
     * Set the message value.
     *
     * @param message the message value to set
     * @return the ComputerVisionError object itself.
     */
    public ComputerVisionError withMessage(String message) {
        this.message = message;
        return this;
    }

    /**
     * Get the innererror value.
     *
     * @return the innererror value
     */
    public ComputerVisionInnerError innererror() {
        return this.innererror;
    }

    /**
     * Set the innererror value.
     *
     * @param innererror the innererror value to set
     * @return the ComputerVisionError object itself.
     */
    public ComputerVisionError withInnererror(ComputerVisionInnerError innererror) {
        this.innererror = innererror;
        return this;
    }

}
