File size: 12,017 Bytes
9c6594c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# Generated by ariadne-codegen
# Source: tools/graphql_codegen/automations/

from __future__ import annotations

from datetime import datetime
from typing import List, Literal, Optional, Union

from pydantic import Field
from typing_extensions import Annotated

from wandb._pydantic import GQLBase, GQLId, Typename

from .enums import AlertSeverity, EventTriggeringConditionType


class ArtifactPortfolioScopeFields(GQLBase):
    typename__: Typename[Literal["ArtifactPortfolio"]] = "ArtifactPortfolio"
    id: GQLId
    name: str


class ArtifactSequenceScopeFields(GQLBase):
    typename__: Typename[Literal["ArtifactSequence"]] = "ArtifactSequence"
    id: GQLId
    name: str


class CreateAutomationResult(GQLBase):
    typename__: Typename[Literal["CreateFilterTriggerPayload"]] = (
        "CreateFilterTriggerPayload"
    )
    trigger: Optional[TriggerFields]


class DeleteAutomationResult(GQLBase):
    typename__: Typename[Literal["DeleteTriggerPayload"]] = "DeleteTriggerPayload"
    success: bool


class FilterEventFields(GQLBase):
    typename__: Typename[Literal["FilterEventTriggeringCondition"]] = (
        "FilterEventTriggeringCondition"
    )
    event_type: EventTriggeringConditionType = Field(alias="eventType")
    filter: str


class GenericWebhookActionFields(GQLBase):
    typename__: Typename[Literal["GenericWebhookTriggeredAction"]] = (
        "GenericWebhookTriggeredAction"
    )
    integration: Union[
        GenericWebhookActionFieldsIntegrationIntegration,
        GenericWebhookActionFieldsIntegrationGenericWebhookIntegration,
    ] = Field(discriminator="typename__")
    request_payload: Optional[str] = Field(alias="requestPayload")


class GenericWebhookActionFieldsIntegrationIntegration(GQLBase):
    typename__: Typename[
        Literal["GitHubOAuthIntegration", "Integration", "SlackIntegration"]
    ]


class GenericWebhookIntegrationConnectionFields(GQLBase):
    typename__: Typename[Literal["IntegrationConnection"]] = "IntegrationConnection"
    page_info: PageInfoFields = Field(alias="pageInfo")
    edges: List[GenericWebhookIntegrationConnectionFieldsEdges]


class GenericWebhookIntegrationConnectionFieldsEdges(GQLBase):
    cursor: str
    node: Optional[
        Annotated[
            Union[
                GenericWebhookIntegrationConnectionFieldsEdgesNodeIntegration,
                GenericWebhookIntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration,
            ],
            Field(discriminator="typename__"),
        ]
    ]


class GenericWebhookIntegrationConnectionFieldsEdgesNodeIntegration(GQLBase):
    typename__: Typename[
        Literal["GitHubOAuthIntegration", "Integration", "SlackIntegration"]
    ]


class GenericWebhookIntegrationFields(GQLBase):
    typename__: Typename[Literal["GenericWebhookIntegration"]] = (
        "GenericWebhookIntegration"
    )
    id: GQLId
    name: str
    url_endpoint: str = Field(alias="urlEndpoint")


class IntegrationConnectionFields(GQLBase):
    typename__: Typename[Literal["IntegrationConnection"]] = "IntegrationConnection"
    page_info: PageInfoFields = Field(alias="pageInfo")
    edges: List[IntegrationConnectionFieldsEdges]


class IntegrationConnectionFieldsEdges(GQLBase):
    cursor: str
    node: Optional[
        Annotated[
            Union[
                IntegrationConnectionFieldsEdgesNodeIntegration,
                IntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration,
                IntegrationConnectionFieldsEdgesNodeSlackIntegration,
            ],
            Field(discriminator="typename__"),
        ]
    ]


class IntegrationConnectionFieldsEdgesNodeIntegration(GQLBase):
    typename__: Typename[Literal["GitHubOAuthIntegration", "Integration"]]


class NoOpActionFields(GQLBase):
    typename__: Typename[Literal["NoOpTriggeredAction"]] = "NoOpTriggeredAction"
    no_op: Optional[bool] = Field(alias="noOp")


class NotificationActionFields(GQLBase):
    typename__: Typename[Literal["NotificationTriggeredAction"]] = (
        "NotificationTriggeredAction"
    )
    integration: Union[
        NotificationActionFieldsIntegrationIntegration,
        NotificationActionFieldsIntegrationSlackIntegration,
    ] = Field(discriminator="typename__")
    title: Optional[str]
    message: Optional[str]
    severity: Optional[AlertSeverity]


