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

namespace Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError;

use UnexpectedValueException;

/**
 * Output only.
 * Defines an error reason code.
 * Next id: 43
 *
 * Protobuf type <code>google.cloud.websecurityscanner.v1beta.ScanConfigError.Code</code>
 */
class Code
{
    /**
     * There is no error.
     *
     * Generated from protobuf enum <code>CODE_UNSPECIFIED = 0;</code>
     */
    const CODE_UNSPECIFIED = 0;
    /**
     * There is no error.
     *
     * Generated from protobuf enum <code>OK = 0;</code>
     */
    const OK = 0;
    /**
     * Indicates an internal server error.
     * Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown.
     *
     * Generated from protobuf enum <code>INTERNAL_ERROR = 1;</code>
     */
    const INTERNAL_ERROR = 1;
    /**
     * One of the seed URLs is an App Engine URL but we cannot validate the scan
     * settings due to an App Engine API backend error.
     *
     * Generated from protobuf enum <code>APPENGINE_API_BACKEND_ERROR = 2;</code>
     */
    const APPENGINE_API_BACKEND_ERROR = 2;
    /**
     * One of the seed URLs is an App Engine URL but we cannot access the
     * App Engine API to validate scan settings.
     *
     * Generated from protobuf enum <code>APPENGINE_API_NOT_ACCESSIBLE = 3;</code>
     */
    const APPENGINE_API_NOT_ACCESSIBLE = 3;
    /**
     * One of the seed URLs is an App Engine URL but the Default Host of the
     * App Engine is not set.
     *
     * Generated from protobuf enum <code>APPENGINE_DEFAULT_HOST_MISSING = 4;</code>
     */
    const APPENGINE_DEFAULT_HOST_MISSING = 4;
    /**
     * Google corporate accounts can not be used for scanning.
     *
     * Generated from protobuf enum <code>CANNOT_USE_GOOGLE_COM_ACCOUNT = 6;</code>
     */
    const CANNOT_USE_GOOGLE_COM_ACCOUNT = 6;
    /**
     * The account of the scan creator can not be used for scanning.
     *
     * Generated from protobuf enum <code>CANNOT_USE_OWNER_ACCOUNT = 7;</code>
     */
    const CANNOT_USE_OWNER_ACCOUNT = 7;
    /**
     * This scan targets Compute Engine, but we cannot validate scan settings
     * due to a Compute Engine API backend error.
     *
     * Generated from protobuf enum <code>COMPUTE_API_BACKEND_ERROR = 8;</code>
     */
    const COMPUTE_API_BACKEND_ERROR = 8;
    /**
     * This scan targets Compute Engine, but we cannot access the Compute Engine
     * API to validate the scan settings.
     *
     * Generated from protobuf enum <code>COMPUTE_API_NOT_ACCESSIBLE = 9;</code>
     */
    const COMPUTE_API_NOT_ACCESSIBLE = 9;
    /**
     * The Custom Login URL does not belong to the current project.
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10;</code>
     */
    const CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10;
    /**
     * The Custom Login URL is malformed (can not be parsed).
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_MALFORMED = 11;</code>
     */
    const CUSTOM_LOGIN_URL_MALFORMED = 11;
    /**
     * The Custom Login URL is mapped to a non-routable IP address in DNS.
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12;</code>
     */
    const CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12;
    /**
     * The Custom Login URL is mapped to an IP address which is not reserved for
     * the current project.
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13;</code>
     */
    const CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13;
    /**
     * The Custom Login URL has a non-routable IP address.
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14;</code>
     */
    const CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14;
    /**
     * The Custom Login URL has an IP address which is not reserved for the
     * current project.
     *
     * Generated from protobuf enum <code>CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15;</code>
     */
    const CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15;
    /**
     * Another scan with the same name (case-sensitive) already exists.
     *
     * Generated from protobuf enum <code>DUPLICATE_SCAN_NAME = 16;</code>
     */
    const DUPLICATE_SCAN_NAME = 16;
    /**
     * A field is set to an invalid value.
     *
     * Generated from protobuf enum <code>INVALID_FIELD_VALUE = 18;</code>
     */
    const INVALID_FIELD_VALUE = 18;
    /**
     * There was an error trying to authenticate to the scan target.
     *
     * Generated from protobuf enum <code>FAILED_TO_AUTHENTICATE_TO_TARGET = 19;</code>
     */
    const FAILED_TO_AUTHENTICATE_TO_TARGET = 19;
    /**
     * Finding type value is not specified in the list findings request.
     *
     * Generated from protobuf enum <code>FINDING_TYPE_UNSPECIFIED = 20;</code>
     */
    const FINDING_TYPE_UNSPECIFIED = 20;
    /**
     * Scan targets Compute Engine, yet current project was not whitelisted for
     * Google Compute Engine Scanning Alpha access.
     *
     * Generated from protobuf enum <code>FORBIDDEN_TO_SCAN_COMPUTE = 21;</code>
     */
    const FORBIDDEN_TO_SCAN_COMPUTE = 21;
    /**
     * The supplied filter is malformed. For example, it can not be parsed, does
     * not have a filter type in expression, or the same filter type appears
     * more than once.
     *
     * Generated from protobuf enum <code>MALFORMED_FILTER = 22;</code>
     */
    const MALFORMED_FILTER = 22;
    /**
     * The supplied resource name is malformed (can not be parsed).
     *
     * Generated from protobuf enum <code>MALFORMED_RESOURCE_NAME = 23;</code>
     */
    const MALFORMED_RESOURCE_NAME = 23;
    /**
     * The current project is not in an active state.
     *
     * Generated from protobuf enum <code>PROJECT_INACTIVE = 24;</code>
     */
    const PROJECT_INACTIVE = 24;
    /**
     * A required field is not set.
     *
     * Generated from protobuf enum <code>REQUIRED_FIELD = 25;</code>
     */
    const REQUIRED_FIELD = 25;
    /**
     * Project id, scanconfig id, scanrun id, or finding id are not consistent
     * with each other in resource name.
     *
     * Generated from protobuf enum <code>RESOURCE_NAME_INCONSISTENT = 26;</code>
     */
    const RESOURCE_NAME_INCONSISTENT = 26;
    /**
     * The scan being requested to start is already running.
     *
     * Generated from protobuf enum <code>SCAN_ALREADY_RUNNING = 27;</code>
     */
    const SCAN_ALREADY_RUNNING = 27;
    /**
     * The scan that was requested to be stopped is not running.
     *
     * Generated from protobuf enum <code>SCAN_NOT_RUNNING = 28;</code>
     */
    const SCAN_NOT_RUNNING = 28;
    /**
     * One of the seed URLs does not belong to the current project.
     *
     * Generated from protobuf enum <code>SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29;</code>
     */
    const SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29;
    /**
     * One of the seed URLs is malformed (can not be parsed).
     *
     * Generated from protobuf enum <code>SEED_URL_MALFORMED = 30;</code>
     */
    const SEED_URL_MALFORMED = 30;
    /**
     * One of the seed URLs is mapped to a non-routable IP address in DNS.
     *
     * Generated from protobuf enum <code>SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31;</code>
     */
    const SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31;
    /**
     * One of the seed URLs is mapped to an IP address which is not reserved
     * for the current project.
     *
     * Generated from protobuf enum <code>SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32;</code>
     */
    const SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32;
    /**
     * One of the seed URLs has on-routable IP address.
     *
     * Generated from protobuf enum <code>SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33;</code>
     */
    const SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33;
    /**
     * One of the seed URLs has an IP address that is not reserved
     * for the current project.
     *
     * Generated from protobuf enum <code>SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35;</code>
     */
    const SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35;
    /**
     * The Cloud Security Scanner service account is not configured under the
     * project.
     *
     * Generated from protobuf enum <code>SERVICE_ACCOUNT_NOT_CONFIGURED = 36;</code>
     */
    const SERVICE_ACCOUNT_NOT_CONFIGURED = 36;
    /**
     * A project has reached the maximum number of scans.
     *
     * Generated from protobuf enum <code>TOO_MANY_SCANS = 37;</code>
     */
    const TOO_MANY_SCANS = 37;
    /**
     * Resolving the details of the current project fails.
     *
     * Generated from protobuf enum <code>UNABLE_TO_RESOLVE_PROJECT_INFO = 38;</code>
     */
    const UNABLE_TO_RESOLVE_PROJECT_INFO = 38;
    /**
     * One or more blacklist patterns were in the wrong format.
     *
     * Generated from protobuf enum <code>UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39;</code>
     */
    const UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39;
    /**
     * The supplied filter is not supported.
     *
     * Generated from protobuf enum <code>UNSUPPORTED_FILTER = 40;</code>
     */
    const UNSUPPORTED_FILTER = 40;
    /**
     * The supplied finding type is not supported. For example, we do not
     * provide findings of the given finding type.
     *
     * Generated from protobuf enum <code>UNSUPPORTED_FINDING_TYPE = 41;</code>
     */
    const UNSUPPORTED_FINDING_TYPE = 41;
    /**
     * The URL scheme of one or more of the supplied URLs is not supported.
     *
     * Generated from protobuf enum <code>UNSUPPORTED_URL_SCHEME = 42;</code>
     */
    const UNSUPPORTED_URL_SCHEME = 42;

