google-ads-api-client
Version:
A friendly and exhaustive client to the google-ads-api, code generated directly from google's published protobuf schema.
237 lines • 18.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountBudgetProposal = 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 spending_limit_type_1 = require("../enums/spending_limit_type");
const time_type_1 = require("../enums/time_type");
const account_budget_proposal_status_1 = require("../enums/account_budget_proposal_status");
const account_budget_proposal_type_1 = require("../enums/account_budget_proposal_type");
// @generated message type with reflection information, may provide speed optimized methods
class AccountBudgetProposal$Type extends runtime_5.MessageType {
constructor() {
super("google.ads.googleads.v11.resources.AccountBudgetProposal", [
{ no: 1, name: "resource_name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/AccountBudgetProposal" } } },
{ no: 25, name: "id", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 26, name: "billing_setup", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/BillingSetup" } } },
{ no: 27, name: "account_budget", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"], "google.api.resource_reference": { type: "googleads.googleapis.com/AccountBudget" } } },
{ no: 4, name: "proposal_type", kind: "enum", T: () => ["google.ads.googleads.v11.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType", account_budget_proposal_type_1.AccountBudgetProposalTypeEnum_AccountBudgetProposalType], options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 15, name: "status", kind: "enum", T: () => ["google.ads.googleads.v11.enums.AccountBudgetProposalStatusEnum.AccountBudgetProposalStatus", account_budget_proposal_status_1.AccountBudgetProposalStatusEnum_AccountBudgetProposalStatus], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 28, name: "proposed_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 30, name: "approved_start_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 35, name: "proposed_purchase_order_number", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 36, name: "proposed_notes", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 37, name: "creation_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 38, name: "approval_date_time", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 29, name: "proposed_start_date_time", kind: "scalar", oneof: "proposedStartTime", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 7, name: "proposed_start_time_type", kind: "enum", oneof: "proposedStartTime", T: () => ["google.ads.googleads.v11.enums.TimeTypeEnum.TimeType", time_type_1.TimeTypeEnum_TimeType], options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 31, name: "proposed_end_date_time", kind: "scalar", oneof: "proposedEndTime", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 9, name: "proposed_end_time_type", kind: "enum", oneof: "proposedEndTime", T: () => ["google.ads.googleads.v11.enums.TimeTypeEnum.TimeType", time_type_1.TimeTypeEnum_TimeType], options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 32, name: "approved_end_date_time", kind: "scalar", oneof: "approvedEndTime", T: 9 /*ScalarType.STRING*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 22, name: "approved_end_time_type", kind: "enum", oneof: "approvedEndTime", T: () => ["google.ads.googleads.v11.enums.TimeTypeEnum.TimeType", time_type_1.TimeTypeEnum_TimeType], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 33, name: "proposed_spending_limit_micros", kind: "scalar", oneof: "proposedSpendingLimit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 11, name: "proposed_spending_limit_type", kind: "enum", oneof: "proposedSpendingLimit", T: () => ["google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType", spending_limit_type_1.SpendingLimitTypeEnum_SpendingLimitType], options: { "google.api.field_behavior": ["IMMUTABLE"] } },
{ no: 34, name: "approved_spending_limit_micros", kind: "scalar", oneof: "approvedSpendingLimit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } },
{ no: 24, name: "approved_spending_limit_type", kind: "enum", oneof: "approvedSpendingLimit", T: () => ["google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType", spending_limit_type_1.SpendingLimitTypeEnum_SpendingLimitType], options: { "google.api.field_behavior": ["OUTPUT_ONLY"] } }
], { "google.api.resource": { type: "googleads.googleapis.com/AccountBudgetProposal", pattern: ["customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}"] } });
}
create(value) {
const message = { resourceName: "", proposalType: 0, status: 0, proposedStartTime: { oneofKind: undefined }, proposedEndTime: { oneofKind: undefined }, approvedEndTime: { oneofKind: undefined }, proposedSpendingLimit: { oneofKind: undefined }, approvedSpendingLimit: { oneofKind: undefined } };
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 int64 id */ 25:
message.id = reader.int64().toBigInt();
break;
case /* optional string billing_setup */ 26:
message.billingSetup = reader.string();
break;
case /* optional string account_budget */ 27:
message.accountBudget = reader.string();
break;
case /* google.ads.googleads.v11.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType proposal_type */ 4:
message.proposalType = reader.int32();
break;
case /* google.ads.googleads.v11.enums.AccountBudgetProposalStatusEnum.AccountBudgetProposalStatus status */ 15:
message.status = reader.int32();
break;
case /* optional string proposed_name */ 28:
message.proposedName = reader.string();
break;
case /* optional string approved_start_date_time */ 30:
message.approvedStartDateTime = reader.string();
break;
case /* optional string proposed_purchase_order_number */ 35:
message.proposedPurchaseOrderNumber = reader.string();
break;
case /* optional string proposed_notes */ 36:
message.proposedNotes = reader.string();
break;
case /* optional string creation_date_time */ 37:
message.creationDateTime = reader.string();
break;
case /* optional string approval_date_time */ 38:
message.approvalDateTime = reader.string();
break;
case /* string proposed_start_date_time */ 29:
message.proposedStartTime = {
oneofKind: "proposedStartDateTime",
proposedStartDateTime: reader.string()
};
break;
case /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType proposed_start_time_type */ 7:
message.proposedStartTime = {
oneofKind: "proposedStartTimeType",
proposedStartTimeType: reader.int32()
};
break;
case /* string proposed_end_date_time */ 31:
message.proposedEndTime = {
oneofKind: "proposedEndDateTime",
proposedEndDateTime: reader.string()
};
break;
case /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType proposed_end_time_type */ 9:
message.proposedEndTime = {
oneofKind: "proposedEndTimeType",
proposedEndTimeType: reader.int32()
};
break;
case /* string approved_end_date_time */ 32:
message.approvedEndTime = {
oneofKind: "approvedEndDateTime",
approvedEndDateTime: reader.string()
};
break;
case /* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType approved_end_time_type */ 22:
message.approvedEndTime = {
oneofKind: "approvedEndTimeType",
approvedEndTimeType: reader.int32()
};
break;
case /* int64 proposed_spending_limit_micros */ 33:
message.proposedSpendingLimit = {
oneofKind: "proposedSpendingLimitMicros",
proposedSpendingLimitMicros: reader.int64().toBigInt()
};
break;
case /* google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType proposed_spending_limit_type */ 11:
message.proposedSpendingLimit = {
oneofKind: "proposedSpendingLimitType",
proposedSpendingLimitType: reader.int32()
};
break;
case /* int64 approved_spending_limit_micros */ 34:
message.approvedSpendingLimit = {
oneofKind: "approvedSpendingLimitMicros",
approvedSpendingLimitMicros: reader.int64().toBigInt()
};
break;
case /* google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType approved_spending_limit_type */ 24:
message.approvedSpendingLimit = {
oneofKind: "approvedSpendingLimitType",
approvedSpendingLimitType: 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);
/* optional int64 id = 25; */
if (message.id !== undefined)
writer.tag(25, runtime_1.WireType.Varint).int64(message.id);
/* optional string billing_setup = 26; */
if (message.billingSetup !== undefined)
writer.tag(26, runtime_1.WireType.LengthDelimited).string(message.billingSetup);
/* optional string account_budget = 27; */
if (message.accountBudget !== undefined)
writer.tag(27, runtime_1.WireType.LengthDelimited).string(message.accountBudget);
/* google.ads.googleads.v11.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType proposal_type = 4; */
if (message.proposalType !== 0)
writer.tag(4, runtime_1.WireType.Varint).int32(message.proposalType);
/* google.ads.googleads.v11.enums.AccountBudgetProposalStatusEnum.AccountBudgetProposalStatus status = 15; */
if (message.status !== 0)
writer.tag(15, runtime_1.WireType.Varint).int32(message.status);
/* optional string proposed_name = 28; */
if (message.proposedName !== undefined)
writer.tag(28, runtime_1.WireType.LengthDelimited).string(message.proposedName);
/* optional string approved_start_date_time = 30; */
if (message.approvedStartDateTime !== undefined)
writer.tag(30, runtime_1.WireType.LengthDelimited).string(message.approvedStartDateTime);
/* optional string proposed_purchase_order_number = 35; */
if (message.proposedPurchaseOrderNumber !== undefined)
writer.tag(35, runtime_1.WireType.LengthDelimited).string(message.proposedPurchaseOrderNumber);
/* optional string proposed_notes = 36; */
if (message.proposedNotes !== undefined)
writer.tag(36, runtime_1.WireType.LengthDelimited).string(message.proposedNotes);
/* optional string creation_date_time = 37; */
if (message.creationDateTime !== undefined)
writer.tag(37, runtime_1.WireType.LengthDelimited).string(message.creationDateTime);
/* optional string approval_date_time = 38; */
if (message.approvalDateTime !== undefined)
writer.tag(38, runtime_1.WireType.LengthDelimited).string(message.approvalDateTime);
/* string proposed_start_date_time = 29; */
if (message.proposedStartTime.oneofKind === "proposedStartDateTime")
writer.tag(29, runtime_1.WireType.LengthDelimited).string(message.proposedStartTime.proposedStartDateTime);
/* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType proposed_start_time_type = 7; */
if (message.proposedStartTime.oneofKind === "proposedStartTimeType")
writer.tag(7, runtime_1.WireType.Varint).int32(message.proposedStartTime.proposedStartTimeType);
/* string proposed_end_date_time = 31; */
if (message.proposedEndTime.oneofKind === "proposedEndDateTime")
writer.tag(31, runtime_1.WireType.LengthDelimited).string(message.proposedEndTime.proposedEndDateTime);
/* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType proposed_end_time_type = 9; */
if (message.proposedEndTime.oneofKind === "proposedEndTimeType")
writer.tag(9, runtime_1.WireType.Varint).int32(message.proposedEndTime.proposedEndTimeType);
/* string approved_end_date_time = 32; */
if (message.approvedEndTime.oneofKind === "approvedEndDateTime")
writer.tag(32, runtime_1.WireType.LengthDelimited).string(message.approvedEndTime.approvedEndDateTime);
/* google.ads.googleads.v11.enums.TimeTypeEnum.TimeType approved_end_time_type = 22; */
if (message.approvedEndTime.oneofKind === "approvedEndTimeType")
writer.tag(22, runtime_1.WireType.Varint).int32(message.approvedEndTime.approvedEndTimeType);
/* int64 proposed_spending_limit_micros = 33; */
if (message.proposedSpendingLimit.oneofKind === "proposedSpendingLimitMicros")
writer.tag(33, runtime_1.WireType.Varint).int64(message.proposedSpendingLimit.proposedSpendingLimitMicros);
/* google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType proposed_spending_limit_type = 11; */
if (message.proposedSpendingLimit.oneofKind === "proposedSpendingLimitType")
writer.tag(11, runtime_1.WireType.Varint).int32(message.proposedSpendingLimit.proposedSpendingLimitType);
/* int64 approved_spending_limit_micros = 34; */
if (message.approvedSpendingLimit.oneofKind === "approvedSpendingLimitMicros")
writer.tag(34, runtime_1.WireType.Varint).int64(message.approvedSpendingLimit.approvedSpendingLimitMicros);
/* google.ads.googleads.v11.enums.SpendingLimitTypeEnum.SpendingLimitType approved_spending_limit_type = 24; */
if (message.approvedSpendingLimit.oneofKind === "approvedSpendingLimitType")
writer.tag(24, runtime_1.WireType.Varint).int32(message.approvedSpendingLimit.approvedSpendingLimitType);
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.AccountBudgetProposal
*/
exports.AccountBudgetProposal = new AccountBudgetProposal$Type();
//# sourceMappingURL=account_budget_proposal.js.map