UNPKG

google-ads-api-client

Version:

A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.

115 lines 7.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CallView = 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 google_voice_call_status_1 = require("../enums/google_voice_call_status"); const call_type_1 = require("../enums/call_type"); const call_tracking_display_location_1 = require("../enums/call_tracking_display_location"); // @generated message type with reflection information, may provide speed optimized methods class CallView$Type extends runtime_5.MessageType { constructor() { super("google.ads.googleads.v11.resources.CallView", [ { 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/CallView" } } }, { no: 2, name: "caller_country_code", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 3, name: "caller_area_code", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 4, name: "call_duration_seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 5, name: "start_call_date_time", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 6, name: "end_call_date_time", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 7, name: "call_tracking_display_location", kind: "enum", T: () => ["google.ads.googleads.v11.enums.CallTrackingDisplayLocationEnum.CallTrackingDisplayLocation", call_tracking_display_location_1.CallTrackingDisplayLocationEnum_CallTrackingDisplayLocation], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 8, name: "type", kind: "enum", T: () => ["google.ads.googleads.v11.enums.CallTypeEnum.CallType", call_type_1.CallTypeEnum_CallType], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }, { no: 9, name: "call_status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.GoogleVoiceCallStatusEnum.GoogleVoiceCallStatus", google_voice_call_status_1.GoogleVoiceCallStatusEnum_GoogleVoiceCallStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } } ], { "google.api.resource": { type: "googleads.googleapis.com/CallView", pattern: ["customers/{customer_id}/callViews/{call_detail_id}"] } }); } create(value) { const message = { resourceName: "", callerCountryCode: "", callerAreaCode: "", callDurationSeconds: 0n, startCallDateTime: "", endCallDateTime: "", callTrackingDisplayLocation: 0, type: 0, callStatus: 0 }; 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 /* string caller_country_code */ 2: message.callerCountryCode = reader.string(); break; case /* string caller_area_code */ 3: message.callerAreaCode = reader.string(); break; case /* int64 call_duration_seconds */ 4: message.callDurationSeconds = reader.int64().toBigInt(); break; case /* string start_call_date_time */ 5: message.startCallDateTime = reader.string(); break; case /* string end_call_date_time */ 6: message.endCallDateTime = reader.string(); break; case /* google.ads.googleads.v11.enums.CallTrackingDisplayLocationEnum.CallTrackingDisplayLocation call_tracking_display_location */ 7: message.callTrackingDisplayLocation = reader.int32(); break; case /* google.ads.googleads.v11.enums.CallTypeEnum.CallType type */ 8: message.type = reader.int32(); break; case /* google.ads.googleads.v11.enums.GoogleVoiceCallStatusEnum.GoogleVoiceCallStatus call_status */ 9: message.callStatus = reader.int32(); 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); /* string caller_country_code = 2; */ if (message.callerCountryCode !== "") writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.callerCountryCode); /* string caller_area_code = 3; */ if (message.callerAreaCode !== "") writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.callerAreaCode); /* int64 call_duration_seconds = 4; */ if (message.callDurationSeconds !== 0n) writer.tag(4, runtime_1.WireType.Varint).int64(message.callDurationSeconds); /* string start_call_date_time = 5; */ if (message.startCallDateTime !== "") writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.startCallDateTime); /* string end_call_date_time = 6; */ if (message.endCallDateTime !== "") writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.endCallDateTime); /* google.ads.googleads.v11.enums.CallTrackingDisplayLocationEnum.CallTrackingDisplayLocation call_tracking_display_location = 7; */ if (message.callTrackingDisplayLocation !== 0) writer.tag(7, runtime_1.WireType.Varint).int32(message.callTrackingDisplayLocation); /* google.ads.googleads.v11.enums.CallTypeEnum.CallType type = 8; */ if (message.type !== 0) writer.tag(8, runtime_1.WireType.Varint).int32(message.type); /* google.ads.googleads.v11.enums.GoogleVoiceCallStatusEnum.GoogleVoiceCallStatus call_status = 9; */ if (message.callStatus !== 0) writer.tag(9, runtime_1.WireType.Varint).int32(message.callStatus); 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.CallView */ exports.CallView = new CallView$Type(); //# sourceMappingURL=call_view.js.map