-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathagentsinsightsv2response.py
More file actions
157 lines (131 loc) · 5.83 KB
/
agentsinsightsv2response.py
File metadata and controls
157 lines (131 loc) · 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .agentstimesavedinsight import (
AgentsTimeSavedInsight,
AgentsTimeSavedInsightTypedDict,
)
from .agentsusagebydepartmentinsight import (
AgentsUsageByDepartmentInsight,
AgentsUsageByDepartmentInsightTypedDict,
)
from .agentusersinsight import AgentUsersInsight, AgentUsersInsightTypedDict
from .labeledcountinfo import LabeledCountInfo, LabeledCountInfoTypedDict
from .peragentinsight import PerAgentInsight, PerAgentInsightTypedDict
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class AgentsInsightsV2ResponseTypedDict(TypedDict):
monthly_active_users: NotRequired[int]
r"""Number of current Monthly Active Users, in the specified departments."""
weekly_active_users: NotRequired[int]
r"""Number of current Weekly Active Users, in the specified departments."""
monthly_active_user_timeseries: NotRequired[LabeledCountInfoTypedDict]
weekly_active_user_timeseries: NotRequired[LabeledCountInfoTypedDict]
daily_active_user_timeseries: NotRequired[LabeledCountInfoTypedDict]
shared_agents_count: NotRequired[int]
r"""Total number of shared agents."""
top_agents_insights: NotRequired[List[PerAgentInsightTypedDict]]
agents_usage_by_department_insights: NotRequired[
List[AgentsUsageByDepartmentInsightTypedDict]
]
agent_users_insights: NotRequired[List[AgentUsersInsightTypedDict]]
agents_time_saved_insights: NotRequired[List[AgentsTimeSavedInsightTypedDict]]
r"""Insights for agents time saved over the specified time period."""
daily_agent_runs_timeseries: NotRequired[LabeledCountInfoTypedDict]
successful_runs_timeseries: NotRequired[LabeledCountInfoTypedDict]
failed_runs_timeseries: NotRequired[LabeledCountInfoTypedDict]
paused_runs_timeseries: NotRequired[LabeledCountInfoTypedDict]
upvotes_timeseries: NotRequired[LabeledCountInfoTypedDict]
downvotes_timeseries: NotRequired[LabeledCountInfoTypedDict]
class AgentsInsightsV2Response(BaseModel):
monthly_active_users: Annotated[
Optional[int], pydantic.Field(alias="monthlyActiveUsers")
] = None
r"""Number of current Monthly Active Users, in the specified departments."""
weekly_active_users: Annotated[
Optional[int], pydantic.Field(alias="weeklyActiveUsers")
] = None
r"""Number of current Weekly Active Users, in the specified departments."""
monthly_active_user_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="monthlyActiveUserTimeseries")
] = None
weekly_active_user_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="weeklyActiveUserTimeseries")
] = None
daily_active_user_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="dailyActiveUserTimeseries")
] = None
shared_agents_count: Annotated[
Optional[int], pydantic.Field(alias="sharedAgentsCount")
] = None
r"""Total number of shared agents."""
top_agents_insights: Annotated[
Optional[List[PerAgentInsight]], pydantic.Field(alias="topAgentsInsights")
] = None
agents_usage_by_department_insights: Annotated[
Optional[List[AgentsUsageByDepartmentInsight]],
pydantic.Field(alias="agentsUsageByDepartmentInsights"),
] = None
agent_users_insights: Annotated[
Optional[List[AgentUsersInsight]], pydantic.Field(alias="agentUsersInsights")
] = None
agents_time_saved_insights: Annotated[
Optional[List[AgentsTimeSavedInsight]],
pydantic.Field(alias="agentsTimeSavedInsights"),
] = None
r"""Insights for agents time saved over the specified time period."""
daily_agent_runs_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="dailyAgentRunsTimeseries")
] = None
successful_runs_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="successfulRunsTimeseries")
] = None
failed_runs_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="failedRunsTimeseries")
] = None
paused_runs_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="pausedRunsTimeseries")
] = None
upvotes_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="upvotesTimeseries")
] = None
downvotes_timeseries: Annotated[
Optional[LabeledCountInfo], pydantic.Field(alias="downvotesTimeseries")
] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
[
"monthlyActiveUsers",
"weeklyActiveUsers",
"monthlyActiveUserTimeseries",
"weeklyActiveUserTimeseries",
"dailyActiveUserTimeseries",
"sharedAgentsCount",
"topAgentsInsights",
"agentsUsageByDepartmentInsights",
"agentUsersInsights",
"agentsTimeSavedInsights",
"dailyAgentRunsTimeseries",
"successfulRunsTimeseries",
"failedRunsTimeseries",
"pausedRunsTimeseries",
"upvotesTimeseries",
"downvotesTimeseries",
]
)
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
try:
AgentsInsightsV2Response.model_rebuild()
except NameError:
pass