google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
121 lines • 8.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClickView = void 0;
const runtime_1 = require("@protobuf-ts/runtime");
const runtime_2 = require("@protobuf-ts/runtime");
const runtime_3 = require("@protobuf-ts/runtime");
const runtime_4 = require("@protobuf-ts/runtime");
const runtime_5 = require("@protobuf-ts/runtime");
const criteria_1 = require("../common/criteria");
const click_location_1 = require("../common/click_location");
// @generated message type with reflection information, may provide speed optimized methods
class ClickView$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.resources.ClickView", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/ClickView" } } },
{ no: 8, name: "gclid", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 3, name: "area_of_interest", kind: "message", T: () => click_location_1.ClickLocation, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 4, name: "location_of_presence", kind: "message", T: () => click_location_1.ClickLocation, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 9, name: "page_number", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 10, name: "ad_group_ad", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/AdGroupAd" } } },
{ no: 11, name: "campaign_location_target", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/GeoTargetConstant" } } },
{ no: 12, name: "user_list", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/UserList" } } },
{ no: 13, name: "keyword", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"], "google.api.resource_reference": { type: "googleads.googleapis.com/AdGroupCriterion" } } },
{ no: 14, name: "keyword_info", kind: "message", T: () => criteria_1.KeywordInfo, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }
], { "google.api.resource": { type: "googleads.googleapis.com/ClickView", pattern: ["customers/{customer_id}/clickViews/{date}~{gclid}"] } });
}
create(value) {
const message = { resourceName: "", keyword: "" };
globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
if (value !== undefined)
(0, runtime_3.reflectionMergePartial)(this, message, value);
return message;
}
internalBinaryRead(reader, length, options, target) {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string resource_name */ 1:
message.resourceName = reader.string();
break;
case /* optional string gclid */ 8:
message.gclid = reader.string();
break;
case /* google.ads.googleads.v11.common.ClickLocation area_of_interest */ 3:
message.areaOfInterest = click_location_1.ClickLocation.internalBinaryRead(reader, reader.uint32(), options, message.areaOfInterest);
break;
case /* google.ads.googleads.v11.common.ClickLocation location_of_presence */ 4:
message.locationOfPresence = click_location_1.ClickLocation.internalBinaryRead(reader, reader.uint32(), options, message.locationOfPresence);
break;
case /* optional int64 page_number */ 9:
message.pageNumber = reader.int64().toBigInt();
break;
case /* optional string ad_group_ad */ 10:
message.adGroupAd = reader.string();
break;
case /* optional string campaign_location_target */ 11:
message.campaignLocationTarget = reader.string();
break;
case /* optional string user_list */ 12:
message.userList = reader.string();
break;
case /* string keyword */ 13:
message.keyword = reader.string();
break;
case /* google.ads.googleads.v11.common.KeywordInfo keyword_info */ 14:
message.keywordInfo = criteria_1.KeywordInfo.internalBinaryRead(reader, reader.uint32(), options, message.keywordInfo);
break;
default:
let u = options.readUnknownField;
if (u === "throw")
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
let d = reader.skip(wireType);
if (u !== false)
(u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
}
}
return message;
}
internalBinaryWrite(message, writer, options) {
/* string resource_name = 1; */
if (message.resourceName !== "")
writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.resourceName);
/* optional string gclid = 8; */
if (message.gclid !== undefined)
writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.gclid);
/* google.ads.googleads.v11.common.ClickLocation area_of_interest = 3; */
if (message.areaOfInterest)
click_location_1.ClickLocation.internalBinaryWrite(message.areaOfInterest, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* google.ads.googleads.v11.common.ClickLocation location_of_presence = 4; */
if (message.locationOfPresence)
click_location_1.ClickLocation.internalBinaryWrite(message.locationOfPresence, writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join();
/* optional int64 page_number = 9; */
if (message.pageNumber !== undefined)
writer.tag(9, runtime_1.WireType.Varint).int64(message.pageNumber);
/* optional string ad_group_ad = 10; */
if (message.adGroupAd !== undefined)
writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.adGroupAd);
/* optional string campaign_location_target = 11; */
if (message.campaignLocationTarget !== undefined)
writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.campaignLocationTarget);
/* optional string user_list = 12; */
if (message.userList !== undefined)
writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.userList);
/* string keyword = 13; */
if (message.keyword !== "")
writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.keyword);
/* google.ads.googleads.v11.common.KeywordInfo keyword_info = 14; */
if (message.keywordInfo)
criteria_1.KeywordInfo.internalBinaryWrite(message.keywordInfo, writer.tag(14, runtime_1.WireType.LengthDelimited).fork(), options).join();
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message google.ads.googleads.v11.resources.ClickView
*/
exports.ClickView = new ClickView$Type();
//# sourceMappingURL=click_view.js.map