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

namespace Google\Cloud\SecurityCenter\V1;

use UnexpectedValueException;

/**
 * Enumeration representing the various cloud providers a finding's resource
 * could reside in.
 *
 * Protobuf type <code>google.cloud.securitycenter.v1.CloudProvider</code>
 */
class CloudProvider
{
    /**
     * The cloud provider is unspecified.
     *
     * Generated from protobuf enum <code>CLOUD_PROVIDER_UNSPECIFIED = 0;</code>
     */
    const CLOUD_PROVIDER_UNSPECIFIED = 0;
    /**
     * The cloud provider is Google Cloud Platform.
     *
     * Generated from protobuf enum <code>GOOGLE_CLOUD_PLATFORM = 1;</code>
     */
    const GOOGLE_CLOUD_PLATFORM = 1;
    /**
     * The cloud provider is Amazon Web Services.
     *
     * Generated from protobuf enum <code>AMAZON_WEB_SERVICES = 2;</code>
     */
    const AMAZON_WEB_SERVICES = 2;
    /**
     * The cloud provider is Microsoft Azure.
     *
     * Generated from protobuf enum <code>MICROSOFT_AZURE = 3;</code>
     */
    const MICROSOFT_AZURE = 3;

    private static $valueToName = [
        self::CLOUD_PROVIDER_UNSPECIFIED => 'CLOUD_PROVIDER_UNSPECIFIED',
        self::GOOGLE_CLOUD_PLATFORM => 'GOOGLE_CLOUD_PLATFORM',
        self::AMAZON_WEB_SERVICES => 'AMAZON_WEB_SERVICES',
        self::MICROSOFT_AZURE => 'MICROSOFT_AZURE',
    ];

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