    private static $valueToName = [
        self::CODE_UNSPECIFIED => 'CODE_UNSPECIFIED',
        self::OK => 'OK',
        self::INTERNAL_ERROR => 'INTERNAL_ERROR',
        self::APPENGINE_API_BACKEND_ERROR => 'APPENGINE_API_BACKEND_ERROR',
        self::APPENGINE_API_NOT_ACCESSIBLE => 'APPENGINE_API_NOT_ACCESSIBLE',
        self::APPENGINE_DEFAULT_HOST_MISSING => 'APPENGINE_DEFAULT_HOST_MISSING',
        self::CANNOT_USE_GOOGLE_COM_ACCOUNT => 'CANNOT_USE_GOOGLE_COM_ACCOUNT',
        self::CANNOT_USE_OWNER_ACCOUNT => 'CANNOT_USE_OWNER_ACCOUNT',
        self::COMPUTE_API_BACKEND_ERROR => 'COMPUTE_API_BACKEND_ERROR',
        self::COMPUTE_API_NOT_ACCESSIBLE => 'COMPUTE_API_NOT_ACCESSIBLE',
        self::CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT',
        self::CUSTOM_LOGIN_URL_MALFORMED => 'CUSTOM_LOGIN_URL_MALFORMED',
        self::CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS',
        self::CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS',
        self::CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS',
        self::CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS => 'CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS',
        self::DUPLICATE_SCAN_NAME => 'DUPLICATE_SCAN_NAME',
        self::INVALID_FIELD_VALUE => 'INVALID_FIELD_VALUE',
        self::FAILED_TO_AUTHENTICATE_TO_TARGET => 'FAILED_TO_AUTHENTICATE_TO_TARGET',
        self::FINDING_TYPE_UNSPECIFIED => 'FINDING_TYPE_UNSPECIFIED',
        self::FORBIDDEN_TO_SCAN_COMPUTE => 'FORBIDDEN_TO_SCAN_COMPUTE',
        self::MALFORMED_FILTER => 'MALFORMED_FILTER',
        self::MALFORMED_RESOURCE_NAME => 'MALFORMED_RESOURCE_NAME',
        self::PROJECT_INACTIVE => 'PROJECT_INACTIVE',
        self::REQUIRED_FIELD => 'REQUIRED_FIELD',
        self::RESOURCE_NAME_INCONSISTENT => 'RESOURCE_NAME_INCONSISTENT',
        self::SCAN_ALREADY_RUNNING => 'SCAN_ALREADY_RUNNING',
        self::SCAN_NOT_RUNNING => 'SCAN_NOT_RUNNING',
        self::SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT => 'SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT',
        self::SEED_URL_MALFORMED => 'SEED_URL_MALFORMED',
        self::SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS => 'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS',
        self::SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS => 'SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS',
        self::SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS => 'SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS',
        self::SEED_URL_HAS_UNRESERVED_IP_ADDRESS => 'SEED_URL_HAS_UNRESERVED_IP_ADDRESS',
        self::SERVICE_ACCOUNT_NOT_CONFIGURED => 'SERVICE_ACCOUNT_NOT_CONFIGURED',
        self::TOO_MANY_SCANS => 'TOO_MANY_SCANS',
        self::UNABLE_TO_RESOLVE_PROJECT_INFO => 'UNABLE_TO_RESOLVE_PROJECT_INFO',
        self::UNSUPPORTED_BLACKLIST_PATTERN_FORMAT => 'UNSUPPORTED_BLACKLIST_PATTERN_FORMAT',
        self::UNSUPPORTED_FILTER => 'UNSUPPORTED_FILTER',
        self::UNSUPPORTED_FINDING_TYPE => 'UNSUPPORTED_FINDING_TYPE',
        self::UNSUPPORTED_URL_SCHEME => 'UNSUPPORTED_URL_SCHEME',
    ];

    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(Code::class, \Google\Cloud\WebSecurityScanner\V1beta\ScanConfigError_Code::class);

