<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto

namespace Google\Cloud\AssuredWorkloads\V1beta1\Workload\SaaEnrollmentResponse;

use UnexpectedValueException;

/**
 * Setup error of SAA enrollment.
 *
 * Protobuf type <code>google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError</code>
 */
class SetupError
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>SETUP_ERROR_UNSPECIFIED = 0;</code>
     */
    const SETUP_ERROR_UNSPECIFIED = 0;
    /**
     * Invalid states for all customers, to be redirected to AA UI for
     * additional details.
     *
     * Generated from protobuf enum <code>ERROR_INVALID_BASE_SETUP = 1;</code>
     */
    const ERROR_INVALID_BASE_SETUP = 1;
    /**
     * Returned when there is not an EKM key configured.
     *
     * Generated from protobuf enum <code>ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2;</code>
     */
    const ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2;
    /**
     * Returned when there are no enrolled services or the customer is
     * enrolled in CAA only for a subset of services.
     *
     * Generated from protobuf enum <code>ERROR_NOT_ALL_SERVICES_ENROLLED = 3;</code>
     */
    const ERROR_NOT_ALL_SERVICES_ENROLLED = 3;
    /**
     * Returned when exception was encountered during evaluation of other
     * criteria.
     *
     * Generated from protobuf enum <code>ERROR_SETUP_CHECK_FAILED = 4;</code>
     */
    const ERROR_SETUP_CHECK_FAILED = 4;

    private static $valueToName = [
        self::SETUP_ERROR_UNSPECIFIED => 'SETUP_ERROR_UNSPECIFIED',
        self::ERROR_INVALID_BASE_SETUP => 'ERROR_INVALID_BASE_SETUP',
        self::ERROR_MISSING_EXTERNAL_SIGNING_KEY => 'ERROR_MISSING_EXTERNAL_SIGNING_KEY',
        self::ERROR_NOT_ALL_SERVICES_ENROLLED => 'ERROR_NOT_ALL_SERVICES_ENROLLED',
        self::ERROR_SETUP_CHECK_FAILED => 'ERROR_SETUP_CHECK_FAILED',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SetupError::class, \Google\Cloud\AssuredWorkloads\V1beta1\Workload_SaaEnrollmentResponse_SetupError::class);

