Mutate
、Search
、SearchStream
は Google Ads API で最も一般的なメソッドですが、具体的な用途には他にも多くのメソッドがあります。すべてのサービスとその API については、REST リファレンス ドキュメントをご覧ください。
プロトコル バッファによる RPC から REST へのマッピング
すべてのサービス エンドポイント(REST と gRPC のどちらを使用する場合でも)は、最終的には、サービス パッケージの .proto ファイルproto3 インターフェース定義言語 で定義されます。
例: ListAccessibleCustomers
たとえば、customer_service.proto
ファイルは、標準の Mutate
に加えて、ListAccessibleCustomers
メソッドを定義します。その google.api.http
アノテーションは、メソッドが HTTP にマッピングされる方法を示しています。カスタム動詞 listAccessibleCustomers
を含む HTTP GET
を使用します。
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v11/customers:listAccessibleCustomers" }; }
これは、customers.listAccessibleCustomers REST メソッドにマッピングされます。
例: CreateCustomerClient
customer_service.proto
のもう 1 つの例は、CreateCustomerClient
メソッドです。その google.api.http
アノテーションは、カスタム動詞 createCustomerClient
を使用した HTTP POST
を記述します。
rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) { option (google.api.http) = { post: "/v11/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
これは、customers.createCustomerClient REST メソッドにマッピングされます。