<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/api/serviceusage/v1/serviceusage.proto

namespace Google\Cloud\ServiceUsage\V1\DisableServiceRequest;

use UnexpectedValueException;

/**
 * Enum to determine if service usage should be checked when disabling a
 * service.
 *
 * Protobuf type <code>google.api.serviceusage.v1.DisableServiceRequest.CheckIfServiceHasUsage</code>
 */
class CheckIfServiceHasUsage
{
    /**
     * When unset, the default behavior is used, which is SKIP.
     *
     * Generated from protobuf enum <code>CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED = 0;</code>
     */
    const CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED = 0;
    /**
     * If set, skip checking service usage when disabling a service.
     *
     * Generated from protobuf enum <code>SKIP = 1;</code>
     */
    const SKIP = 1;
    /**
     * If set, service usage is checked when disabling the service. If a
     * service, or its dependents, has usage in the last 30 days, the request
     * returns a FAILED_PRECONDITION error.
     *
     * Generated from protobuf enum <code>CHECK = 2;</code>
     */
    const CHECK = 2;

    private static $valueToName = [
        self::CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED => 'CHECK_IF_SERVICE_HAS_USAGE_UNSPECIFIED',
        self::SKIP => 'SKIP',
        self::CHECK => 'CHECK',
    ];

    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);
    }
}


