שינויים של שירות משאבים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הדרך הכי פשוטה לשנות משאב היא להשתמש בשירות האישי שלו, אבל היא גם הכי פחות גמישה.
שינוי נקודות קצה
הדרך הכי פשוטה לבצע שינוי היא באמצעות שירות ספציפי למשאב.
לכל משאב שניתן לשינוי יש שירות תואם וקבוצה של פעולות שמאפשרות ליצור, לעדכן או להסיר את המשאב.
נניח שרוצים ליצור Campaign
חדש.
יוצרים אובייקט Campaign
חדש, מכניסים אותו לתוך CampaignOperation
, ואז שולחים אותו לנקודת הקצה CampaignService.MutateCampaigns
.
אפשר לעשות את זה לכל אחד משירותי Google Ads API. לדוגמה, אם רוצים לשנות AdGroup
, מעבירים AdGroupOperation
שמכיל את AdGroup
ששונה לנקודת הקצה AdGroupService.MutateAdGroups
.
באופן דומה, אם רוצים לשנות CampaignCriterion
, צריך להשתמש ב-CampaignCriterionOperation
ולשלוח אותו לנקודת הקצה CampaignCriterionService.MutateCampaignCriteria
.
אפשר לחזור על השדה operations
של הבקשה, ולכן בקשת שינוי אחת יכולה להכיל כמה פעולות. עם זאת, כל פעולה נחשבת בנפרד מכל הפעולות האחרות, ולכן אי אפשר להשתמש בהפניות צולבות.
זה שונה משיטת השינוי בכמות גדולה (GoogleAdsService.Mutate
), שבה פעולות באותה בקשה יכולות להפנות לישויות מפעולות אחרות.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-09-05 (שעון UTC).
[null,null,["עדכון אחרון: 2025-09-05 (שעון UTC)."],[[["\u003cp\u003eThe most straightforward way to mutate a resource is by using its individual service and corresponding operations (create, update, or remove).\u003c/p\u003e\n"],["\u003cp\u003eEach mutable resource has a dedicated service with specific endpoints for mutation, like \u003ccode\u003eCampaignService.MutateCampaigns\u003c/code\u003e for \u003ccode\u003eCampaign\u003c/code\u003e resources.\u003c/p\u003e\n"],["\u003cp\u003eA single mutate request to a resource-specific service can handle multiple operations, but each operation is treated independently.\u003c/p\u003e\n"],["\u003cp\u003eResource-specific mutation differs from bulk mutation (\u003ccode\u003eGoogleAdsService.Mutate\u003c/code\u003e) where operations can cross-reference each other within the same request.\u003c/p\u003e\n"]]],[],null,["# Resource Service Mutates\n\nUsing a resource's individual service is the most straightforward way to mutate\nit, but also the least flexible.\n\nMutate Endpoints\n----------------\n\nUsing a resource-specific service is the most straightforward way to mutate.\nEach mutable resource has a corresponding service and a set of operations that\nenable you to create, update, or remove the resource.\n\nSuppose you want to create a new [`Campaign`](/google-ads/api/reference/rpc/v21/Campaign).\nYou would create a new [`Campaign`](/google-ads/api/reference/rpc/v21/Campaign)\nobject, put it inside a [`CampaignOperation`](/google-ads/api/reference/rpc/v21/CampaignOperation),\nand then send it to the\n[`CampaignService.MutateCampaigns`](/google-ads/api/reference/rpc/v21/CampaignService/MutateCampaigns)\nendpoint.\n\nYou can do this for any of the Google Ads API services. So for example, if you wanted\nto mutate an [`AdGroup`](/google-ads/api/reference/rpc/v21/AdGroup), you would pass an\n[`AdGroupOperation`](/google-ads/api/reference/rpc/v21/AdGroupOperation) containing the\nmutated [`AdGroup`](/google-ads/api/reference/rpc/v21/AdGroup) to the\n[`AdGroupService.MutateAdGroups`](/google-ads/api/reference/rpc/v21/AdGroupService/MutateAdGroups) endpoint.\n\nSimilarly, if you want to modify a [`CampaignCriterion`](/google-ads/api/reference/rpc/v21/CampaignCriterion), you would use a\n[`CampaignCriterionOperation`](/google-ads/api/reference/rpc/v21/CampaignCriterionOperation) and send it to the\n[`CampaignCriterionService.MutateCampaignCriteria`](/google-ads/api/reference/rpc/v21/CampaignCriterionService/MutateCampaignCriteria) endpoint.\n\nSince the `operations` field of the request can be repeated, a single mutate\nrequest can contain multiple operations. However, each operation is treated\nindependently from all others, so no cross-referencing is allowed.\n\nThis is in contrast to the bulk mutate method\n([`GoogleAdsService.Mutate`](/google-ads/api/reference/rpc/v21/GoogleAdsService/Mutate)),\nwhere operations within the same request can reference entities from other\noperations."]]