-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathagentstimesavedinsight.py
More file actions
68 lines (52 loc) · 2.31 KB
/
agentstimesavedinsight.py
File metadata and controls
68 lines (52 loc) · 2.31 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
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .iconconfig import IconConfig, IconConfigTypedDict
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class AgentsTimeSavedInsightTypedDict(TypedDict):
agent_id: NotRequired[str]
r"""Agent ID"""
agent_name: NotRequired[str]
r"""Agent name"""
icon: NotRequired[IconConfigTypedDict]
r"""Defines how to render an icon"""
is_deleted: NotRequired[bool]
r"""Indicates whether the agent has been deleted"""
run_count: NotRequired[int]
r"""Total number of runs for this agent over the specified time period."""
mins_per_run: NotRequired[float]
r"""Average minutes saved per run for this agent over the specified time period."""
class AgentsTimeSavedInsight(BaseModel):
agent_id: Annotated[Optional[str], pydantic.Field(alias="agentId")] = None
r"""Agent ID"""
agent_name: Annotated[Optional[str], pydantic.Field(alias="agentName")] = None
r"""Agent name"""
icon: Optional[IconConfig] = None
r"""Defines how to render an icon"""
is_deleted: Annotated[Optional[bool], pydantic.Field(alias="isDeleted")] = None
r"""Indicates whether the agent has been deleted"""
run_count: Annotated[Optional[int], pydantic.Field(alias="runCount")] = None
r"""Total number of runs for this agent over the specified time period."""
mins_per_run: Annotated[Optional[float], pydantic.Field(alias="minsPerRun")] = None
r"""Average minutes saved per run for this agent over the specified time period."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["agentId", "agentName", "icon", "isDeleted", "runCount", "minsPerRun"]
)
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:
AgentsTimeSavedInsight.model_rebuild()
except NameError:
pass