operations.py 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. # Generated by ariadne-codegen
  2. # Source: tools/graphql_codegen/automations/
  3. __all__ = [
  4. "CREATE_AUTOMATION_GQL",
  5. "CREATE_GENERIC_WEBHOOK_INTEGRATION_GQL",
  6. "DELETE_AUTOMATION_GQL",
  7. "GET_AUTOMATIONS_BY_ENTITY_GQL",
  8. "GET_AUTOMATIONS_GQL",
  9. "INTEGRATIONS_BY_ENTITY_GQL",
  10. "UPDATE_AUTOMATION_GQL",
  11. ]
  12. GET_AUTOMATIONS_GQL = """
  13. query GetAutomations($cursor: String, $perPage: Int) {
  14. scope: viewer {
  15. projects(after: $cursor, first: $perPage) {
  16. pageInfo {
  17. ...PageInfoFields
  18. }
  19. edges {
  20. node {
  21. ...ProjectTriggersFields
  22. }
  23. }
  24. }
  25. }
  26. }
  27. fragment ArtifactPortfolioScopeFields on ArtifactPortfolio {
  28. __typename
  29. id
  30. name
  31. }
  32. fragment ArtifactSequenceScopeFields on ArtifactSequence {
  33. __typename
  34. id
  35. name
  36. }
  37. fragment FilterEventFields on FilterEventTriggeringCondition {
  38. __typename
  39. eventType
  40. filter
  41. }
  42. fragment GenericWebhookActionFields on GenericWebhookTriggeredAction {
  43. __typename
  44. integration {
  45. ...WebhookIntegrationFields
  46. }
  47. requestPayload
  48. }
  49. fragment NoOpActionFields on NoOpTriggeredAction {
  50. __typename
  51. noOp
  52. }
  53. fragment NotificationActionFields on NotificationTriggeredAction {
  54. __typename
  55. integration {
  56. ...SlackIntegrationFields
  57. }
  58. title
  59. message
  60. severity
  61. }
  62. fragment PageInfoFields on PageInfo {
  63. endCursor
  64. hasNextPage
  65. }
  66. fragment ProjectScopeFields on Project {
  67. __typename
  68. id
  69. name
  70. }
  71. fragment ProjectTriggersFields on Project {
  72. __typename
  73. triggers {
  74. ...TriggerFields
  75. }
  76. }
  77. fragment QueueJobActionFields on QueueJobTriggeredAction {
  78. __typename
  79. queue {
  80. id
  81. name
  82. }
  83. template
  84. }
  85. fragment SlackIntegrationFields on SlackIntegration {
  86. __typename
  87. id
  88. teamName
  89. channelName
  90. }
  91. fragment TriggerFields on Trigger {
  92. __typename
  93. id
  94. createdAt
  95. updatedAt
  96. name
  97. description
  98. enabled
  99. scope {
  100. ...ProjectScopeFields
  101. ...ArtifactPortfolioScopeFields
  102. ...ArtifactSequenceScopeFields
  103. }
  104. event: triggeringCondition {
  105. ...FilterEventFields
  106. }
  107. action: triggeredAction {
  108. ...QueueJobActionFields
  109. ...NotificationActionFields
  110. ...GenericWebhookActionFields
  111. ...NoOpActionFields
  112. }
  113. }
  114. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  115. __typename
  116. id
  117. name
  118. urlEndpoint
  119. }
  120. """
  121. GET_AUTOMATIONS_BY_ENTITY_GQL = """
  122. query GetAutomationsByEntity($entity: String!, $cursor: String, $perPage: Int) {
  123. scope: entity(name: $entity) {
  124. projects(after: $cursor, first: $perPage) {
  125. pageInfo {
  126. ...PageInfoFields
  127. }
  128. edges {
  129. node {
  130. ...ProjectTriggersFields
  131. }
  132. }
  133. }
  134. }
  135. }
  136. fragment ArtifactPortfolioScopeFields on ArtifactPortfolio {
  137. __typename
  138. id
  139. name
  140. }
  141. fragment ArtifactSequenceScopeFields on ArtifactSequence {
  142. __typename
  143. id
  144. name
  145. }
  146. fragment FilterEventFields on FilterEventTriggeringCondition {
  147. __typename
  148. eventType
  149. filter
  150. }
  151. fragment GenericWebhookActionFields on GenericWebhookTriggeredAction {
  152. __typename
  153. integration {
  154. ...WebhookIntegrationFields
  155. }
  156. requestPayload
  157. }
  158. fragment NoOpActionFields on NoOpTriggeredAction {
  159. __typename
  160. noOp
  161. }
  162. fragment NotificationActionFields on NotificationTriggeredAction {
  163. __typename
  164. integration {
  165. ...SlackIntegrationFields
  166. }
  167. title
  168. message
  169. severity
  170. }
  171. fragment PageInfoFields on PageInfo {
  172. endCursor
  173. hasNextPage
  174. }
  175. fragment ProjectScopeFields on Project {
  176. __typename
  177. id
  178. name
  179. }
  180. fragment ProjectTriggersFields on Project {
  181. __typename
  182. triggers {
  183. ...TriggerFields
  184. }
  185. }
  186. fragment QueueJobActionFields on QueueJobTriggeredAction {
  187. __typename
  188. queue {
  189. id
  190. name
  191. }
  192. template
  193. }
  194. fragment SlackIntegrationFields on SlackIntegration {
  195. __typename
  196. id
  197. teamName
  198. channelName
  199. }
  200. fragment TriggerFields on Trigger {
  201. __typename
  202. id
  203. createdAt
  204. updatedAt
  205. name
  206. description
  207. enabled
  208. scope {
  209. ...ProjectScopeFields
  210. ...ArtifactPortfolioScopeFields
  211. ...ArtifactSequenceScopeFields
  212. }
  213. event: triggeringCondition {
  214. ...FilterEventFields
  215. }
  216. action: triggeredAction {
  217. ...QueueJobActionFields
  218. ...NotificationActionFields
  219. ...GenericWebhookActionFields
  220. ...NoOpActionFields
  221. }
  222. }
  223. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  224. __typename
  225. id
  226. name
  227. urlEndpoint
  228. }
  229. """
  230. CREATE_AUTOMATION_GQL = """
  231. mutation CreateAutomation($input: CreateFilterTriggerInput!) {
  232. result: createFilterTrigger(input: $input) {
  233. trigger {
  234. ...TriggerFields
  235. }
  236. }
  237. }
  238. fragment ArtifactPortfolioScopeFields on ArtifactPortfolio {
  239. __typename
  240. id
  241. name
  242. }
  243. fragment ArtifactSequenceScopeFields on ArtifactSequence {
  244. __typename
  245. id
  246. name
  247. }
  248. fragment FilterEventFields on FilterEventTriggeringCondition {
  249. __typename
  250. eventType
  251. filter
  252. }
  253. fragment GenericWebhookActionFields on GenericWebhookTriggeredAction {
  254. __typename
  255. integration {
  256. ...WebhookIntegrationFields
  257. }
  258. requestPayload
  259. }
  260. fragment NoOpActionFields on NoOpTriggeredAction {
  261. __typename
  262. noOp
  263. }
  264. fragment NotificationActionFields on NotificationTriggeredAction {
  265. __typename
  266. integration {
  267. ...SlackIntegrationFields
  268. }
  269. title
  270. message
  271. severity
  272. }
  273. fragment ProjectScopeFields on Project {
  274. __typename
  275. id
  276. name
  277. }
  278. fragment QueueJobActionFields on QueueJobTriggeredAction {
  279. __typename
  280. queue {
  281. id
  282. name
  283. }
  284. template
  285. }
  286. fragment SlackIntegrationFields on SlackIntegration {
  287. __typename
  288. id
  289. teamName
  290. channelName
  291. }
  292. fragment TriggerFields on Trigger {
  293. __typename
  294. id
  295. createdAt
  296. updatedAt
  297. name
  298. description
  299. enabled
  300. scope {
  301. ...ProjectScopeFields
  302. ...ArtifactPortfolioScopeFields
  303. ...ArtifactSequenceScopeFields
  304. }
  305. event: triggeringCondition {
  306. ...FilterEventFields
  307. }
  308. action: triggeredAction {
  309. ...QueueJobActionFields
  310. ...NotificationActionFields
  311. ...GenericWebhookActionFields
  312. ...NoOpActionFields
  313. }
  314. }
  315. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  316. __typename
  317. id
  318. name
  319. urlEndpoint
  320. }
  321. """
  322. UPDATE_AUTOMATION_GQL = """
  323. mutation UpdateAutomation($input: UpdateFilterTriggerInput!) {
  324. result: updateFilterTrigger(input: $input) {
  325. trigger {
  326. ...TriggerFields
  327. }
  328. }
  329. }
  330. fragment ArtifactPortfolioScopeFields on ArtifactPortfolio {
  331. __typename
  332. id
  333. name
  334. }
  335. fragment ArtifactSequenceScopeFields on ArtifactSequence {
  336. __typename
  337. id
  338. name
  339. }
  340. fragment FilterEventFields on FilterEventTriggeringCondition {
  341. __typename
  342. eventType
  343. filter
  344. }
  345. fragment GenericWebhookActionFields on GenericWebhookTriggeredAction {
  346. __typename
  347. integration {
  348. ...WebhookIntegrationFields
  349. }
  350. requestPayload
  351. }
  352. fragment NoOpActionFields on NoOpTriggeredAction {
  353. __typename
  354. noOp
  355. }
  356. fragment NotificationActionFields on NotificationTriggeredAction {
  357. __typename
  358. integration {
  359. ...SlackIntegrationFields
  360. }
  361. title
  362. message
  363. severity
  364. }
  365. fragment ProjectScopeFields on Project {
  366. __typename
  367. id
  368. name
  369. }
  370. fragment QueueJobActionFields on QueueJobTriggeredAction {
  371. __typename
  372. queue {
  373. id
  374. name
  375. }
  376. template
  377. }
  378. fragment SlackIntegrationFields on SlackIntegration {
  379. __typename
  380. id
  381. teamName
  382. channelName
  383. }
  384. fragment TriggerFields on Trigger {
  385. __typename
  386. id
  387. createdAt
  388. updatedAt
  389. name
  390. description
  391. enabled
  392. scope {
  393. ...ProjectScopeFields
  394. ...ArtifactPortfolioScopeFields
  395. ...ArtifactSequenceScopeFields
  396. }
  397. event: triggeringCondition {
  398. ...FilterEventFields
  399. }
  400. action: triggeredAction {
  401. ...QueueJobActionFields
  402. ...NotificationActionFields
  403. ...GenericWebhookActionFields
  404. ...NoOpActionFields
  405. }
  406. }
  407. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  408. __typename
  409. id
  410. name
  411. urlEndpoint
  412. }
  413. """
  414. DELETE_AUTOMATION_GQL = """
  415. mutation DeleteAutomation($id: ID!) {
  416. result: deleteTrigger(input: {triggerID: $id}) {
  417. success
  418. }
  419. }
  420. """
  421. INTEGRATIONS_BY_ENTITY_GQL = """
  422. query IntegrationsByEntity($entity: String!, $cursor: String, $perPage: Int) {
  423. entity(name: $entity) {
  424. integrations(after: $cursor, first: $perPage) {
  425. pageInfo {
  426. ...PageInfoFields
  427. }
  428. edges {
  429. node {
  430. __typename
  431. ...SlackIntegrationFields
  432. ...WebhookIntegrationFields
  433. }
  434. }
  435. }
  436. }
  437. }
  438. fragment PageInfoFields on PageInfo {
  439. endCursor
  440. hasNextPage
  441. }
  442. fragment SlackIntegrationFields on SlackIntegration {
  443. __typename
  444. id
  445. teamName
  446. channelName
  447. }
  448. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  449. __typename
  450. id
  451. name
  452. urlEndpoint
  453. }
  454. """
  455. CREATE_GENERIC_WEBHOOK_INTEGRATION_GQL = """
  456. mutation CreateGenericWebhookIntegration($input: CreateGenericWebhookIntegrationInput!) {
  457. createGenericWebhookIntegration(input: $input) {
  458. integration {
  459. __typename
  460. ...WebhookIntegrationFields
  461. }
  462. }
  463. }
  464. fragment WebhookIntegrationFields on GenericWebhookIntegration {
  465. __typename
  466. id
  467. name
  468. urlEndpoint
  469. }
  470. """