UNPKG

@htdangkhoa/google-ads

Version:
1,197 lines (1,196 loc) 85.2 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.181.2 // protoc v3.21.12 // source: google/ads/googleads/v24/services/benchmarks_service.proto /* eslint-disable */ import { makeGenericClientConstructor, } from "@grpc/grpc-js"; import Long from "long"; import _m0 from "protobufjs/minimal.js"; import { AdditionalApplicationInfo } from "../common/additional_application_info.js"; import { LocationInfo } from "../common/criteria.js"; import { DateRange } from "../common/dates.js"; import { benchmarksMarketingObjectiveEnum_BenchmarksMarketingObjectiveFromJSON, benchmarksMarketingObjectiveEnum_BenchmarksMarketingObjectiveToJSON, } from "../enums/benchmarks_marketing_objective.js"; import { benchmarksSourceTypeEnum_BenchmarksSourceTypeFromJSON, benchmarksSourceTypeEnum_BenchmarksSourceTypeToJSON, } from "../enums/benchmarks_source_type.js"; import { benchmarksTimeGranularityEnum_BenchmarksTimeGranularityFromJSON, benchmarksTimeGranularityEnum_BenchmarksTimeGranularityToJSON, } from "../enums/benchmarks_time_granularity.js"; function createBaseListBenchmarksAvailableDatesRequest() { return { application_info: undefined }; } export const ListBenchmarksAvailableDatesRequest = { encode(message, writer = _m0.Writer.create()) { if (message.application_info !== undefined) { AdditionalApplicationInfo.encode(message.application_info, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksAvailableDatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.application_info = AdditionalApplicationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { application_info: isSet(object.application_info) ? AdditionalApplicationInfo.fromJSON(object.application_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.application_info !== undefined) { obj.application_info = AdditionalApplicationInfo.toJSON(message.application_info); } return obj; }, create(base) { return ListBenchmarksAvailableDatesRequest.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBaseListBenchmarksAvailableDatesRequest(); message.application_info = (object.application_info !== undefined && object.application_info !== null) ? AdditionalApplicationInfo.fromPartial(object.application_info) : undefined; return message; }, }; function createBaseListBenchmarksAvailableDatesResponse() { return { supported_dates: undefined }; } export const ListBenchmarksAvailableDatesResponse = { encode(message, writer = _m0.Writer.create()) { if (message.supported_dates !== undefined) { DateRange.encode(message.supported_dates, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksAvailableDatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.supported_dates = DateRange.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { supported_dates: isSet(object.supported_dates) ? DateRange.fromJSON(object.supported_dates) : undefined }; }, toJSON(message) { const obj = {}; if (message.supported_dates !== undefined) { obj.supported_dates = DateRange.toJSON(message.supported_dates); } return obj; }, create(base) { return ListBenchmarksAvailableDatesResponse.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBaseListBenchmarksAvailableDatesResponse(); message.supported_dates = (object.supported_dates !== undefined && object.supported_dates !== null) ? DateRange.fromPartial(object.supported_dates) : undefined; return message; }, }; function createBaseListBenchmarksLocationsRequest() { return { application_info: undefined }; } export const ListBenchmarksLocationsRequest = { encode(message, writer = _m0.Writer.create()) { if (message.application_info !== undefined) { AdditionalApplicationInfo.encode(message.application_info, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksLocationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.application_info = AdditionalApplicationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { application_info: isSet(object.application_info) ? AdditionalApplicationInfo.fromJSON(object.application_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.application_info !== undefined) { obj.application_info = AdditionalApplicationInfo.toJSON(message.application_info); } return obj; }, create(base) { return ListBenchmarksLocationsRequest.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBaseListBenchmarksLocationsRequest(); message.application_info = (object.application_info !== undefined && object.application_info !== null) ? AdditionalApplicationInfo.fromPartial(object.application_info) : undefined; return message; }, }; function createBaseListBenchmarksLocationsResponse() { return { benchmarks_locations: [] }; } export const ListBenchmarksLocationsResponse = { encode(message, writer = _m0.Writer.create()) { if (message.benchmarks_locations !== undefined && message.benchmarks_locations.length !== 0) { for (const v of message.benchmarks_locations) { BenchmarksLocation.encode(v, writer.uint32(10).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksLocationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.benchmarks_locations.push(BenchmarksLocation.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { benchmarks_locations: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.benchmarks_locations) ? object.benchmarks_locations.map((e) => BenchmarksLocation.fromJSON(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.benchmarks_locations) === null || _a === void 0 ? void 0 : _a.length) { obj.benchmarks_locations = message.benchmarks_locations.map((e) => BenchmarksLocation.toJSON(e)); } return obj; }, create(base) { return ListBenchmarksLocationsResponse.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseListBenchmarksLocationsResponse(); message.benchmarks_locations = ((_a = object.benchmarks_locations) === null || _a === void 0 ? void 0 : _a.map((e) => BenchmarksLocation.fromPartial(e))) || []; return message; }, }; function createBaseBenchmarksLocation() { return { location_name: "", location_type: "", location_info: undefined }; } export const BenchmarksLocation = { encode(message, writer = _m0.Writer.create()) { if (message.location_name !== undefined && message.location_name !== "") { writer.uint32(10).string(message.location_name); } if (message.location_type !== undefined && message.location_type !== "") { writer.uint32(18).string(message.location_type); } if (message.location_info !== undefined) { LocationInfo.encode(message.location_info, writer.uint32(26).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBenchmarksLocation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.location_name = reader.string(); continue; case 2: if (tag !== 18) { break; } message.location_type = reader.string(); continue; case 3: if (tag !== 26) { break; } message.location_info = LocationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { location_name: isSet(object.location_name) ? globalThis.String(object.location_name) : "", location_type: isSet(object.location_type) ? globalThis.String(object.location_type) : "", location_info: isSet(object.location_info) ? LocationInfo.fromJSON(object.location_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.location_name !== undefined && message.location_name !== "") { obj.location_name = message.location_name; } if (message.location_type !== undefined && message.location_type !== "") { obj.location_type = message.location_type; } if (message.location_info !== undefined) { obj.location_info = LocationInfo.toJSON(message.location_info); } return obj; }, create(base) { return BenchmarksLocation.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b; const message = createBaseBenchmarksLocation(); message.location_name = (_a = object.location_name) !== null && _a !== void 0 ? _a : ""; message.location_type = (_b = object.location_type) !== null && _b !== void 0 ? _b : ""; message.location_info = (object.location_info !== undefined && object.location_info !== null) ? LocationInfo.fromPartial(object.location_info) : undefined; return message; }, }; function createBaseListBenchmarksProductsRequest() { return { application_info: undefined }; } export const ListBenchmarksProductsRequest = { encode(message, writer = _m0.Writer.create()) { if (message.application_info !== undefined) { AdditionalApplicationInfo.encode(message.application_info, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksProductsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.application_info = AdditionalApplicationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { application_info: isSet(object.application_info) ? AdditionalApplicationInfo.fromJSON(object.application_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.application_info !== undefined) { obj.application_info = AdditionalApplicationInfo.toJSON(message.application_info); } return obj; }, create(base) { return ListBenchmarksProductsRequest.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBaseListBenchmarksProductsRequest(); message.application_info = (object.application_info !== undefined && object.application_info !== null) ? AdditionalApplicationInfo.fromPartial(object.application_info) : undefined; return message; }, }; function createBaseListBenchmarksProductsResponse() { return { benchmarks_products: [] }; } export const ListBenchmarksProductsResponse = { encode(message, writer = _m0.Writer.create()) { if (message.benchmarks_products !== undefined && message.benchmarks_products.length !== 0) { for (const v of message.benchmarks_products) { BenchmarksProductMetadata.encode(v, writer.uint32(10).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksProductsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.benchmarks_products.push(BenchmarksProductMetadata.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { benchmarks_products: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.benchmarks_products) ? object.benchmarks_products.map((e) => BenchmarksProductMetadata.fromJSON(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.benchmarks_products) === null || _a === void 0 ? void 0 : _a.length) { obj.benchmarks_products = message.benchmarks_products.map((e) => BenchmarksProductMetadata.toJSON(e)); } return obj; }, create(base) { return ListBenchmarksProductsResponse.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseListBenchmarksProductsResponse(); message.benchmarks_products = ((_a = object.benchmarks_products) === null || _a === void 0 ? void 0 : _a.map((e) => BenchmarksProductMetadata.fromPartial(e))) || []; return message; }, }; function createBaseBenchmarksProductMetadata() { return { product_name: "", product_code: "", marketing_objective: 0 }; } export const BenchmarksProductMetadata = { encode(message, writer = _m0.Writer.create()) { if (message.product_name !== undefined && message.product_name !== "") { writer.uint32(10).string(message.product_name); } if (message.product_code !== undefined && message.product_code !== "") { writer.uint32(18).string(message.product_code); } if (message.marketing_objective !== undefined && message.marketing_objective !== 0) { writer.uint32(24).int32(message.marketing_objective); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBenchmarksProductMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.product_name = reader.string(); continue; case 2: if (tag !== 18) { break; } message.product_code = reader.string(); continue; case 3: if (tag !== 24) { break; } message.marketing_objective = reader.int32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { product_name: isSet(object.product_name) ? globalThis.String(object.product_name) : "", product_code: isSet(object.product_code) ? globalThis.String(object.product_code) : "", marketing_objective: isSet(object.marketing_objective) ? benchmarksMarketingObjectiveEnum_BenchmarksMarketingObjectiveFromJSON(object.marketing_objective) : 0, }; }, toJSON(message) { const obj = {}; if (message.product_name !== undefined && message.product_name !== "") { obj.product_name = message.product_name; } if (message.product_code !== undefined && message.product_code !== "") { obj.product_code = message.product_code; } if (message.marketing_objective !== undefined && message.marketing_objective !== 0) { obj.marketing_objective = benchmarksMarketingObjectiveEnum_BenchmarksMarketingObjectiveToJSON(message.marketing_objective); } return obj; }, create(base) { return BenchmarksProductMetadata.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c; const message = createBaseBenchmarksProductMetadata(); message.product_name = (_a = object.product_name) !== null && _a !== void 0 ? _a : ""; message.product_code = (_b = object.product_code) !== null && _b !== void 0 ? _b : ""; message.marketing_objective = (_c = object.marketing_objective) !== null && _c !== void 0 ? _c : 0; return message; }, }; function createBaseListBenchmarksSourcesRequest() { return { benchmarks_sources: [], application_info: undefined }; } export const ListBenchmarksSourcesRequest = { encode(message, writer = _m0.Writer.create()) { if (message.benchmarks_sources !== undefined && message.benchmarks_sources.length !== 0) { writer.uint32(10).fork(); for (const v of message.benchmarks_sources) { writer.int32(v); } writer.ldelim(); } if (message.application_info !== undefined) { AdditionalApplicationInfo.encode(message.application_info, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksSourcesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag === 8) { message.benchmarks_sources.push(reader.int32()); continue; } if (tag === 10) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.benchmarks_sources.push(reader.int32()); } continue; } break; case 2: if (tag !== 18) { break; } message.application_info = AdditionalApplicationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { benchmarks_sources: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.benchmarks_sources) ? object.benchmarks_sources.map((e) => benchmarksSourceTypeEnum_BenchmarksSourceTypeFromJSON(e)) : [], application_info: isSet(object.application_info) ? AdditionalApplicationInfo.fromJSON(object.application_info) : undefined, }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.benchmarks_sources) === null || _a === void 0 ? void 0 : _a.length) { obj.benchmarks_sources = message.benchmarks_sources.map((e) => benchmarksSourceTypeEnum_BenchmarksSourceTypeToJSON(e)); } if (message.application_info !== undefined) { obj.application_info = AdditionalApplicationInfo.toJSON(message.application_info); } return obj; }, create(base) { return ListBenchmarksSourcesRequest.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseListBenchmarksSourcesRequest(); message.benchmarks_sources = ((_a = object.benchmarks_sources) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || []; message.application_info = (object.application_info !== undefined && object.application_info !== null) ? AdditionalApplicationInfo.fromPartial(object.application_info) : undefined; return message; }, }; function createBaseListBenchmarksSourcesResponse() { return { benchmarks_sources: [] }; } export const ListBenchmarksSourcesResponse = { encode(message, writer = _m0.Writer.create()) { if (message.benchmarks_sources !== undefined && message.benchmarks_sources.length !== 0) { for (const v of message.benchmarks_sources) { BenchmarksSourceMetadata.encode(v, writer.uint32(10).fork()).ldelim(); } } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListBenchmarksSourcesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.benchmarks_sources.push(BenchmarksSourceMetadata.decode(reader, reader.uint32())); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { benchmarks_sources: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.benchmarks_sources) ? object.benchmarks_sources.map((e) => BenchmarksSourceMetadata.fromJSON(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.benchmarks_sources) === null || _a === void 0 ? void 0 : _a.length) { obj.benchmarks_sources = message.benchmarks_sources.map((e) => BenchmarksSourceMetadata.toJSON(e)); } return obj; }, create(base) { return ListBenchmarksSourcesResponse.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseListBenchmarksSourcesResponse(); message.benchmarks_sources = ((_a = object.benchmarks_sources) === null || _a === void 0 ? void 0 : _a.map((e) => BenchmarksSourceMetadata.fromPartial(e))) || []; return message; }, }; function createBaseBenchmarksSourceMetadata() { return { benchmarks_source_type: 0, industry_vertical_info: undefined }; } export const BenchmarksSourceMetadata = { encode(message, writer = _m0.Writer.create()) { if (message.benchmarks_source_type !== undefined && message.benchmarks_source_type !== 0) { writer.uint32(8).int32(message.benchmarks_source_type); } if (message.industry_vertical_info !== undefined) { IndustryVerticalInfo.encode(message.industry_vertical_info, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBenchmarksSourceMetadata(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.benchmarks_source_type = reader.int32(); continue; case 2: if (tag !== 18) { break; } message.industry_vertical_info = IndustryVerticalInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { benchmarks_source_type: isSet(object.benchmarks_source_type) ? benchmarksSourceTypeEnum_BenchmarksSourceTypeFromJSON(object.benchmarks_source_type) : 0, industry_vertical_info: isSet(object.industry_vertical_info) ? IndustryVerticalInfo.fromJSON(object.industry_vertical_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.benchmarks_source_type !== undefined && message.benchmarks_source_type !== 0) { obj.benchmarks_source_type = benchmarksSourceTypeEnum_BenchmarksSourceTypeToJSON(message.benchmarks_source_type); } if (message.industry_vertical_info !== undefined) { obj.industry_vertical_info = IndustryVerticalInfo.toJSON(message.industry_vertical_info); } return obj; }, create(base) { return BenchmarksSourceMetadata.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseBenchmarksSourceMetadata(); message.benchmarks_source_type = (_a = object.benchmarks_source_type) !== null && _a !== void 0 ? _a : 0; message.industry_vertical_info = (object.industry_vertical_info !== undefined && object.industry_vertical_info !== null) ? IndustryVerticalInfo.fromPartial(object.industry_vertical_info) : undefined; return message; }, }; function createBaseIndustryVerticalInfo() { return { industry_vertical_name: "", industry_vertical_id: "0", parent_industry_vertical_id: "0" }; } export const IndustryVerticalInfo = { encode(message, writer = _m0.Writer.create()) { if (message.industry_vertical_name !== undefined && message.industry_vertical_name !== "") { writer.uint32(10).string(message.industry_vertical_name); } if (message.industry_vertical_id !== undefined && message.industry_vertical_id !== "0") { writer.uint32(16).int64(message.industry_vertical_id); } if (message.parent_industry_vertical_id !== undefined && message.parent_industry_vertical_id !== "0") { writer.uint32(24).int64(message.parent_industry_vertical_id); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIndustryVerticalInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.industry_vertical_name = reader.string(); continue; case 2: if (tag !== 16) { break; } message.industry_vertical_id = longToString(reader.int64()); continue; case 3: if (tag !== 24) { break; } message.parent_industry_vertical_id = longToString(reader.int64()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { industry_vertical_name: isSet(object.industry_vertical_name) ? globalThis.String(object.industry_vertical_name) : "", industry_vertical_id: isSet(object.industry_vertical_id) ? globalThis.String(object.industry_vertical_id) : "0", parent_industry_vertical_id: isSet(object.parent_industry_vertical_id) ? globalThis.String(object.parent_industry_vertical_id) : "0", }; }, toJSON(message) { const obj = {}; if (message.industry_vertical_name !== undefined && message.industry_vertical_name !== "") { obj.industry_vertical_name = message.industry_vertical_name; } if (message.industry_vertical_id !== undefined && message.industry_vertical_id !== "0") { obj.industry_vertical_id = message.industry_vertical_id; } if (message.parent_industry_vertical_id !== undefined && message.parent_industry_vertical_id !== "0") { obj.parent_industry_vertical_id = message.parent_industry_vertical_id; } return obj; }, create(base) { return IndustryVerticalInfo.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c; const message = createBaseIndustryVerticalInfo(); message.industry_vertical_name = (_a = object.industry_vertical_name) !== null && _a !== void 0 ? _a : ""; message.industry_vertical_id = (_b = object.industry_vertical_id) !== null && _b !== void 0 ? _b : "0"; message.parent_industry_vertical_id = (_c = object.parent_industry_vertical_id) !== null && _c !== void 0 ? _c : "0"; return message; }, }; function createBaseGenerateBenchmarksMetricsRequest() { return { customer_id: "", date_range: undefined, location: undefined, benchmarks_source: undefined, product_filter: undefined, breakdown_definition: undefined, currency_code: "", customer_benchmarks_group: "", application_info: undefined, }; } export const GenerateBenchmarksMetricsRequest = { encode(message, writer = _m0.Writer.create()) { if (message.customer_id !== undefined && message.customer_id !== "") { writer.uint32(10).string(message.customer_id); } if (message.date_range !== undefined) { DateRange.encode(message.date_range, writer.uint32(18).fork()).ldelim(); } if (message.location !== undefined) { LocationInfo.encode(message.location, writer.uint32(26).fork()).ldelim(); } if (message.benchmarks_source !== undefined) { BenchmarksSource.encode(message.benchmarks_source, writer.uint32(34).fork()).ldelim(); } if (message.product_filter !== undefined) { ProductFilter.encode(message.product_filter, writer.uint32(42).fork()).ldelim(); } if (message.breakdown_definition !== undefined) { BreakdownDefinition.encode(message.breakdown_definition, writer.uint32(74).fork()).ldelim(); } if (message.currency_code !== undefined && message.currency_code !== "") { writer.uint32(50).string(message.currency_code); } if (message.customer_benchmarks_group !== undefined && message.customer_benchmarks_group !== "") { writer.uint32(58).string(message.customer_benchmarks_group); } if (message.application_info !== undefined) { AdditionalApplicationInfo.encode(message.application_info, writer.uint32(66).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenerateBenchmarksMetricsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.customer_id = reader.string(); continue; case 2: if (tag !== 18) { break; } message.date_range = DateRange.decode(reader, reader.uint32()); continue; case 3: if (tag !== 26) { break; } message.location = LocationInfo.decode(reader, reader.uint32()); continue; case 4: if (tag !== 34) { break; } message.benchmarks_source = BenchmarksSource.decode(reader, reader.uint32()); continue; case 5: if (tag !== 42) { break; } message.product_filter = ProductFilter.decode(reader, reader.uint32()); continue; case 9: if (tag !== 74) { break; } message.breakdown_definition = BreakdownDefinition.decode(reader, reader.uint32()); continue; case 6: if (tag !== 50) { break; } message.currency_code = reader.string(); continue; case 7: if (tag !== 58) { break; } message.customer_benchmarks_group = reader.string(); continue; case 8: if (tag !== 66) { break; } message.application_info = AdditionalApplicationInfo.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { customer_id: isSet(object.customer_id) ? globalThis.String(object.customer_id) : "", date_range: isSet(object.date_range) ? DateRange.fromJSON(object.date_range) : undefined, location: isSet(object.location) ? LocationInfo.fromJSON(object.location) : undefined, benchmarks_source: isSet(object.benchmarks_source) ? BenchmarksSource.fromJSON(object.benchmarks_source) : undefined, product_filter: isSet(object.product_filter) ? ProductFilter.fromJSON(object.product_filter) : undefined, breakdown_definition: isSet(object.breakdown_definition) ? BreakdownDefinition.fromJSON(object.breakdown_definition) : undefined, currency_code: isSet(object.currency_code) ? globalThis.String(object.currency_code) : "", customer_benchmarks_group: isSet(object.customer_benchmarks_group) ? globalThis.String(object.customer_benchmarks_group) : "", application_info: isSet(object.application_info) ? AdditionalApplicationInfo.fromJSON(object.application_info) : undefined, }; }, toJSON(message) { const obj = {}; if (message.customer_id !== undefined && message.customer_id !== "") { obj.customer_id = message.customer_id; } if (message.date_range !== undefined) { obj.date_range = DateRange.toJSON(message.date_range); } if (message.location !== undefined) { obj.location = LocationInfo.toJSON(message.location); } if (message.benchmarks_source !== undefined) { obj.benchmarks_source = BenchmarksSource.toJSON(message.benchmarks_source); } if (message.product_filter !== undefined) { obj.product_filter = ProductFilter.toJSON(message.product_filter); } if (message.breakdown_definition !== undefined) { obj.breakdown_definition = BreakdownDefinition.toJSON(message.breakdown_definition); } if (message.currency_code !== undefined && message.currency_code !== "") { obj.currency_code = message.currency_code; } if (message.customer_benchmarks_group !== undefined && message.customer_benchmarks_group !== "") { obj.customer_benchmarks_group = message.customer_benchmarks_group; } if (message.application_info !== undefined) { obj.application_info = AdditionalApplicationInfo.toJSON(message.application_info); } return obj; }, create(base) { return GenerateBenchmarksMetricsRequest.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c; const message = createBaseGenerateBenchmarksMetricsRequest(); message.customer_id = (_a = object.customer_id) !== null && _a !== void 0 ? _a : ""; message.date_range = (object.date_range !== undefined && object.date_range !== null) ? DateRange.fromPartial(object.date_range) : undefined; message.location = (object.location !== undefined && object.location !== null) ? LocationInfo.fromPartial(object.location) : undefined; message.benchmarks_source = (object.benchmarks_source !== undefined && object.benchmarks_source !== null) ? BenchmarksSource.fromPartial(object.benchmarks_source) : undefined; message.product_filter = (object.product_filter !== undefined && object.product_filter !== null) ? ProductFilter.fromPartial(object.product_filter) : undefined; message.breakdown_definition = (object.breakdown_definition !== undefined && object.breakdown_definition !== null) ? BreakdownDefinition.fromPartial(object.breakdown_definition) : undefined; message.currency_code = (_b = object.currency_code) !== null && _b !== void 0 ? _b : ""; message.customer_benchmarks_group = (_c = object.customer_benchmarks_group) !== null && _c !== void 0 ? _c : ""; message.application_info = (object.application_info !== undefined && object.application_info !== null) ? AdditionalApplicationInfo.fromPartial(object.application_info) : undefined; return message; }, }; function createBaseBenchmarksSource() { return { industry_vertical_id: undefined }; } export const BenchmarksSource = { encode(message, writer = _m0.Writer.create()) { if (message.industry_vertical_id !== undefined) { writer.uint32(8).int64(message.industry_vertical_id); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBenchmarksSource(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.industry_vertical_id = longToString(reader.int64()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { industry_vertical_id: isSet(object.industry_vertical_id) ? globalThis.String(object.industry_vertical_id) : undefined, }; }, toJSON(message) { const obj = {}; if (message.industry_vertical_id !== undefined) { obj.industry_vertical_id = message.industry_vertical_id; } return obj; }, create(base) { return BenchmarksSource.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a; const message = createBaseBenchmarksSource(); message.industry_vertical_id = (_a = object.industry_vertical_id) !== null && _a !== void 0 ? _a : undefined; return message; }, }; function createBaseProductFilter() { return { product_list: undefined, marketing_objective_list: undefined }; } export const ProductFilter = { encode(message, writer = _m0.Writer.create()) { if (message.product_list !== undefined) { ProductFilter_ProductList.encode(message.product_list, writer.uint32(10).fork()).ldelim(); } if (message.marketing_objective_list !== undefined) { ProductFilter_MarketingObjectiveList.encode(message.marketing_objective_list, writer.uint32(18).fork()).ldelim(); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProductFilter(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.product_list = ProductFilter_ProductList.decode(reader, reader.uint32()); continue; case 2: if (tag !== 18) { break; } message.marketing_objective_list = ProductFilter_MarketingObjectiveList.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { product_list: isSet(object.product_list) ? ProductFilter_ProductList.fromJSON(object.product_list) : undefined, marketing_objective_list: isSet(object.marketing_objective_list) ? ProductFilter_MarketingObjectiveList.fromJSON(object.marketing_objective_list) : undefined, }; }, toJSON(message) { const obj = {}; if (message.product_list !== undefined) { obj.product_list = ProductFilter_ProductList.toJSON(message.product_list); } if (message.marketing_objective_list !== undefined) { obj.marketing_objective_list = ProductFilter_MarketingObjectiveList.toJSON(message.marketing_objective_list); } return obj; }, create(base) { return ProductFilter.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { const message = createBaseProductFilter(); message.product_list = (object.product_list !== undefined && object.product_list !== null) ? ProductFilter_ProductList.fromPartial(object.product_list) : undefined; message.marketing_objective_list = (object.marketing_objective_list !== undefined && object.marketing_objective_list !== null) ? ProductFilter_MarketingObjectiveList.fromPartial(object.marketing_objective_list) : undefined; return message; }, }; function createBaseProductFilter_ProductList() { return { product_codes: [] }; } export const ProductFilter_ProductList = { encode(message, writer = _m0.Writer.create()) { if (message.product_codes !== undefined && message.product_codes.length !== 0) { for (const v of message.product_codes) { writer.uint32(10).string(v); } } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProductFilter_ProductList(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.product_codes.push(reader.string()); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { product_codes: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.product_codes) ? object.product_codes.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { var _a; const obj = {}; if ((_a = message.product_codes) === null || _a === void 0 ? void 0 : _a.length) { obj.product_codes = message.product_codes; } return obj; }, create(base) { return ProductFilter_ProductList.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a;