@miradorlabs/web-grpc 3.32.0 → 3.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -448,6 +448,64 @@ export function aITokenActivityDimensionToJSON(object: AITokenActivityDimension)
448
448
  }
449
449
  }
450
450
 
451
+ /** AISpendForecastDimension mirrors telemetry.api.v1.AISpendForecastDimension. */
452
+ export enum AISpendForecastDimension {
453
+ AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED = 0,
454
+ AI_SPEND_FORECAST_DIMENSION_MODEL = 1,
455
+ AI_SPEND_FORECAST_DIMENSION_PROVIDER = 2,
456
+ AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM = 3,
457
+ AI_SPEND_FORECAST_DIMENSION_USER = 4,
458
+ AI_SPEND_FORECAST_DIMENSION_API_KEY = 5,
459
+ UNRECOGNIZED = -1,
460
+ }
461
+
462
+ export function aISpendForecastDimensionFromJSON(object: any): AISpendForecastDimension {
463
+ switch (object) {
464
+ case 0:
465
+ case "AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED":
466
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED;
467
+ case 1:
468
+ case "AI_SPEND_FORECAST_DIMENSION_MODEL":
469
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_MODEL;
470
+ case 2:
471
+ case "AI_SPEND_FORECAST_DIMENSION_PROVIDER":
472
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_PROVIDER;
473
+ case 3:
474
+ case "AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM":
475
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM;
476
+ case 4:
477
+ case "AI_SPEND_FORECAST_DIMENSION_USER":
478
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_USER;
479
+ case 5:
480
+ case "AI_SPEND_FORECAST_DIMENSION_API_KEY":
481
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_API_KEY;
482
+ case -1:
483
+ case "UNRECOGNIZED":
484
+ default:
485
+ return AISpendForecastDimension.UNRECOGNIZED;
486
+ }
487
+ }
488
+
489
+ export function aISpendForecastDimensionToJSON(object: AISpendForecastDimension): string {
490
+ switch (object) {
491
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED:
492
+ return "AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED";
493
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_MODEL:
494
+ return "AI_SPEND_FORECAST_DIMENSION_MODEL";
495
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_PROVIDER:
496
+ return "AI_SPEND_FORECAST_DIMENSION_PROVIDER";
497
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM:
498
+ return "AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM";
499
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_USER:
500
+ return "AI_SPEND_FORECAST_DIMENSION_USER";
501
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_API_KEY:
502
+ return "AI_SPEND_FORECAST_DIMENSION_API_KEY";
503
+ case AISpendForecastDimension.UNRECOGNIZED:
504
+ default:
505
+ return "UNRECOGNIZED";
506
+ }
507
+ }
508
+
451
509
  export enum AIResourceDimension {
452
510
  AI_RESOURCE_DIMENSION_UNSPECIFIED = 0,
453
511
  AI_RESOURCE_DIMENSION_SKILL = 1,
@@ -1591,6 +1649,83 @@ export interface DailyActivityMeasures {
1591
1649
  sessions: number;
1592
1650
  }
1593
1651
 
1652
+ export interface SpendForecastRequest {
1653
+ organizationId: string;
1654
+ projectId: string;
1655
+ /** Optional slice; unset forecasts the cost on every funding facility. */
1656
+ filter: SpendForecastFilter | undefined;
1657
+ }
1658
+
1659
+ /** SpendForecastFilter narrows the cost a forecast counts. An empty list does not filter. */
1660
+ export interface SpendForecastFilter {
1661
+ /**
1662
+ * OR within the list. UNKNOWN selects every cost off the three named facilities (observed-unknown, never-stamped
1663
+ * or an unrecognized facility); UNSPECIFIED is rejected.
1664
+ * [API_METERED, PREPAID_CREDITS, UNKNOWN] is the cost not drawn on a subscription facility.
1665
+ */
1666
+ fundingModes: AIFundingMode[];
1667
+ }
1668
+
1669
+ /**
1670
+ * SpendForecast mirrors telemetry.api.v1.SpendForecast, replaced wholesale each tick. Cost is notional (the
1671
+ * source's reported figure, else tokens x list price), never an invoice: an unpriced call counts 0.
1672
+ */
1673
+ export interface SpendForecast {
1674
+ /** first UTC day of the current month, YYYY-MM-DD */
1675
+ periodStart: string;
1676
+ /** last UTC day of the current month */
1677
+ periodEnd: string;
1678
+ /** provisional; its cost so far is in month_to_date_usd */
1679
+ today: string;
1680
+ /**
1681
+ * Earliest UTC day the rollup is authoritative for this project; empty when nothing is materialized. Month
1682
+ * days before it are uncomputed and not in month_to_date_usd.
1683
+ */
1684
+ coverageStart: string;
1685
+ /**
1686
+ * Complete trailing 7-day weeks (0 to 4, newest ending yesterday) the projection replays. 0 means too little
1687
+ * history, and every projection is absent.
1688
+ */
1689
+ historyWeeks: number;
1690
+ total:
1691
+ | SpendForecastMeasures
1692
+ | undefined;
1693
+ /**
1694
+ * One breakdown per AISpendForecastDimension. Each partitions total's month_to_date_usd and
1695
+ * projection.expected_usd exactly; a group's low_usd and high_usd do not sum to total's.
1696
+ */
1697
+ breakdowns: SpendForecastBreakdown[];
1698
+ asOf: Date | undefined;
1699
+ }
1700
+
1701
+ export interface SpendForecastBreakdown {
1702
+ dimension: AISpendForecastDimension;
1703
+ /** ascending by key */
1704
+ groups: SpendForecastGroup[];
1705
+ }
1706
+
1707
+ /** An empty key is cost that recorded none. */
1708
+ export interface SpendForecastGroup {
1709
+ key: string;
1710
+ measures: SpendForecastMeasures | undefined;
1711
+ }
1712
+
1713
+ export interface SpendForecastMeasures {
1714
+ monthToDateUsd: number;
1715
+ /** absent when history_weeks is 0 */
1716
+ projection: SpendProjection | undefined;
1717
+ }
1718
+
1719
+ /**
1720
+ * SpendProjection is the projected month-end total, month to date included: the mean, the quietest and the
1721
+ * busiest of the history weeks replayed weekday by weekday over the rest of the month.
1722
+ */
1723
+ export interface SpendProjection {
1724
+ expectedUsd: number;
1725
+ lowUsd: number;
1726
+ highUsd: number;
1727
+ }
1728
+
1594
1729
  export interface ActivityRhythmRequest {
1595
1730
  organizationId: string;
1596
1731
  projectId: string;
@@ -11685,28 +11820,25 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
11685
11820
  },
11686
11821
  };
