שיטות אחרות

השיטות Mutate,‏ Search ו-SearchStream הן השיטות הנפוצות ביותר ב-Google Ads API, אבל יש עוד הרבה שיטות למטרות ספציפיות. כל השירותים וממשקי ה-API שלהם מתועדים במסמכי העזר של REST.

מיפויים של Protocol Buffer RPC ל-REST

כל נקודות הקצה של השירות (בין שבשימוש ב-REST ובין שבשימוש ב-gRPC) מוגדרות בסופו של דבר בקובצי ה-proto של חבילת השירותים באמצעות שפת הגדרת הממשק proto3.

דוגמה: ListAccessibleCustomers

לדוגמה, הקובץ customer_service.proto מגדיר שיטה ListAccessibleCustomers, בנוסף לשיטה הרגילה Mutate. ההערה google.api.http מתארת איך מתבצע המיפוי של השיטה ל-HTTP. הוא משתמש ב-HTTP GET עם הפועל המותאם אישית listAccessibleCustomers:

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

הקריאה הזו ממופה לשיטת ה-REST‏ customers.listAccessibleCustomers.

דוגמה: CreateCustomerClient

דוגמה נוספת מ-customer_service.proto היא השיטה CreateCustomerClient. ההערה google.api.http מתארת POST של HTTP באמצעות הפועל בהתאמה אישית createCustomerClient:

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

הקריאה הזו ממופה לשיטת ה-REST‏ customers.createCustomerClient.