class NotificationActionFieldsIntegrationIntegration(GQLBase):
    typename__: Typename[
        Literal["GenericWebhookIntegration", "GitHubOAuthIntegration", "Integration"]
    ]


class PageInfoFields(GQLBase):
    end_cursor: Optional[str] = Field(alias="endCursor")
    has_next_page: bool = Field(alias="hasNextPage")


class ProjectConnectionFields(GQLBase):
    typename__: Typename[Literal["ProjectConnection"]] = "ProjectConnection"
    page_info: PageInfoFields = Field(alias="pageInfo")
    edges: List[ProjectConnectionFieldsEdges]


class ProjectConnectionFieldsEdges(GQLBase):
    cursor: str
    node: Optional[ProjectConnectionFieldsEdgesNode]


class ProjectConnectionFieldsEdgesNode(GQLBase):
    triggers: List[TriggerFields]


class ProjectScopeFields(GQLBase):
    typename__: Typename[Literal["Project"]] = "Project"
    id: GQLId
    name: str


class QueueJobActionFields(GQLBase):
    typename__: Typename[Literal["QueueJobTriggeredAction"]] = "QueueJobTriggeredAction"
    queue: Optional[QueueJobActionFieldsQueue]
    template: str


class QueueJobActionFieldsQueue(GQLBase):
    id: GQLId
    name: str


class SlackIntegrationConnectionFields(GQLBase):
    typename__: Typename[Literal["IntegrationConnection"]] = "IntegrationConnection"
    page_info: PageInfoFields = Field(alias="pageInfo")
    edges: List[SlackIntegrationConnectionFieldsEdges]


class SlackIntegrationConnectionFieldsEdges(GQLBase):
    cursor: str
    node: Optional[
        Annotated[
            Union[
                SlackIntegrationConnectionFieldsEdgesNodeIntegration,
                SlackIntegrationConnectionFieldsEdgesNodeSlackIntegration,
            ],
            Field(discriminator="typename__"),
        ]
    ]


class SlackIntegrationConnectionFieldsEdgesNodeIntegration(GQLBase):
    typename__: Typename[
        Literal["GenericWebhookIntegration", "GitHubOAuthIntegration", "Integration"]
    ]


class SlackIntegrationFields(GQLBase):
    typename__: Typename[Literal["SlackIntegration"]] = "SlackIntegration"
    id: GQLId
    team_name: str = Field(alias="teamName")
    channel_name: str = Field(alias="channelName")


class TriggerFields(GQLBase):
    typename__: Typename[Literal["Trigger"]] = "Trigger"
    id: GQLId
    created_at: datetime = Field(alias="createdAt")
    updated_at: Optional[datetime] = Field(alias="updatedAt")
    name: str
    description: Optional[str]
    enabled: bool
    scope: Union[
        TriggerFieldsScopeProject,
        TriggerFieldsScopeArtifactSequence,
        TriggerFieldsScopeArtifactPortfolio,
    ] = Field(discriminator="typename__")
    event: TriggerFieldsEventFilterEventTriggeringCondition
    action: Union[
        TriggerFieldsActionQueueJobTriggeredAction,
        TriggerFieldsActionNotificationTriggeredAction,
        TriggerFieldsActionGenericWebhookTriggeredAction,
        TriggerFieldsActionNoOpTriggeredAction,
    ] = Field(discriminator="typename__")


class UpdateAutomationResult(GQLBase):
    typename__: Typename[Literal["UpdateFilterTriggerPayload"]] = (
        "UpdateFilterTriggerPayload"
    )
    trigger: Optional[TriggerFields]


class TriggerFieldsScopeArtifactPortfolio(ArtifactPortfolioScopeFields):
    typename__: Typename[Literal["ArtifactPortfolio"]]


class TriggerFieldsScopeArtifactSequence(ArtifactSequenceScopeFields):
    typename__: Typename[Literal["ArtifactSequence"]]


class TriggerFieldsEventFilterEventTriggeringCondition(FilterEventFields):
    typename__: Typename[Literal["FilterEventTriggeringCondition"]]


class TriggerFieldsActionGenericWebhookTriggeredAction(GenericWebhookActionFields):
    typename__: Typename[Literal["GenericWebhookTriggeredAction"]]


class GenericWebhookActionFieldsIntegrationGenericWebhookIntegration(
    GenericWebhookIntegrationFields
):
    typename__: Typename[Literal["GenericWebhookIntegration"]]


class GenericWebhookIntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration(
    GenericWebhookIntegrationFields
):
    typename__: Typename[Literal["GenericWebhookIntegration"]]


class IntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration(
    GenericWebhookIntegrationFields
):
    typename__: Typename[Literal["GenericWebhookIntegration"]]


class TriggerFieldsActionNoOpTriggeredAction(NoOpActionFields):
    typename__: Typename[Literal["NoOpTriggeredAction"]]


class TriggerFieldsActionNotificationTriggeredAction(NotificationActionFields):
    typename__: Typename[Literal["NotificationTriggeredAction"]]


class TriggerFieldsScopeProject(ProjectScopeFields):
    typename__: Typename[Literal["Project"]]


class TriggerFieldsActionQueueJobTriggeredAction(QueueJobActionFields):
    typename__: Typename[Literal["QueueJobTriggeredAction"]]


class IntegrationConnectionFieldsEdgesNodeSlackIntegration(SlackIntegrationFields):
    typename__: Typename[Literal["SlackIntegration"]]


class NotificationActionFieldsIntegrationSlackIntegration(SlackIntegrationFields):
    typename__: Typename[Literal["SlackIntegration"]]


class SlackIntegrationConnectionFieldsEdgesNodeSlackIntegration(SlackIntegrationFields):
    typename__: Typename[Literal["SlackIntegration"]]


ArtifactPortfolioScopeFields.model_rebuild()
ArtifactSequenceScopeFields.model_rebuild()
CreateAutomationResult.model_rebuild()
DeleteAutomationResult.model_rebuild()
FilterEventFields.model_rebuild()
GenericWebhookActionFields.model_rebuild()
GenericWebhookActionFieldsIntegrationIntegration.model_rebuild()
GenericWebhookIntegrationConnectionFields.model_rebuild()
GenericWebhookIntegrationConnectionFieldsEdges.model_rebuild()
GenericWebhookIntegrationConnectionFieldsEdgesNodeIntegration.model_rebuild()
GenericWebhookIntegrationFields.model_rebuild()
IntegrationConnectionFields.model_rebuild()
IntegrationConnectionFieldsEdges.model_rebuild()
IntegrationConnectionFieldsEdgesNodeIntegration.model_rebuild()
NoOpActionFields.model_rebuild()
NotificationActionFields.model_rebuild()
NotificationActionFieldsIntegrationIntegration.model_rebuild()
PageInfoFields.model_rebuild()
ProjectConnectionFields.model_rebuild()
ProjectConnectionFieldsEdges.model_rebuild()
ProjectConnectionFieldsEdgesNode.model_rebuild()
ProjectScopeFields.model_rebuild()
QueueJobActionFields.model_rebuild()
QueueJobActionFieldsQueue.model_rebuild()
SlackIntegrationConnectionFields.model_rebuild()
SlackIntegrationConnectionFieldsEdges.model_rebuild()
SlackIntegrationConnectionFieldsEdgesNodeIntegration.model_rebuild()
SlackIntegrationFields.model_rebuild()
TriggerFields.model_rebuild()
UpdateAutomationResult.model_rebuild()
TriggerFieldsScopeArtifactPortfolio.model_rebuild()
TriggerFieldsScopeArtifactSequence.model_rebuild()
TriggerFieldsEventFilterEventTriggeringCondition.model_rebuild()
TriggerFieldsActionGenericWebhookTriggeredAction.model_rebuild()
GenericWebhookActionFieldsIntegrationGenericWebhookIntegration.model_rebuild()
GenericWebhookIntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration.model_rebuild()
IntegrationConnectionFieldsEdgesNodeGenericWebhookIntegration.model_rebuild()
TriggerFieldsActionNoOpTriggeredAction.model_rebuild()
TriggerFieldsActionNotificationTriggeredAction.model_rebuild()
PageInfoFields.model_rebuild()
PageInfoFields.model_rebuild()
PageInfoFields.model_rebuild()
PageInfoFields.model_rebuild()
TriggerFieldsScopeProject.model_rebuild()
TriggerFieldsActionQueueJobTriggeredAction.model_rebuild()
IntegrationConnectionFieldsEdgesNodeSlackIntegration.model_rebuild()
NotificationActionFieldsIntegrationSlackIntegration.model_rebuild()
SlackIntegrationConnectionFieldsEdgesNodeSlackIntegration.model_rebuild()
TriggerFields.model_rebuild()
TriggerFields.model_rebuild()
TriggerFields.model_rebuild()