Python 2.7 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Python 2.7 アプリケーションをデプロイできなくなります。既存の Python 2.7 アプリケーションは、
非推奨日以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Python に移行することをおすすめします。
記述子モジュール関数(試験運用版)
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
protorpc.remote
パッケージは、次の関数を提供します。
- is_error_status(status)
-
RPC ステータスがエラーかどうかを判断します。
引数
- status
- エラーの有無を確認するために初期化された RpcStatus メッセージです。
- check_rpc_status(status)
-
エラー ステータスを送出する例外に変換します。
引数
- status
- エラーの有無を確認するために初期化された RpcStatus メッセージです。
status
の状態がエラーの場合は、RpcError が発生します。
- method(request_type=message_types.VoidMessage, response_type=message_types.VoidMessage)
-
メソッドをリモートにするためにメソッドを修飾します。
引数
- request_type=message_types.VoidMessage
- 想定されるリクエストのメッセージの種類です。
- response_type=message_types.VoidMessage
- 想定されるレスポンスのメッセージの種類です。
修飾されたリモート メソッドを返します。リモート メソッドには、次のプロパティを持つ remote
属性が含まれます。
- メソッド
- 元の未修飾メソッドです。
- request_type
- 想定されるリクエストのメッセージの種類です。
- response_type
- 想定されるレスポンスのメッセージの種類です。
request_type
や response_type
パラメータが messages.Message の適切なサブクラスではない場合は、TypeError が発生します。
- get_remote_method(method)
-
リモート メソッドの場合は、リモート メソッド情報オブジェクトを返します。それ以外の場合は None を返します。
引数
- メソッド
- 取得するメソッドです。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003e\u003ccode\u003eis_error_status(status)\u003c/code\u003e checks if an \u003ccode\u003eRpcStatus\u003c/code\u003e message indicates an error.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003echeck_rpc_status(status)\u003c/code\u003e raises an \u003ccode\u003eRpcError\u003c/code\u003e exception if the provided \u003ccode\u003eRpcStatus\u003c/code\u003e message indicates an error.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003emethod()\u003c/code\u003e decorates a method to make it remote, defining its request and response message types.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eget_remote_method(method)\u003c/code\u003e retrieves remote method information for a given method or returns \u003ccode\u003eNone\u003c/code\u003e if it's not a remote method.\u003c/p\u003e\n"]]],[],null,["# Descriptor Module Functions (Experimental)\n\nThe `protorpc.remote` package provides the following functions:\n\nis_error_status(status)\n\n: Determines whether the RPC status is an error.\n\n **Arguments**\n\n status\n : Initialized RpcStatus message to check for errors.\n\ncheck_rpc_status(status)\n\n: Converts an error status to a raised exception.\n\n **Arguments**\n\n status\n : Initialized RpcStatus message to check for errors.\n\n Raises an [RpcError](/appengine/docs/legacy/standard/python/tools/protorpc/remote/exceptions#RpcError) if the state of `status` is an error.\n\nmethod(request_type=message_types.VoidMessage, response_type=message_types.VoidMessage)\n\n: Decorates a method for making the method remote.\n\n **Arguments**\n\n request_type=message_types.VoidMessage\n : Message type of the expected request.\n\n response_type=message_types.VoidMessage\n : Message type of the expected response.\n\n Returns a decorated remote method. The remote method will include a `remote` attribute with the following properties:\n\n method\n : The original, undecorated method\n\n request_type\n : Message type of the expected request.\n\n response_type\n : Message type of the expected response.\n\n Raises an [TypeError](http://docs.python.org/library/exceptions.html#exceptions.TypeError) if the `request_type` or `response_type` parameters are not proper subclasses of messages.Message.\n\nget_remote_method(method)\n\n: For remote methods, returns a remote method information object, else None.\n\n **Arguments**\n\n method\n : The method to get."]]