Mutate、Search、SearchStream は Google Ads API で最も一般的なメソッドですが、特定の目的で使用されるメソッドも多数あります。すべてのサービスとその API については、リファレンス ドキュメントに記載されています。
プロトコル バッファ 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: "/v22/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: "/v22/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
これは、customers.createCustomerClient REST メソッドに対応します。