その他の方法

MutateSearchSearchStream は Google Ads API で最も一般的なメソッドですが、特定の目的で使用されるメソッドは他にも多数あります。すべてのサービスとその API については、REST リファレンス ドキュメントに記載されています。

プロトコル バッファ RPC から REST へのマッピング

すべてのサービス エンドポイント(REST と gRPC のどちらを使用しているかに関係なく)は、最終的に proto3 インターフェース定義言語を使用して、サービス パッケージの .proto ファイルで定義されます。

例: ListAccessibleCustomers

たとえば、customer_service.proto ファイルは、標準の Mutate に加えて ListAccessibleCustomers メソッドを定義します。google.api.http アノテーションは、メソッドが HTTP にどのようにマッピングされるかを記述します。カスタム動詞 listAccessibleCustomers を使用した HTTP GET を使用します。

rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
    returns (ListAccessibleCustomersResponse) {
  option (google.api.http) = {
    get: "/v20/customers:listAccessibleCustomers"
  };
}

これは customers.listAccessibleCustomers REST メソッドにマッピングされます。

例: CreateCustomerClient

customer_service.proto の別の例として、CreateCustomerClient メソッドがあります。google.api.http アノテーションは、カスタム動詞 createCustomerClient を使用して HTTP POST を記述します。

rpc CreateCustomerClient(CreateCustomerClientRequest)
    returns (CreateCustomerClientResponse) {
  option (google.api.http) = {
    post: "/v20/customers/{customer_id=*}:createCustomerClient"
    body: "*"
  };
  option (google.api.method_signature) = "customer_id,customer_client";
}

これは、customers.createCustomerClient REST メソッドに対応します。