bookmark_borderbookmark
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Khi sử dụng bất kỳ trường không bắt buộc nào trên phương thức yêu cầu, bạn phải tạo thông báo yêu cầu bên ngoài phương thức và truyền vào dưới dạng một tham số duy nhất.
Các tiêu đề yêu cầu không bắt buộc, ví dụ: tiêu đề validate_only trong phương thức GoogleAdsService.Search, không có trong chữ ký phương thức dưới dạng tham số từ khoá, vì vậy, bạn phải đặt trực tiếp các tiêu đề này trên thông báo yêu cầu.
Để xác định xem trường đối tượng yêu cầu là bắt buộc hay không bắt buộc, bạn có thể tham khảo các định nghĩa protobuf cho các dịch vụ và tìm các trường chứa chú thích [(google.api.field_behavior) =
REQUIRED].
Sau đây là ví dụ về cách đặt trường validate_only không bắt buộc trên yêu cầu GoogleAdsService.Search:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-03-29 UTC."],[[["When using optional fields in Google Ads API requests, construct the request message separately and pass it as a single parameter to the method."],["Optional request headers like `validate_only` are set directly on the request message, not as keyword parameters in the method signature."],["You can identify required or optional request fields by checking the protobuf definitions and looking for the `[(google.api.field_behavior) = REQUIRED]` annotation."],["To use optional fields, create an instance of the request message type, populate its fields including the optional ones, and then pass it to the API method."]]],[]]