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

namespace Google\Cloud\Deploy\V1\Release\TargetRender;

use UnexpectedValueException;

/**
 * Well-known rendering failures.
 *
 * Protobuf type <code>google.cloud.deploy.v1.Release.TargetRender.FailureCause</code>
 */
class FailureCause
{
    /**
     * No reason for failure is specified.
     *
     * Generated from protobuf enum <code>FAILURE_CAUSE_UNSPECIFIED = 0;</code>
     */
    const FAILURE_CAUSE_UNSPECIFIED = 0;
    /**
     * Cloud Build is not available, either because it is not enabled or
     * because Cloud Deploy has insufficient permissions. See [required
     * permission](https://cloud.google.com/deploy/docs/cloud-deploy-service-account#required_permissions).
     *
     * Generated from protobuf enum <code>CLOUD_BUILD_UNAVAILABLE = 1;</code>
     */
    const CLOUD_BUILD_UNAVAILABLE = 1;
    /**
     * The render operation did not complete successfully; check Cloud Build
     * logs.
     *
     * Generated from protobuf enum <code>EXECUTION_FAILED = 2;</code>
     */
    const EXECUTION_FAILED = 2;
    /**
     * Cloud Build failed to fulfill Cloud Deploy's request. See
     * failure_message for additional details.
     *
     * Generated from protobuf enum <code>CLOUD_BUILD_REQUEST_FAILED = 3;</code>
     */
    const CLOUD_BUILD_REQUEST_FAILED = 3;
    /**
     * The render operation did not complete successfully because the
     * verification stanza required for verify was not found on the Skaffold
     * configuration.
     *
     * Generated from protobuf enum <code>VERIFICATION_CONFIG_NOT_FOUND = 4;</code>
     */
    const VERIFICATION_CONFIG_NOT_FOUND = 4;
    /**
     * The render operation did not complete successfully because the custom
     * action required for predeploy or postdeploy was not found in the
     * Skaffold configuration. See failure_message for additional details.
     *
     * Generated from protobuf enum <code>CUSTOM_ACTION_NOT_FOUND = 5;</code>
     */
    const CUSTOM_ACTION_NOT_FOUND = 5;
    /**
     * Release failed during rendering because the release configuration is
     * not supported with the specified deployment strategy.
     *
     * Generated from protobuf enum <code>DEPLOYMENT_STRATEGY_NOT_SUPPORTED = 6;</code>
     */
    const DEPLOYMENT_STRATEGY_NOT_SUPPORTED = 6;
    /**
     * The render operation had a feature configured that is not supported.
     *
     * Generated from protobuf enum <code>RENDER_FEATURE_NOT_SUPPORTED = 7;</code>
     */
    const RENDER_FEATURE_NOT_SUPPORTED = 7;

    private static $valueToName = [
        self::FAILURE_CAUSE_UNSPECIFIED => 'FAILURE_CAUSE_UNSPECIFIED',
        self::CLOUD_BUILD_UNAVAILABLE => 'CLOUD_BUILD_UNAVAILABLE',
        self::EXECUTION_FAILED => 'EXECUTION_FAILED',
        self::CLOUD_BUILD_REQUEST_FAILED => 'CLOUD_BUILD_REQUEST_FAILED',
        self::VERIFICATION_CONFIG_NOT_FOUND => 'VERIFICATION_CONFIG_NOT_FOUND',
        self::CUSTOM_ACTION_NOT_FOUND => 'CUSTOM_ACTION_NOT_FOUND',
        self::DEPLOYMENT_STRATEGY_NOT_SUPPORTED => 'DEPLOYMENT_STRATEGY_NOT_SUPPORTED',
        self::RENDER_FEATURE_NOT_SUPPORTED => 'RENDER_FEATURE_NOT_SUPPORTED',
    ];

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


