codekingpro/portable-devtools
114k
1# Copyright 2016 Google Inc. All Rights Reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14 15"""Safe implementation of long-running operations with and without gRPC.16 17Multiplexes between versions of long-running operations with and without gRPC.18The former is preferred, but not possible in all environments (such as Google19AppEngine Standard).20"""21 22try:23 from google.longrunning.operations_grpc_pb2 import *24 from google.longrunning.operations_grpc_pb2 import (25 _CANCELOPERATIONREQUEST,26 _DELETEOPERATIONREQUEST,27 _GETOPERATIONREQUEST,28 _LISTOPERATIONSREQUEST,29 _LISTOPERATIONSRESPONSE,30 _OPERATION,31 _OPERATIONINFO,32 _OPERATIONS,33 )34except ImportError:35 from google.longrunning.operations_proto_pb2 import *36 from google.longrunning.operations_proto_pb2 import (37 _CANCELOPERATIONREQUEST,38 _DELETEOPERATIONREQUEST,39 _GETOPERATIONREQUEST,40 _LISTOPERATIONSREQUEST,41 _LISTOPERATIONSRESPONSE,42 _OPERATION,43 _OPERATIONINFO,44 _OPERATIONS,45 )46 