1ffe3c632Sopenharmony_ci<?php 2ffe3c632Sopenharmony_ci# Generated by the protocol buffer compiler. DO NOT EDIT! 3ffe3c632Sopenharmony_ci# source: google/protobuf/descriptor.proto 4ffe3c632Sopenharmony_ci 5ffe3c632Sopenharmony_cinamespace Google\Protobuf\Internal\MethodOptions; 6ffe3c632Sopenharmony_ci 7ffe3c632Sopenharmony_ciuse UnexpectedValueException; 8ffe3c632Sopenharmony_ci 9ffe3c632Sopenharmony_ci/** 10ffe3c632Sopenharmony_ci * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, 11ffe3c632Sopenharmony_ci * or neither? HTTP based RPC implementation may choose GET verb for safe 12ffe3c632Sopenharmony_ci * methods, and PUT verb for idempotent methods instead of the default POST. 13ffe3c632Sopenharmony_ci * 14ffe3c632Sopenharmony_ci * Protobuf type <code>google.protobuf.MethodOptions.IdempotencyLevel</code> 15ffe3c632Sopenharmony_ci */ 16ffe3c632Sopenharmony_ciclass IdempotencyLevel 17ffe3c632Sopenharmony_ci{ 18ffe3c632Sopenharmony_ci /** 19ffe3c632Sopenharmony_ci * Generated from protobuf enum <code>IDEMPOTENCY_UNKNOWN = 0;</code> 20ffe3c632Sopenharmony_ci */ 21ffe3c632Sopenharmony_ci const IDEMPOTENCY_UNKNOWN = 0; 22ffe3c632Sopenharmony_ci /** 23ffe3c632Sopenharmony_ci * implies idempotent 24ffe3c632Sopenharmony_ci * 25ffe3c632Sopenharmony_ci * Generated from protobuf enum <code>NO_SIDE_EFFECTS = 1;</code> 26ffe3c632Sopenharmony_ci */ 27ffe3c632Sopenharmony_ci const NO_SIDE_EFFECTS = 1; 28ffe3c632Sopenharmony_ci /** 29ffe3c632Sopenharmony_ci * idempotent, but may have side effects 30ffe3c632Sopenharmony_ci * 31ffe3c632Sopenharmony_ci * Generated from protobuf enum <code>IDEMPOTENT = 2;</code> 32ffe3c632Sopenharmony_ci */ 33ffe3c632Sopenharmony_ci const IDEMPOTENT = 2; 34ffe3c632Sopenharmony_ci 35ffe3c632Sopenharmony_ci private static $valueToName = [ 36ffe3c632Sopenharmony_ci self::IDEMPOTENCY_UNKNOWN => 'IDEMPOTENCY_UNKNOWN', 37ffe3c632Sopenharmony_ci self::NO_SIDE_EFFECTS => 'NO_SIDE_EFFECTS', 38ffe3c632Sopenharmony_ci self::IDEMPOTENT => 'IDEMPOTENT', 39ffe3c632Sopenharmony_ci ]; 40ffe3c632Sopenharmony_ci 41ffe3c632Sopenharmony_ci public static function name($value) 42ffe3c632Sopenharmony_ci { 43ffe3c632Sopenharmony_ci if (!isset(self::$valueToName[$value])) { 44ffe3c632Sopenharmony_ci throw new UnexpectedValueException(sprintf( 45ffe3c632Sopenharmony_ci 'Enum %s has no name defined for value %s', __CLASS__, $value)); 46ffe3c632Sopenharmony_ci } 47ffe3c632Sopenharmony_ci return self::$valueToName[$value]; 48ffe3c632Sopenharmony_ci } 49ffe3c632Sopenharmony_ci 50ffe3c632Sopenharmony_ci 51ffe3c632Sopenharmony_ci public static function value($name) 52ffe3c632Sopenharmony_ci { 53ffe3c632Sopenharmony_ci $const = __CLASS__ . '::' . strtoupper($name); 54ffe3c632Sopenharmony_ci if (!defined($const)) { 55ffe3c632Sopenharmony_ci throw new UnexpectedValueException(sprintf( 56ffe3c632Sopenharmony_ci 'Enum %s has no value defined for name %s', __CLASS__, $name)); 57ffe3c632Sopenharmony_ci } 58ffe3c632Sopenharmony_ci return constant($const); 59ffe3c632Sopenharmony_ci } 60ffe3c632Sopenharmony_ci} 61ffe3c632Sopenharmony_ci 62ffe3c632Sopenharmony_ci// Adding a class alias for backwards compatibility with the previous class name. 63ffe3c632Sopenharmony_ciclass_alias(IdempotencyLevel::class, \Google\Protobuf\Internal\MethodOptions_IdempotencyLevel::class); 64ffe3c632Sopenharmony_ci 65