<?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 = 391835586;</code>
     */
    const DEPRECATED_RESOURCE_USED = 391835586;
    /**
     * Generated from protobuf enum <code>DEPRECATED_TYPE_USED = 346526230;</code>
     */
    const DEPRECATED_TYPE_USED = 346526230;
    /**
     * Generated from protobuf enum <code>DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967;</code>
     */
    const DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967;
    /**
     * Generated from protobuf enum <code>EXPERIMENTAL_TYPE_USED = 451954443;</code>
     */
    const EXPERIMENTAL_TYPE_USED = 451954443;
    /**
     * Generated from protobuf enum <code>EXTERNAL_API_WARNING = 175546307;</code>
     */
    const EXTERNAL_API_WARNING = 175546307;
    /**
     * Generated from protobuf enum <code>FIELD_VALUE_OVERRIDEN = 329669423;</code>
     */
    const FIELD_VALUE_OVERRIDEN = 329669423;
    /**
     * Generated from protobuf enum <code>INJECTED_KERNELS_DEPRECATED = 417377419;</code>
     */
    const INJECTED_KERNELS_DEPRECATED = 417377419;
    /**
     * Generated from protobuf enum <code>LARGE_DEPLOYMENT_WARNING = 481440678;</code>
     */
    const LARGE_DEPLOYMENT_WARNING = 481440678;
    /**
     * Generated from protobuf enum <code>MISSING_TYPE_DEPENDENCY = 344505463;</code>
     */
    const MISSING_TYPE_DEPENDENCY = 344505463;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999;</code>
     */
    const NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_CANNOT_IP_FORWARD = 383382887;</code>
     */
    const NEXT_HOP_CANNOT_IP_FORWARD = 383382887;
    /**
     * Generated from protobuf enum <code>NEXT_HOP_INSTANCE_NOT_FOUND = 464250446;</code>
     */
    const NEXT_HOP_INSTANCE_NOT_FOUND = 464250446;
    /**
     * 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 = 417081265;</code>
     */
    const NEXT_HOP_NOT_RUNNING = 417081265;
    /**
     * 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 = 496728641;</code>
     */
    const RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641;
    /**
     * Generated from protobuf enum <code>RESOURCE_NOT_DELETED = 168598460;</code>
     */
    const RESOURCE_NOT_DELETED = 168598460;
    /**
     * Generated from protobuf enum <code>SCHEMA_VALIDATION_IGNORED = 275245642;</code>
     */
    const SCHEMA_VALIDATION_IGNORED = 275245642;
    /**
     * Generated from protobuf enum <code>SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617;</code>
     */
    const SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617;
    /**
     * Generated from protobuf enum <code>UNDECLARED_PROPERTIES = 390513439;</code>
     */
    const UNDECLARED_PROPERTIES = 390513439;
    /**
     * 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);
    }
}


