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

namespace Google\Cloud\Compute\V1\Warnings;

use UnexpectedValueException;

/**
 * [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
 *
 * Protobuf type <code>google.cloud.compute.v1.Warnings.Code</code>
 */
class Code
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_CODE = 0;</code>
     */
    const UNDEFINED_CODE = 0;
    /**
     * Generated from protobuf enum <code>CLEANUP_FAILED = 150308440;</code>
     */
    const CLEANUP_FAILED = 150308440;
    /**
     * Generated from protobuf enum <code>DEPRECATED_RESOURCE_USED = 123400130;</code>
     */
    const DEPRECATED_RESOURCE_USED = 123400130;
    /**
     * Generated from protobuf enum <code>DEPRECATED_TYPE_USED = 78090774;</code>
     */
    const DEPRECATED_TYPE_USED = 78090774;
    /**
     * Generated from protobuf enum <code>DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 101007511;</code>
     */
    const DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 101007511;
    /**
     * Generated from protobuf enum <code>EXPERIMENTAL_TYPE_USED = 183518987;</code>
     */
    const EXPERIMENTAL_TYPE_USED = 183518987;
    /**
     * Generated from protobuf enum <code>EXTERNAL_API_WARNING = 175546307;</code>
     */
    const EXTERNAL_API_WARNING = 175546307;
    /**
     * Generated from protobuf enum <code>FIELD_VALUE_OVERRIDEN = 61233967;</code>
     */
    const FIELD_VALUE_OVERRIDEN = 61233967;
    /**
     * Generated from protobuf enum <code>INJECTED_KERNELS_DEPRECATED = 148941963;</code>
     */
    const INJECTED_KERNELS_DEPRECATED = 148941963;
    /**
     * Generated from protobuf enum <code>LARGE_DEPLOYMENT_WARNING = 213005222;</code>
     */
    const LARGE_DEPLOYMENT_WARNING = 213005222;
    /**
     * Generated from protobuf enum <code>MISSING_TYPE_DEPENDENCY = 76070007;</code>
     */
    const MISSING_TYPE_DEPENDENCY = 76070007;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_ADDRESS_NOT_ASSIGNED = 56529543;</code>
     */
    const NEXT_HOP_ADDRESS_NOT_ASSIGNED = 56529543;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_CANNOT_IP_FORWARD = 114947431;</code>
     */
    const NEXT_HOP_CANNOT_IP_FORWARD = 114947431;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_INSTANCE_NOT_FOUND = 195814990;</code>
     */
    const NEXT_HOP_INSTANCE_NOT_FOUND = 195814990;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146;</code>
     */
    const NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_NOT_RUNNING = 148645809;</code>
     */
    const NEXT_HOP_NOT_RUNNING = 148645809;
    /**
     * Generated from protobuf enum <code>NOT_CRITICAL_ERROR = 105763924;</code>
     */
    const NOT_CRITICAL_ERROR = 105763924;
    /**
     * Generated from protobuf enum <code>NO_RESULTS_ON_PAGE = 30036744;</code>
     */
    const NO_RESULTS_ON_PAGE = 30036744;
    /**
     * Generated from protobuf enum <code>PARTIAL_SUCCESS = 39966469;</code>
     */
    const PARTIAL_SUCCESS = 39966469;
    /**
     * Generated from protobuf enum <code>REQUIRED_TOS_AGREEMENT = 3745539;</code>
     */
    const REQUIRED_TOS_AGREEMENT = 3745539;
    /**
     * Generated from protobuf enum <code>RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 228293185;</code>
     */
    const RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 228293185;
    /**
     * Generated from protobuf enum <code>RESOURCE_NOT_DELETED = 168598460;</code>
     */
    const RESOURCE_NOT_DELETED = 168598460;
    /**
     * Generated from protobuf enum <code>SCHEMA_VALIDATION_IGNORED = 6810186;</code>
     */
    const SCHEMA_VALIDATION_IGNORED = 6810186;
    /**
     * Generated from protobuf enum <code>SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617;</code>
     */
    const SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617;
    /**
     * Generated from protobuf enum <code>UNDECLARED_PROPERTIES = 122077983;</code>
     */
    const UNDECLARED_PROPERTIES = 122077983;
    /**
     * Generated from protobuf enum <code>UNREACHABLE = 13328052;</code>
     */
    const UNREACHABLE = 13328052;

    private static $valueToName = [
        self::UNDEFINED_CODE => 'UNDEFINED_CODE',
        self::CLEANUP_FAILED => 'CLEANUP_FAILED',
        self::DEPRECATED_RESOURCE_USED => 'DEPRECATED_RESOURCE_USED',
        self::DEPRECATED_TYPE_USED => 'DEPRECATED_TYPE_USED',
        self::DISK_SIZE_LARGER_THAN_IMAGE_SIZE => 'DISK_SIZE_LARGER_THAN_IMAGE_SIZE',
        self::EXPERIMENTAL_TYPE_USED => 'EXPERIMENTAL_TYPE_USED',
        self::EXTERNAL_API_WARNING => 'EXTERNAL_API_WARNING',
        self::FIELD_VALUE_OVERRIDEN => 'FIELD_VALUE_OVERRIDEN',
        self::INJECTED_KERNELS_DEPRECATED => 'INJECTED_KERNELS_DEPRECATED',
        self::LARGE_DEPLOYMENT_WARNING => 'LARGE_DEPLOYMENT_WARNING',
        self::MISSING_TYPE_DEPENDENCY => 'MISSING_TYPE_DEPENDENCY',
        self::NEXT_HOP_ADDRESS_NOT_ASSIGNED => 'NEXT_HOP_ADDRESS_NOT_ASSIGNED',
        self::NEXT_HOP_CANNOT_IP_FORWARD => 'NEXT_HOP_CANNOT_IP_FORWARD',
        self::NEXT_HOP_INSTANCE_NOT_FOUND => 'NEXT_HOP_INSTANCE_NOT_FOUND',
        self::NEXT_HOP_INSTANCE_NOT_ON_NETWORK => 'NEXT_HOP_INSTANCE_NOT_ON_NETWORK',
        self::NEXT_HOP_NOT_RUNNING => 'NEXT_HOP_NOT_RUNNING',
        self::NOT_CRITICAL_ERROR => 'NOT_CRITICAL_ERROR',
        self::NO_RESULTS_ON_PAGE => 'NO_RESULTS_ON_PAGE',
        self::PARTIAL_SUCCESS => 'PARTIAL_SUCCESS',
        self::REQUIRED_TOS_AGREEMENT => 'REQUIRED_TOS_AGREEMENT',
        self::RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING => 'RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING',
        self::RESOURCE_NOT_DELETED => 'RESOURCE_NOT_DELETED',
        self::SCHEMA_VALIDATION_IGNORED => 'SCHEMA_VALIDATION_IGNORED',
        self::SINGLE_INSTANCE_PROPERTY_TEMPLATE => 'SINGLE_INSTANCE_PROPERTY_TEMPLATE',
        self::UNDECLARED_PROPERTIES => 'UNDECLARED_PROPERTIES',
        self::UNREACHABLE => 'UNREACHABLE',
    ];

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