11687
11822
 
11688
- function createBaseActivityRhythmRequest(): ActivityRhythmRequest {
11689
- return { organizationId: "", projectId: "", timeWindow: 0, timeZone: "" };
11823
+ function createBaseSpendForecastRequest(): SpendForecastRequest {
11824
+ return { organizationId: "", projectId: "", filter: undefined };
11690
11825
  }
11691
11826
 
11692
- export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11693
- encode(message: ActivityRhythmRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11827
+ export const SpendForecastRequest: MessageFns<SpendForecastRequest> = {
11828
+ encode(message: SpendForecastRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11694
11829
  if (message.organizationId !== "") {
11695
11830
  writer.uint32(10).string(message.organizationId);
11696
11831
  }
11697
11832
  if (message.projectId !== "") {
11698
11833
  writer.uint32(18).string(message.projectId);
11699
11834
  }
11700
- if (message.timeWindow !== 0) {
11701
- writer.uint32(24).int32(message.timeWindow);
11702
- }
11703
- if (message.timeZone !== "") {
11704
- writer.uint32(34).string(message.timeZone);
11835
+ if (message.filter !== undefined) {
11836
+ SpendForecastFilter.encode(message.filter, writer.uint32(26).fork()).join();
11705
11837
  }
11706
11838
  return writer;
11707
11839
  },
11708
11840
 
11709
- decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythmRequest {
11841
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastRequest {
11710
11842
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11711
11843
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11712
11844
  if (previousRecursionDepth >= 100) {
@@ -11715,7 +11847,7 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11715
11847
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11716
11848
  try {
11717
11849
  const end = length === undefined ? reader.len : reader.pos + length;
11718
- const message = createBaseActivityRhythmRequest();
11850
+ const message = createBaseSpendForecastRequest();
11719
11851
  while (reader.pos < end) {
11720
11852
  const tag = reader.uint32();
11721
11853
  switch (tag >>> 3) {
@@ -11736,19 +11868,11 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11736
11868
  continue;
11737
11869
  }
11738
11870
  case 3: {
11739
- if (tag !== 24) {
11740
- break;
11741
- }
11742
-
11743
- message.timeWindow = reader.int32() as any;
11744
- continue;
11745
- }
11746
- case 4: {
11747
- if (tag !== 34) {
11871
+ if (tag !== 26) {
11748
11872
  break;
11749
11873
  }
11750
11874
 
11751
- message.timeZone = reader.string();
11875
+ message.filter = SpendForecastFilter.decode(reader, reader.uint32());
11752
11876
  continue;
11753
11877
  }
11754
11878
  }
@@ -11763,7 +11887,7 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11763
11887
  }
11764
11888
  },
11765
11889
 
11766
- fromJSON(object: any): ActivityRhythmRequest {
11890
+ fromJSON(object: any): SpendForecastRequest {
11767
11891
  return {
11768
11892
  organizationId: isSet(object.organizationId)
11769
11893
  ? globalThis.String(object.organizationId)
@@ -11775,20 +11899,11 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11775
11899
  : isSet(object.project_id)
11776
11900
  ? globalThis.String(object.project_id)
11777
11901
  : "",
11778
- timeWindow: isSet(object.timeWindow)
11779
- ? analyticsTimeWindowFromJSON(object.timeWindow)
11780
- : isSet(object.time_window)
11781
- ? analyticsTimeWindowFromJSON(object.time_window)
11782
- : 0,
11783
- timeZone: isSet(object.timeZone)
11784
- ? globalThis.String(object.timeZone)
11785
- : isSet(object.time_zone)
11786
- ? globalThis.String(object.time_zone)
11787
- : "",
11902
+ filter: isSet(object.filter) ? SpendForecastFilter.fromJSON(object.filter) : undefined,
11788
11903
  };
11789
11904
  },
11790
11905
 
11791
- toJSON(message: ActivityRhythmRequest): unknown {
11906
+ toJSON(message: SpendForecastRequest): unknown {
11792
11907
  const obj: any = {};
11793
11908
  if (message.organizationId !== "") {
11794
11909
  obj.organizationId = message.organizationId;
@@ -11796,53 +11911,152 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11796
11911
  if (message.projectId !== "") {
11797
11912
  obj.projectId = message.projectId;
11798
11913
  }
11799
- if (message.timeWindow !== 0) {
11800
- obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
11801
- }
11802
- if (message.timeZone !== "") {
11803
- obj.timeZone = message.timeZone;
11914
+ if (message.filter !== undefined) {
11915
+ obj.filter = SpendForecastFilter.toJSON(message.filter);
11804
11916
  }
11805
11917
  return obj;
11806
11918
  },
11807
11919
 
11808
- create<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(base?: I): ActivityRhythmRequest {
11809
- return ActivityRhythmRequest.fromPartial(base ?? ({} as any));
11920
+ create<I extends Exact<DeepPartial<SpendForecastRequest>, I>>(base?: I): SpendForecastRequest {
11921
+ return SpendForecastRequest.fromPartial(base ?? ({} as any));
11810
11922
  },
11811
- fromPartial<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(object: I): ActivityRhythmRequest {
11812
- const message = createBaseActivityRhythmRequest();
11923
+ fromPartial<I extends Exact<DeepPartial<SpendForecastRequest>, I>>(object: I): SpendForecastRequest {
11924
+ const message = createBaseSpendForecastRequest();
11813
11925
  message.organizationId = object.organizationId ?? "";
11814
11926
  message.projectId = object.projectId ?? "";
11815
- message.timeWindow = object.timeWindow ?? 0;
11816
- message.timeZone = object.timeZone ?? "";
11927
+ message.filter = (object.filter !== undefined && object.filter !== null)
11928
+ ? SpendForecastFilter.fromPartial(object.filter)
11929
+ : undefined;
11817
11930
  return message;
11818
11931
  },
11819
11932
  };
11820
11933
 
11821
- function createBaseActivityRhythm(): ActivityRhythm {
11822
- return { buckets: [], windowStart: undefined, windowEnd: undefined, asOf: undefined, timeZone: "" };
11934
+ function createBaseSpendForecastFilter(): SpendForecastFilter {
11935
+ return { fundingModes: [] };
11823
11936
  }
11824
11937
 
11825
- export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11826
- encode(message: ActivityRhythm, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11827
- for (const v of message.buckets) {
11828
- ActivityRhythmBucket.encode(v!, writer.uint32(10).fork()).join();
11938
+ export const SpendForecastFilter: MessageFns<SpendForecastFilter> = {
11939
+ encode(message: SpendForecastFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11940
+ for (const v of message.fundingModes) {
11941
+ writer.uint32(8).int32(v!);
11829
11942
  }
11830
- if (message.windowStart !== undefined) {
11831
- Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(18).fork()).join();
11943
+ return writer;
11944
+ },
11945
+
11946
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastFilter {
11947
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11948
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11949
+ if (previousRecursionDepth >= 100) {
11950
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
11832
11951
  }
11833
- if (message.windowEnd !== undefined) {
11834
- Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(26).fork()).join();
11952
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11953
+ try {
11954
+ const end = length === undefined ? reader.len : reader.pos + length;
11955
+ const message = createBaseSpendForecastFilter();
11956
+ while (reader.pos < end) {
11957
+ const tag = reader.uint32();
11958
+ switch (tag >>> 3) {
11959
+ case 1: {
11960
+ if (tag === 8) {
11961
+ message.fundingModes.push(reader.int32() as any);
11962
+
11963
+ continue;
11964
+ }
11965
+
11966
+ if (tag === 10) {
11967
+ const end2 = reader.uint32() + reader.pos;
11968
+ while (reader.pos < end2) {
11969
+ message.fundingModes.push(reader.int32() as any);
11970
+ }
11971
+
11972
+ continue;
11973
+ }
11974
+
11975
+ break;
11976
+ }
11977
+ }
11978
+ if ((tag & 7) === 4 || tag === 0) {
11979
+ break;
11980
+ }
11981
+ reader.skip(tag & 7);
11982
+ }
11983
+ return message;
11984
+ } finally {
11985
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
11835
11986
  }
11836
- if (message.asOf !== undefined) {
11837
- Timestamp.encode(toTimestamp(message.asOf), writer.uint32(34).fork()).join();
11987
+ },
11988
+
11989
+ fromJSON(object: any): SpendForecastFilter {
11990
+ return {
11991
+ fundingModes: globalThis.Array.isArray(object?.fundingModes)
11992
+ ? object.fundingModes.map((e: any) => aIFundingModeFromJSON(e))
11993
+ : globalThis.Array.isArray(object?.funding_modes)
11994
+ ? object.funding_modes.map((e: any) => aIFundingModeFromJSON(e))
11995
+ : [],
11996
+ };
11997
+ },
11998
+
11999
+ toJSON(message: SpendForecastFilter): unknown {
12000
+ const obj: any = {};
12001
+ if (message.fundingModes?.length) {
12002
+ obj.fundingModes = message.fundingModes.map((e) => aIFundingModeToJSON(e));
11838
12003
  }
11839
- if (message.timeZone !== "") {
11840
- writer.uint32(42).string(message.timeZone);
12004
+ return obj;
12005
+ },
12006
+
12007
+ create<I extends Exact<DeepPartial<SpendForecastFilter>, I>>(base?: I): SpendForecastFilter {
12008
+ return SpendForecastFilter.fromPartial(base ?? ({} as any));
12009
+ },
12010
+ fromPartial<I extends Exact<DeepPartial<SpendForecastFilter>, I>>(object: I): SpendForecastFilter {
12011
+ const message = createBaseSpendForecastFilter();
12012
+ message.fundingModes = object.fundingModes?.map((e) => e) || [];
12013
+ return message;
12014
+ },
12015
+ };
12016
+
12017
+ function createBaseSpendForecast(): SpendForecast {
12018
+ return {
12019
+ periodStart: "",
12020
+ periodEnd: "",
12021
+ today: "",
12022
+ coverageStart: "",
12023
+ historyWeeks: 0,
12024
+ total: undefined,
12025
+ breakdowns: [],
12026
+ asOf: undefined,
12027
+ };
12028
+ }
12029
+
12030
+ export const SpendForecast: MessageFns<SpendForecast> = {
12031
+ encode(message: SpendForecast, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12032
+ if (message.periodStart !== "") {
12033
+ writer.uint32(10).string(message.periodStart);
12034
+ }
12035
+ if (message.periodEnd !== "") {
12036
+ writer.uint32(18).string(message.periodEnd);
12037
+ }
12038
+ if (message.today !== "") {
12039
+ writer.uint32(26).string(message.today);
12040
+ }
12041
+ if (message.coverageStart !== "") {
12042
+ writer.uint32(34).string(message.coverageStart);
12043
+ }
12044
+ if (message.historyWeeks !== 0) {
12045
+ writer.uint32(40).uint32(message.historyWeeks);
12046
+ }
12047
+ if (message.total !== undefined) {
12048
+ SpendForecastMeasures.encode(message.total, writer.uint32(50).fork()).join();
12049
+ }
12050
+ for (const v of message.breakdowns) {
12051
+ SpendForecastBreakdown.encode(v!, writer.uint32(58).fork()).join();
12052
+ }
12053
+ if (message.asOf !== undefined) {
12054
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(66).fork()).join();
11841
12055
  }
11842
12056
  return writer;
11843
12057
  },
11844
12058
 
11845
- decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythm {
12059
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecast {
11846
12060
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11847
12061
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11848
12062
  if (previousRecursionDepth >= 100) {
@@ -11851,7 +12065,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11851
12065
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11852
12066
  try {
11853
12067
  const end = length === undefined ? reader.len : reader.pos + length;
11854
- const message = createBaseActivityRhythm();
12068
+ const message = createBaseSpendForecast();
11855
12069
  while (reader.pos < end) {
11856
12070
  const tag = reader.uint32();
11857
12071
  switch (tag >>> 3) {
@@ -11860,7 +12074,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11860
12074
  break;
11861
12075
  }
11862
12076
 
11863
- message.buckets.push(ActivityRhythmBucket.decode(reader, reader.uint32()));
12077
+ message.periodStart = reader.string();
11864
12078
  continue;
11865
12079
  }
11866
12080
  case 2: {
@@ -11868,7 +12082,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11868
12082
  break;
11869
12083
  }
11870
12084
 
11871
- message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12085
+ message.periodEnd = reader.string();
11872
12086
  continue;
11873
12087
  }
11874
12088
  case 3: {
@@ -11876,7 +12090,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11876
12090
  break;
11877
12091
  }
11878
12092
 
11879
- message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12093
+ message.today = reader.string();
11880
12094
  continue;
11881
12095
  }
11882
12096
  case 4: {
@@ -11884,15 +12098,39 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11884
12098
  break;
11885
12099
  }
11886
12100
 
11887
- message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12101
+ message.coverageStart = reader.string();
11888
12102
  continue;
11889
12103
  }
11890
12104
  case 5: {
11891
- if (tag !== 42) {
12105
+ if (tag !== 40) {
11892
12106
  break;
11893
12107
  }
11894
12108
 
11895
- message.timeZone = reader.string();
12109
+ message.historyWeeks = reader.uint32();
12110
+ continue;
12111
+ }
12112
+ case 6: {
12113
+ if (tag !== 50) {
12114
+ break;
12115
+ }
12116
+
12117
+ message.total = SpendForecastMeasures.decode(reader, reader.uint32());
12118
+ continue;
12119
+ }
12120
+ case 7: {
12121
+ if (tag !== 58) {
12122
+ break;
12123
+ }
12124
+
12125
+ message.breakdowns.push(SpendForecastBreakdown.decode(reader, reader.uint32()));
12126
+ continue;
12127
+ }
12128
+ case 8: {
12129
+ if (tag !== 66) {
12130
+ break;
12131
+ }
12132
+
12133
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
11896
12134
  continue;
11897
12135
  }
11898
12136
  }
@@ -11907,44 +12145,727 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11907
12145
  }
11908
12146
  },
11909
12147
 
11910
- fromJSON(object: any): ActivityRhythm {
12148
+ fromJSON(object: any): SpendForecast {
11911
12149
  return {
11912
- buckets: globalThis.Array.isArray(object?.buckets)
11913
- ? object.buckets.map((e: any) => ActivityRhythmBucket.fromJSON(e))
12150
+ periodStart: isSet(object.periodStart)
12151
+ ? globalThis.String(object.periodStart)
12152
+ : isSet(object.period_start)
12153
+ ? globalThis.String(object.period_start)
12154
+ : "",
12155
+ periodEnd: isSet(object.periodEnd)
12156
+ ? globalThis.String(object.periodEnd)
12157
+ : isSet(object.period_end)
12158
+ ? globalThis.String(object.period_end)
12159
+ : "",
12160
+ today: isSet(object.today) ? globalThis.String(object.today) : "",
12161
+ coverageStart: isSet(object.coverageStart)
12162
+ ? globalThis.String(object.coverageStart)
12163
+ : isSet(object.coverage_start)
12164
+ ? globalThis.String(object.coverage_start)
12165
+ : "",
12166
+ historyWeeks: isSet(object.historyWeeks)
12167
+ ? globalThis.Number(object.historyWeeks)
12168
+ : isSet(object.history_weeks)
12169
+ ? globalThis.Number(object.history_weeks)
12170
+ : 0,
12171
+ total: isSet(object.total) ? SpendForecastMeasures.fromJSON(object.total) : undefined,
12172
+ breakdowns: globalThis.Array.isArray(object?.breakdowns)
12173
+ ? object.breakdowns.map((e: any) => SpendForecastBreakdown.fromJSON(e))
11914
12174
  : [],
11915
- windowStart: isSet(object.windowStart)
11916
- ? fromJsonTimestamp(object.windowStart)
11917
- : isSet(object.window_start)
11918
- ? fromJsonTimestamp(object.window_start)
11919
- : undefined,
11920
- windowEnd: isSet(object.windowEnd)
11921
- ? fromJsonTimestamp(object.windowEnd)
11922
- : isSet(object.window_end)
11923
- ? fromJsonTimestamp(object.window_end)
11924
- : undefined,
11925
12175
  asOf: isSet(object.asOf)
11926
12176
  ? fromJsonTimestamp(object.asOf)
11927
12177
  : isSet(object.as_of)
11928
12178
  ? fromJsonTimestamp(object.as_of)
11929
12179
  : undefined,
11930
- timeZone: isSet(object.timeZone)
11931
- ? globalThis.String(object.timeZone)
11932
- : isSet(object.time_zone)
11933
- ? globalThis.String(object.time_zone)
11934
- : "",
11935
12180
  };
11936
12181
  },
11937
12182
 
11938
- toJSON(message: ActivityRhythm): unknown {
12183
+ toJSON(message: SpendForecast): unknown {
11939
12184
  const obj: any = {};
11940
- if (message.buckets?.length) {
11941
- obj.buckets = message.buckets.map((e) => ActivityRhythmBucket.toJSON(e));
12185
+ if (message.periodStart !== "") {
12186
+ obj.periodStart = message.periodStart;
11942
12187
  }
11943
- if (message.windowStart !== undefined) {
11944
- obj.windowStart = message.windowStart.toISOString();
12188
+ if (message.periodEnd !== "") {
12189
+ obj.periodEnd = message.periodEnd;
11945
12190
  }
11946
- if (message.windowEnd !== undefined) {
11947
- obj.windowEnd = message.windowEnd.toISOString();
12191
+ if (message.today !== "") {
12192
+ obj.today = message.today;
12193
+ }
12194
+ if (message.coverageStart !== "") {
12195
+ obj.coverageStart = message.coverageStart;
12196
+ }
12197
+ if (message.historyWeeks !== 0) {
12198
+ obj.historyWeeks = Math.round(message.historyWeeks);
12199
+ }
12200
+ if (message.total !== undefined) {
12201
+ obj.total = SpendForecastMeasures.toJSON(message.total);
12202
+ }
12203
+ if (message.breakdowns?.length) {
12204
+ obj.breakdowns = message.breakdowns.map((e) => SpendForecastBreakdown.toJSON(e));
12205
+ }
12206
+ if (message.asOf !== undefined) {
12207
+ obj.asOf = message.asOf.toISOString();
12208
+ }
12209
+ return obj;
12210
+ },
12211
+
12212
+ create<I extends Exact<DeepPartial<SpendForecast>, I>>(base?: I): SpendForecast {
12213
+ return SpendForecast.fromPartial(base ?? ({} as any));
12214
+ },
12215
+ fromPartial<I extends Exact<DeepPartial<SpendForecast>, I>>(object: I): SpendForecast {
12216
+ const message = createBaseSpendForecast();
12217
+ message.periodStart = object.periodStart ?? "";
12218
+ message.periodEnd = object.periodEnd ?? "";
12219
+ message.today = object.today ?? "";
12220
+ message.coverageStart = object.coverageStart ?? "";
12221
+ message.historyWeeks = object.historyWeeks ?? 0;
12222
+ message.total = (object.total !== undefined && object.total !== null)
12223
+ ? SpendForecastMeasures.fromPartial(object.total)
12224
+ : undefined;
12225
+ message.breakdowns = object.breakdowns?.map((e) => SpendForecastBreakdown.fromPartial(e)) || [];
12226
+ message.asOf = object.asOf ?? undefined;
12227
+ return message;
12228
+ },
12229
+ };
12230
+
12231
+ function createBaseSpendForecastBreakdown(): SpendForecastBreakdown {
12232
+ return { dimension: 0, groups: [] };
12233
+ }
12234
+
12235
+ export const SpendForecastBreakdown: MessageFns<SpendForecastBreakdown> = {
12236
+ encode(message: SpendForecastBreakdown, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12237
+ if (message.dimension !== 0) {
12238
+ writer.uint32(8).int32(message.dimension);
12239
+ }
12240
+ for (const v of message.groups) {
12241
+ SpendForecastGroup.encode(v!, writer.uint32(18).fork()).join();
12242
+ }
12243
+ return writer;
12244
+ },
12245
+
12246
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastBreakdown {
12247
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12248
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12249
+ if (previousRecursionDepth >= 100) {
12250
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12251
+ }
12252
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12253
+ try {
12254
+ const end = length === undefined ? reader.len : reader.pos + length;
12255
+ const message = createBaseSpendForecastBreakdown();
12256
+ while (reader.pos < end) {
12257
+ const tag = reader.uint32();
12258
+ switch (tag >>> 3) {
12259
+ case 1: {
12260
+ if (tag !== 8) {
12261
+ break;
12262
+ }
12263
+
12264
+ message.dimension = reader.int32() as any;
12265
+ continue;
12266
+ }
12267
+ case 2: {
12268
+ if (tag !== 18) {
12269
+ break;
12270
+ }
12271
+
12272
+ message.groups.push(SpendForecastGroup.decode(reader, reader.uint32()));
12273
+ continue;
12274
+ }
12275
+ }
12276
+ if ((tag & 7) === 4 || tag === 0) {
12277
+ break;
12278
+ }
12279
+ reader.skip(tag & 7);
12280
+ }
12281
+ return message;
12282
+ } finally {
12283
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12284
+ }
12285
+ },
12286
+
12287
+ fromJSON(object: any): SpendForecastBreakdown {
12288
+ return {
12289
+ dimension: isSet(object.dimension) ? aISpendForecastDimensionFromJSON(object.dimension) : 0,
12290
+ groups: globalThis.Array.isArray(object?.groups)
12291
+ ? object.groups.map((e: any) => SpendForecastGroup.fromJSON(e))
12292
+ : [],
12293
+ };
12294
+ },
12295
+
12296
+ toJSON(message: SpendForecastBreakdown): unknown {
12297
+ const obj: any = {};
12298
+ if (message.dimension !== 0) {
12299
+ obj.dimension = aISpendForecastDimensionToJSON(message.dimension);
12300
+ }
12301
+ if (message.groups?.length) {
12302
+ obj.groups = message.groups.map((e) => SpendForecastGroup.toJSON(e));
12303
+ }
12304
+ return obj;
12305
+ },
12306
+
12307
+ create<I extends Exact<DeepPartial<SpendForecastBreakdown>, I>>(base?: I): SpendForecastBreakdown {
12308
+ return SpendForecastBreakdown.fromPartial(base ?? ({} as any));
12309
+ },
12310
+ fromPartial<I extends Exact<DeepPartial<SpendForecastBreakdown>, I>>(object: I): SpendForecastBreakdown {
12311
+ const message = createBaseSpendForecastBreakdown();
12312
+ message.dimension = object.dimension ?? 0;
12313
+ message.groups = object.groups?.map((e) => SpendForecastGroup.fromPartial(e)) || [];
12314
+ return message;
12315
+ },
12316
+ };
12317
+
12318
+ function createBaseSpendForecastGroup(): SpendForecastGroup {
12319
+ return { key: "", measures: undefined };
12320
+ }
12321
+
12322
+ export const SpendForecastGroup: MessageFns<SpendForecastGroup> = {
12323
+ encode(message: SpendForecastGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12324
+ if (message.key !== "") {
12325
+ writer.uint32(10).string(message.key);
12326
+ }
12327
+ if (message.measures !== undefined) {
12328
+ SpendForecastMeasures.encode(message.measures, writer.uint32(18).fork()).join();
12329
+ }
12330
+ return writer;
12331
+ },
12332
+
12333
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastGroup {
12334
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12335
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12336
+ if (previousRecursionDepth >= 100) {
12337
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12338
+ }
12339
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12340
+ try {
12341
+ const end = length === undefined ? reader.len : reader.pos + length;
12342
+ const message = createBaseSpendForecastGroup();
12343
+ while (reader.pos < end) {
12344
+ const tag = reader.uint32();
12345
+ switch (tag >>> 3) {
12346
+ case 1: {
12347
+ if (tag !== 10) {
12348
+ break;
12349
+ }
12350
+
12351
+ message.key = reader.string();
12352
+ continue;
12353
+ }
12354
+ case 2: {
12355
+ if (tag !== 18) {
12356
+ break;
12357
+ }
12358
+
12359
+ message.measures = SpendForecastMeasures.decode(reader, reader.uint32());
12360
+ continue;
12361
+ }
12362
+ }
12363
+ if ((tag & 7) === 4 || tag === 0) {
12364
+ break;
12365
+ }
12366
+ reader.skip(tag & 7);
12367
+ }
12368
+ return message;
12369
+ } finally {
12370
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12371
+ }
12372
+ },
12373
+
12374
+ fromJSON(object: any): SpendForecastGroup {
12375
+ return {
12376
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
12377
+ measures: isSet(object.measures) ? SpendForecastMeasures.fromJSON(object.measures) : undefined,
12378
+ };
12379
+ },
12380
+
12381
+ toJSON(message: SpendForecastGroup): unknown {
12382
+ const obj: any = {};
12383
+ if (message.key !== "") {
12384
+ obj.key = message.key;
12385
+ }
12386
+ if (message.measures !== undefined) {
12387
+ obj.measures = SpendForecastMeasures.toJSON(message.measures);
12388
+ }
12389
+ return obj;
12390
+ },
12391
+
12392
+ create<I extends Exact<DeepPartial<SpendForecastGroup>, I>>(base?: I): SpendForecastGroup {
12393
+ return SpendForecastGroup.fromPartial(base ?? ({} as any));
12394
+ },
12395
+ fromPartial<I extends Exact<DeepPartial<SpendForecastGroup>, I>>(object: I): SpendForecastGroup {
12396
+ const message = createBaseSpendForecastGroup();
12397
+ message.key = object.key ?? "";
12398
+ message.measures = (object.measures !== undefined && object.measures !== null)
12399
+ ? SpendForecastMeasures.fromPartial(object.measures)
12400
+ : undefined;
12401
+ return message;
12402
+ },
12403
+ };
12404
+
12405
+ function createBaseSpendForecastMeasures(): SpendForecastMeasures {
12406
+ return { monthToDateUsd: 0, projection: undefined };
12407
+ }
12408
+
12409
+ export const SpendForecastMeasures: MessageFns<SpendForecastMeasures> = {
12410
+ encode(message: SpendForecastMeasures, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12411
+ if (message.monthToDateUsd !== 0) {
12412
+ writer.uint32(9).double(message.monthToDateUsd);
12413
+ }
12414
+ if (message.projection !== undefined) {
12415
+ SpendProjection.encode(message.projection, writer.uint32(18).fork()).join();
12416
+ }
12417
+ return writer;
12418
+ },
12419
+
12420
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastMeasures {
12421
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12422
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12423
+ if (previousRecursionDepth >= 100) {
12424
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12425
+ }
12426
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12427
+ try {
12428
+ const end = length === undefined ? reader.len : reader.pos + length;
12429
+ const message = createBaseSpendForecastMeasures();
12430
+ while (reader.pos < end) {
12431
+ const tag = reader.uint32();
12432
+ switch (tag >>> 3) {
12433
+ case 1: {
12434
+ if (tag !== 9) {
12435
+ break;
12436
+ }
12437
+
12438
+ message.monthToDateUsd = reader.double();
12439
+ continue;
12440
+ }
12441
+ case 2: {
12442
+ if (tag !== 18) {
12443
+ break;
12444
+ }
12445
+
12446
+ message.projection = SpendProjection.decode(reader, reader.uint32());
12447
+ continue;
12448
+ }
12449
+ }
12450
+ if ((tag & 7) === 4 || tag === 0) {
12451
+ break;
12452
+ }
12453
+ reader.skip(tag & 7);
12454
+ }
12455
+ return message;
12456
+ } finally {
12457
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12458
+ }
12459
+ },
12460
+
12461
+ fromJSON(object: any): SpendForecastMeasures {
12462
+ return {
12463
+ monthToDateUsd: isSet(object.monthToDateUsd)
12464
+ ? globalThis.Number(object.monthToDateUsd)
12465
+ : isSet(object.month_to_date_usd)
12466
+ ? globalThis.Number(object.month_to_date_usd)
12467
+ : 0,
12468
+ projection: isSet(object.projection) ? SpendProjection.fromJSON(object.projection) : undefined,
12469
+ };
12470
+ },
12471
+
12472
+ toJSON(message: SpendForecastMeasures): unknown {
12473
+ const obj: any = {};
12474
+ if (message.monthToDateUsd !== 0) {
12475
+ obj.monthToDateUsd = floatToJson(message.monthToDateUsd);
12476
+ }
12477
+ if (message.projection !== undefined) {
12478
+ obj.projection = SpendProjection.toJSON(message.projection);
12479
+ }
12480
+ return obj;
12481
+ },
12482
+
12483
+ create<I extends Exact<DeepPartial<SpendForecastMeasures>, I>>(base?: I): SpendForecastMeasures {
12484
+ return SpendForecastMeasures.fromPartial(base ?? ({} as any));
12485
+ },
12486
+ fromPartial<I extends Exact<DeepPartial<SpendForecastMeasures>, I>>(object: I): SpendForecastMeasures {
12487
+ const message = createBaseSpendForecastMeasures();
12488
+ message.monthToDateUsd = object.monthToDateUsd ?? 0;
12489
+ message.projection = (object.projection !== undefined && object.projection !== null)
12490
+ ? SpendProjection.fromPartial(object.projection)
12491
+ : undefined;
12492
+ return message;
12493
+ },
12494
+ };
12495
+
12496
+ function createBaseSpendProjection(): SpendProjection {
12497
+ return { expectedUsd: 0, lowUsd: 0, highUsd: 0 };
12498
+ }
12499
+
12500
+ export const SpendProjection: MessageFns<SpendProjection> = {
12501
+ encode(message: SpendProjection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12502
+ if (message.expectedUsd !== 0) {
12503
+ writer.uint32(9).double(message.expectedUsd);
12504
+ }
12505
+ if (message.lowUsd !== 0) {
12506
+ writer.uint32(17).double(message.lowUsd);
12507
+ }
12508
+ if (message.highUsd !== 0) {
12509
+ writer.uint32(25).double(message.highUsd);
12510
+ }
12511
+ return writer;
12512
+ },
12513
+
12514
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendProjection {
12515
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12516
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12517
+ if (previousRecursionDepth >= 100) {
12518
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12519
+ }
12520
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12521
+ try {
12522
+ const end = length === undefined ? reader.len : reader.pos + length;
12523
+ const message = createBaseSpendProjection();
12524
+ while (reader.pos < end) {
12525
+ const tag = reader.uint32();
12526
+ switch (tag >>> 3) {
12527
+ case 1: {
12528
+ if (tag !== 9) {
12529
+ break;
12530
+ }
12531
+
12532
+ message.expectedUsd = reader.double();
12533
+ continue;
12534
+ }
12535
+ case 2: {
12536
+ if (tag !== 17) {
12537
+ break;
12538
+ }
12539
+
12540
+ message.lowUsd = reader.double();
12541
+ continue;
12542
+ }
12543
+ case 3: {
12544
+ if (tag !== 25) {
12545
+ break;
12546
+ }
12547
+
12548
+ message.highUsd = reader.double();
12549
+ continue;
12550
+ }
12551
+ }
12552
+ if ((tag & 7) === 4 || tag === 0) {
12553
+ break;
12554
+ }
12555
+ reader.skip(tag & 7);
12556
+ }
12557
+ return message;
12558
+ } finally {
12559
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12560
+ }
12561
+ },
12562
+
12563
+ fromJSON(object: any): SpendProjection {
12564
+ return {
12565
+ expectedUsd: isSet(object.expectedUsd)
12566
+ ? globalThis.Number(object.expectedUsd)
12567
+ : isSet(object.expected_usd)
12568
+ ? globalThis.Number(object.expected_usd)
12569
+ : 0,
12570
+ lowUsd: isSet(object.lowUsd)
12571
+ ? globalThis.Number(object.lowUsd)
12572
+ : isSet(object.low_usd)
12573
+ ? globalThis.Number(object.low_usd)
12574
+ : 0,
12575
+ highUsd: isSet(object.highUsd)
12576
+ ? globalThis.Number(object.highUsd)
12577
+ : isSet(object.high_usd)
12578
+ ? globalThis.Number(object.high_usd)
12579
+ : 0,
12580
+ };
12581
+ },
12582
+
12583
+ toJSON(message: SpendProjection): unknown {
12584
+ const obj: any = {};
12585
+ if (message.expectedUsd !== 0) {
12586
+ obj.expectedUsd = floatToJson(message.expectedUsd);
12587
+ }
12588
+ if (message.lowUsd !== 0) {
12589
+ obj.lowUsd = floatToJson(message.lowUsd);
12590
+ }
12591
+ if (message.highUsd !== 0) {
12592
+ obj.highUsd = floatToJson(message.highUsd);
12593
+ }
12594
+ return obj;
12595
+ },
12596
+
12597
+ create<I extends Exact<DeepPartial<SpendProjection>, I>>(base?: I): SpendProjection {
12598
+ return SpendProjection.fromPartial(base ?? ({} as any));
12599
+ },
12600
+ fromPartial<I extends Exact<DeepPartial<SpendProjection>, I>>(object: I): SpendProjection {
12601
+ const message = createBaseSpendProjection();
12602
+ message.expectedUsd = object.expectedUsd ?? 0;
12603
+ message.lowUsd = object.lowUsd ?? 0;
12604
+ message.highUsd = object.highUsd ?? 0;
12605
+ return message;
12606
+ },
12607
+ };
12608
+
12609
+ function createBaseActivityRhythmRequest(): ActivityRhythmRequest {
12610
+ return { organizationId: "", projectId: "", timeWindow: 0, timeZone: "" };
12611
+ }
12612
+
12613
+ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
12614
+ encode(message: ActivityRhythmRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12615
+ if (message.organizationId !== "") {
12616
+ writer.uint32(10).string(message.organizationId);
12617
+ }
12618
+ if (message.projectId !== "") {
12619
+ writer.uint32(18).string(message.projectId);
12620
+ }
12621
+ if (message.timeWindow !== 0) {
12622
+ writer.uint32(24).int32(message.timeWindow);
12623
+ }
12624
+ if (message.timeZone !== "") {
12625
+ writer.uint32(34).string(message.timeZone);
12626
+ }
12627
+ return writer;
12628
+ },
12629
+
12630
+ decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythmRequest {
12631
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12632
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12633
+ if (previousRecursionDepth >= 100) {
12634
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12635
+ }
12636
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12637
+ try {
12638
+ const end = length === undefined ? reader.len : reader.pos + length;
12639
+ const message = createBaseActivityRhythmRequest();
12640
+ while (reader.pos < end) {
12641
+ const tag = reader.uint32();
12642
+ switch (tag >>> 3) {
12643
+ case 1: {
12644
+ if (tag !== 10) {
12645
+ break;
12646
+ }
12647
+
12648
+ message.organizationId = reader.string();
12649
+ continue;
12650
+ }
12651
+ case 2: {
12652
+ if (tag !== 18) {
12653
+ break;
12654
+ }
12655
+
12656
+ message.projectId = reader.string();
12657
+ continue;
12658
+ }
12659
+ case 3: {
12660
+ if (tag !== 24) {
12661
+ break;
12662
+ }
12663
+
12664
+ message.timeWindow = reader.int32() as any;
12665
+ continue;
12666
+ }
12667
+ case 4: {
12668
+ if (tag !== 34) {
12669
+ break;
12670
+ }
12671
+
12672
+ message.timeZone = reader.string();
12673
+ continue;
12674
+ }
12675
+ }
12676
+ if ((tag & 7) === 4 || tag === 0) {
12677
+ break;
12678
+ }
12679
+ reader.skip(tag & 7);
12680
+ }
12681
+ return message;
12682
+ } finally {
12683
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12684
+ }
12685
+ },
12686
+
12687
+ fromJSON(object: any): ActivityRhythmRequest {
12688
+ return {
12689
+ organizationId: isSet(object.organizationId)
12690
+ ? globalThis.String(object.organizationId)
12691
+ : isSet(object.organization_id)
12692
+ ? globalThis.String(object.organization_id)
12693
+ : "",
12694
+ projectId: isSet(object.projectId)
12695
+ ? globalThis.String(object.projectId)
12696
+ : isSet(object.project_id)
12697
+ ? globalThis.String(object.project_id)
12698
+ : "",
12699
+ timeWindow: isSet(object.timeWindow)
12700
+ ? analyticsTimeWindowFromJSON(object.timeWindow)
12701
+ : isSet(object.time_window)
12702
+ ? analyticsTimeWindowFromJSON(object.time_window)
12703
+ : 0,
12704
+ timeZone: isSet(object.timeZone)
12705
+ ? globalThis.String(object.timeZone)
12706
+ : isSet(object.time_zone)
12707
+ ? globalThis.String(object.time_zone)
12708
+ : "",
12709
+ };
12710
+ },
12711
+
12712
+ toJSON(message: ActivityRhythmRequest): unknown {
12713
+ const obj: any = {};
12714
+ if (message.organizationId !== "") {
12715
+ obj.organizationId = message.organizationId;
12716
+ }
12717
+ if (message.projectId !== "") {
12718
+ obj.projectId = message.projectId;
12719
+ }
12720
+ if (message.timeWindow !== 0) {
12721
+ obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
12722
+ }
12723
+ if (message.timeZone !== "") {
12724
+ obj.timeZone = message.timeZone;
12725
+ }
12726
+ return obj;
12727
+ },
12728
+
12729
+ create<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(base?: I): ActivityRhythmRequest {
12730
+ return ActivityRhythmRequest.fromPartial(base ?? ({} as any));
12731
+ },
12732
+ fromPartial<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(object: I): ActivityRhythmRequest {
12733
+ const message = createBaseActivityRhythmRequest();
12734
+ message.organizationId = object.organizationId ?? "";
12735
+ message.projectId = object.projectId ?? "";
12736
+ message.timeWindow = object.timeWindow ?? 0;
12737
+ message.timeZone = object.timeZone ?? "";
12738
+ return message;
12739
+ },
12740
+ };
12741
+
12742
+ function createBaseActivityRhythm(): ActivityRhythm {
12743
+ return { buckets: [], windowStart: undefined, windowEnd: undefined, asOf: undefined, timeZone: "" };
12744
+ }
12745
+
12746
+ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
12747
+ encode(message: ActivityRhythm, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12748
+ for (const v of message.buckets) {
12749
+ ActivityRhythmBucket.encode(v!, writer.uint32(10).fork()).join();
12750
+ }
12751
+ if (message.windowStart !== undefined) {
12752
+ Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(18).fork()).join();
12753
+ }
12754
+ if (message.windowEnd !== undefined) {
12755
+ Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(26).fork()).join();
12756
+ }
12757
+ if (message.asOf !== undefined) {
12758
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(34).fork()).join();
12759
+ }
12760
+ if (message.timeZone !== "") {
12761
+ writer.uint32(42).string(message.timeZone);
12762
+ }
12763
+ return writer;
12764
+ },
12765
+
12766
+ decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythm {
12767
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12768
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12769
+ if (previousRecursionDepth >= 100) {
12770
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12771
+ }
12772
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12773
+ try {
12774
+ const end = length === undefined ? reader.len : reader.pos + length;
12775
+ const message = createBaseActivityRhythm();
12776
+ while (reader.pos < end) {
12777
+ const tag = reader.uint32();
12778
+ switch (tag >>> 3) {
12779
+ case 1: {
12780
+ if (tag !== 10) {
12781
+ break;
12782
+ }
12783
+
12784
+ message.buckets.push(ActivityRhythmBucket.decode(reader, reader.uint32()));
12785
+ continue;
12786
+ }
12787
+ case 2: {
12788
+ if (tag !== 18) {
12789
+ break;
12790
+ }
12791
+
12792
+ message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12793
+ continue;
12794
+ }
12795
+ case 3: {
12796
+ if (tag !== 26) {
12797
+ break;
12798
+ }
12799
+
12800
+ message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12801
+ continue;
12802
+ }
12803
+ case 4: {
12804
+ if (tag !== 34) {
12805
+ break;
12806
+ }
12807
+
12808
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12809
+ continue;
12810
+ }
12811
+ case 5: {
12812
+ if (tag !== 42) {
12813
+ break;
12814
+ }
12815
+
12816
+ message.timeZone = reader.string();
12817
+ continue;
12818
+ }
12819
+ }
12820
+ if ((tag & 7) === 4 || tag === 0) {
12821
+ break;
12822
+ }
12823
+ reader.skip(tag & 7);
12824
+ }
12825
+ return message;
12826
+ } finally {
12827
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12828
+ }
12829
+ },
12830
+
12831
+ fromJSON(object: any): ActivityRhythm {
12832
+ return {
12833
+ buckets: globalThis.Array.isArray(object?.buckets)
12834
+ ? object.buckets.map((e: any) => ActivityRhythmBucket.fromJSON(e))
12835
+ : [],
12836
+ windowStart: isSet(object.windowStart)
12837
+ ? fromJsonTimestamp(object.windowStart)
12838
+ : isSet(object.window_start)
12839
+ ? fromJsonTimestamp(object.window_start)
12840
+ : undefined,
12841
+ windowEnd: isSet(object.windowEnd)
12842
+ ? fromJsonTimestamp(object.windowEnd)
12843
+ : isSet(object.window_end)
12844
+ ? fromJsonTimestamp(object.window_end)
12845
+ : undefined,
12846
+ asOf: isSet(object.asOf)
12847
+ ? fromJsonTimestamp(object.asOf)
12848
+ : isSet(object.as_of)
12849
+ ? fromJsonTimestamp(object.as_of)
12850
+ : undefined,
12851
+ timeZone: isSet(object.timeZone)
12852
+ ? globalThis.String(object.timeZone)
12853
+ : isSet(object.time_zone)
12854
+ ? globalThis.String(object.time_zone)
12855
+ : "",
12856
+ };
12857
+ },
12858
+
12859
+ toJSON(message: ActivityRhythm): unknown {
12860
+ const obj: any = {};
12861
+ if (message.buckets?.length) {
12862
+ obj.buckets = message.buckets.map((e) => ActivityRhythmBucket.toJSON(e));
12863
+ }
12864
+ if (message.windowStart !== undefined) {
12865
+ obj.windowStart = message.windowStart.toISOString();
12866
+ }
12867
+ if (message.windowEnd !== undefined) {
12868
+ obj.windowEnd = message.windowEnd.toISOString();
11948
12869
  }
11949
12870
  if (message.asOf !== undefined) {
11950
12871
  obj.asOf = message.asOf.toISOString();
@@ -20817,6 +21738,13 @@ export interface AIGatewayService {
20817
21738
  * omitted; today is provisional.
20818
21739
  */
20819
21740
  StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
21741
+ /**
21742
+ * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
21743
+ * replaying recent weeks), for the project and per model, provider, source system, user and api key, off the
21744
+ * same daily rollup as StreamDailyActivity; filter.funding_modes forecasts the cost on the listed funding modes. Mirrors
21745
+ * telemetry.api.v1.
21746
+ */
21747
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
20820
21748
  /**
20821
21749
  * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
20822
21750
  * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
@@ -20903,6 +21831,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
20903
21831
  this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
20904
21832
  this.StreamBurnRate = this.StreamBurnRate.bind(this);
20905
21833
  this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
21834
+ this.StreamSpendForecast = this.StreamSpendForecast.bind(this);
20906
21835
  this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
20907
21836
  this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
20908
21837
  this.StreamProjectSummaries = this.StreamProjectSummaries.bind(this);
@@ -21000,6 +21929,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
21000
21929
  return result.pipe(map((data) => DailyActivity.decode(new BinaryReader(data))));
21001
21930
  }
21002
21931
 
21932
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast> {
21933
+ const data = SpendForecastRequest.encode(request).finish();
21934
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSpendForecast", data, metadata);
21935
+ return result.pipe(map((data) => SpendForecast.decode(new BinaryReader(data))));
21936
+ }
21937
+
21003
21938
  StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm> {
21004
21939
  const data = ActivityRhythmRequest.encode(request).finish();
21005
21940
  const result = this.rpc.serverStreamingRequest(this.service, "StreamActivityRhythm", data, metadata);