Module: API::Helpers::IntegrationsHelpers

Defined in:
lib/api/helpers/integrations_helpers.rb

Overview

Helpers module for API::Integrations

The data structures inside this model are returned using class methods, allowing EE to extend them where necessary.

Class Method Summary collapse

Class Method Details

.chat_notification_channelsObject



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
# File 'lib/api/helpers/integrations_helpers.rb', line 50

def self.chat_notification_channels
  [
    {
      required: false,
      name: :push_channel,
      type: String,
      desc: 'The name of the channel to receive push_events notifications'
    },
    {
      required: false,
      name: :issue_channel,
      type: String,
      desc: 'The name of the channel to receive issues_events notifications'
    },
    {
      required: false,
      name: :incident_channel,
      type: String,
      desc: 'The name of the channel to receive incident_events notifications'
    },
    {
      required: false,
      name: :alert_channel,
      type: String,
      desc: 'The name of the channel to receive alert_events notifications'
    },
    {
      required: false,
      name: :confidential_issue_channel,
      type: String,
      desc: 'The name of the channel to receive confidential_issues_events notifications'
    },
    {
      required: false,
      name: :merge_request_channel,
      type: String,
      desc: 'The name of the channel to receive merge_requests_events notifications'
    },
    {
      required: false,
      name: :note_channel,
      type: String,
      desc: 'The name of the channel to receive note_events notifications'
    },
    {
      required: false,
      name: :confidential_note_channel,
      type: String,
      desc: 'The name of the channel to receive confidential_note_events notifications'
    },
    {
      required: false,
      name: :tag_push_channel,
      type: String,
      desc: 'The name of the channel to receive tag_push_events notifications'
    },
    {
      required: false,
      name: :deployment_channel,
      type: String,
      desc: 'The name of the channel to receive deployment_events notifications'
    },
    {
      required: false,
      name: :pipeline_channel,
      type: String,
      desc: 'The name of the channel to receive pipeline_events notifications'
    },
    {
      required: false,
      name: :wiki_page_channel,
      type: String,
      desc: 'The name of the channel to receive wiki_page_events notifications'
    }
  ].freeze
end

.chat_notification_flagsObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/api/helpers/integrations_helpers.rb', line 39

def self.chat_notification_flags
  [
    {
      required: false,
      name: :notify_only_broken_pipelines,
      type: ::Grape::API::Boolean,
      desc: 'Send notifications for broken pipelines'
    }
  ].freeze
end

.chat_notification_settingsObject



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
# File 'lib/api/helpers/integrations_helpers.rb', line 10

def self.chat_notification_settings
  [
    {
      required: true,
      name: :webhook,
      type: String,
      desc: 'The chat webhook'
    },
    {
      required: false,
      name: :username,
      type: String,
      desc: 'The chat username'
    },
    {
      required: false,
      name: :channel,
      type: String,
      desc: 'The default chat channel'
    },
    {
      required: false,
      name: :branches_to_be_notified,
      type: String,
      desc: 'Branches for which notifications are to be sent'
    }
  ].freeze
end

.development_integration_classesObject



1005
1006
1007
1008
1009
1010
# File 'lib/api/helpers/integrations_helpers.rb', line 1005

def self.development_integration_classes
  [
    ::Integrations::MockCi,
    ::Integrations::MockMonitoring
  ]
end

.integration_classesObject



958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
# File 'lib/api/helpers/integrations_helpers.rb', line 958

def self.integration_classes
  [
    ::Integrations::AppleAppStore,
    ::Integrations::Asana,
    ::Integrations::Assembla,
    ::Integrations::Bamboo,
    ::Integrations::Bugzilla,
    ::Integrations::Buildkite,
    ::Integrations::Campfire,
    ::Integrations::Clickup,
    ::Integrations::Confluence,
    ::Integrations::CustomIssueTracker,
    ::Integrations::Datadog,
    ::Integrations::Discord,
    ::Integrations::DroneCi,
    ::Integrations::EmailsOnPush,
    ::Integrations::Ewm,
    ::Integrations::ExternalWiki,
    ::Integrations::GooglePlay,
    ::Integrations::HangoutsChat,
    ::Integrations::Harbor,
    ::Integrations::Irker,
    ::Integrations::Jenkins,
    ::Integrations::Jira,
    ::Integrations::Mattermost,
    ::Integrations::MattermostSlashCommands,
    ::Integrations::MicrosoftTeams,
    ::Integrations::Packagist,
    ::Integrations::PipelinesEmail,
    ::Integrations::Pivotaltracker,
    ::Integrations::Prometheus,
    ::Integrations::Pumble,
    ::Integrations::Pushover,
    ::Integrations::Redmine,
    ::Integrations::Shimo,
    ::Integrations::Slack,
    ::Integrations::SlackSlashCommands,
    ::Integrations::SquashTm,
    ::Integrations::Teamcity,
    ::Integrations::Telegram,
    ::Integrations::UnifyCircuit,
    ::Integrations::WebexTeams,
    ::Integrations::Youtrack,
    ::Integrations::Zentao
  ]
end

.integrationsObject



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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/api/helpers/integrations_helpers.rb', line 127

def self.integrations
  {
    'apple-app-store' => [
      {
        required: true,
        name: :app_store_issuer_id,
        type: String,
        desc: 'The Apple App Store Connect Issuer ID'
      },
      {
        required: true,
        name: :app_store_key_id,
        type: String,
        desc: 'The Apple App Store Connect Key ID'
      },
      {
        required: true,
        name: :app_store_private_key,
        type: String,
        desc: 'The Apple App Store Connect Private Key'
      },
      {
        required: true,
        name: :app_store_private_key_file_name,
        type: String,
        desc: 'The Apple App Store Connect Private Key File Name'
      },
      {
        required: false,
        name: :app_store_protected_refs,
        type: ::Grape::API::Boolean,
        desc: 'Only enable for protected refs'
      }
    ],
    'asana' => [
      {
        required: true,
        name: :api_key,
        type: String,
        desc: 'User API token'
      },
      {
        required: false,
        name: :restrict_to_branch,
        type: String,
        desc: 'Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches'
      }
    ],
    'assembla' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The authentication token'
      },
      {
        required: false,
        name: :subdomain,
        type: String,
        desc: 'Subdomain setting'
      }
    ],
    'bamboo' => [
      {
        required: true,
        name: :bamboo_url,
        type: String,
        desc: 'Bamboo root URL like https://bamboo.example.com'
      },
      {
        required: false,
        name: :enable_ssl_verification,
        type: ::Grape::API::Boolean,
        desc: 'Enable SSL verification'
      },
      {
        required: true,
        name: :build_key,
        type: String,
        desc: 'Bamboo build plan key like'
      },
      {
        required: true,
        name: :username,
        type: String,
        desc: 'A user with API access, if applicable'
      },
      {
        required: true,
        name: :password,
        type: String,
        desc: 'Password of the user'
      }
    ],
    'bugzilla' => [
      {
        required: true,
        name: :new_issue_url,
        type: String,
        desc: 'New issue URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'Issues URL'
      },
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'Project URL'
      }
    ],
    'buildkite' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'Buildkite project GitLab token'
      },
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'The Buildkite pipeline URL'
      },
      {
        required: false,
        name: :enable_ssl_verification,
        type: ::Grape::API::Boolean,
        desc: 'DEPRECATED: This parameter has no effect since SSL verification will always be enabled'
      }
    ],
    'campfire' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'Campfire token'
      },
      {
        required: false,
        name: :subdomain,
        type: String,
        desc: 'Campfire subdomain'
      },
      {
        required: false,
        name: :room,
        type: String,
        desc: 'Campfire room'
      }
    ],
    'confluence' => [
      {
        required: true,
        name: :confluence_url,
        type: String,
        desc: 'The URL of the Confluence Cloud Workspace hosted on atlassian.net'
      }
    ],
    'custom-issue-tracker' => [
      {
        required: true,
        name: :new_issue_url,
        type: String,
        desc: 'New issue URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'Issues URL'
      },
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'Project URL'
      }
    ],
    'datadog' => [
      {
        required: true,
        name: :api_key,
        type: String,
        desc: 'API key used for authentication with Datadog'
      },
      {
        required: false,
        name: :datadog_site,
        type: String,
        desc: 'The Datadog site to send data to. To send data to the EU site, use datadoghq.eu'
      },
      {
        required: false,
        name: :api_url,
        type: String,
        desc: '(Advanced) The full URL for your Datadog site'
      },
      {
        required: false,
        name: :archive_trace_events,
        type: ::Grape::API::Boolean,
        desc: 'When enabled, job logs will be collected by Datadog and shown along pipeline execution traces'
      },
      {
        required: false,
        name: :datadog_service,
        type: String,
        desc: 'Tag all data from this GitLab instance in Datadog. Useful when managing several self-managed deployments'
      },
      {
        required: false,
        name: :datadog_env,
        type: String,
        desc: 'For self-managed deployments, set the env tag for all the data sent to Datadog'
      },
      {
        required: false,
        name: :datadog_tags,
        type: String,
        desc: 'Custom tags in Datadog. Specify one tag per line in the format: "key:value\nkey2:value2"'
      }
    ],
    'discord' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'Discord webhook. For example, https://discord.com/api/webhooks/…'
      },
      {
        required: false,
        name: :branches_to_be_notified,
        type: String,
        desc: 'Branches for which notifications are to be sent'
      },
      chat_notification_flags,
      chat_notification_channels
    ].flatten,
    'drone-ci' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'Drone CI token'
      },
      {
        required: true,
        name: :drone_url,
        type: String,
        desc: 'Drone CI URL'
      },
      {
        required: false,
        name: :enable_ssl_verification,
        type: ::Grape::API::Boolean,
        desc: 'Enable SSL verification'
      }
    ],
    'emails-on-push' => [
      {
        required: true,
        name: :recipients,
        type: String,
        desc: 'Comma-separated list of recipient email addresses'
      },
      {
        required: false,
        name: :disable_diffs,
        type: ::Grape::API::Boolean,
        desc: 'Disable code diffs'
      },
      {
        required: false,
        name: :send_from_committer_email,
        type: ::Grape::API::Boolean,
        desc: 'Send from committer'
      },
      {
        required: false,
        name: :branches_to_be_notified,
        type: String,
        desc: 'Branches for which notifications are to be sent'
      }
    ],
    'external-wiki' => [
      {
        required: true,
        name: :external_wiki_url,
        type: String,
        desc: 'The URL of the external wiki'
      }
    ],
    'google-play' => [
      {
        required: true,
        name: :package_name,
        type: String,
        desc: 'The package name of the app in Google Play'
      },
      {
        required: true,
        name: :service_account_key,
        type: String,
        desc: 'The Google Play service account key'
      },
      {
        required: true,
        name: :service_account_key_file_name,
        type: String,
        desc: 'The filename of the Google Play service account key'
      },
      {
        required: false,
        name: :google_play_protected_refs,
        type: ::Grape::API::Boolean,
        desc: 'Only enable for protected refs'
      }
    ],
    'hangouts-chat' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'The Hangouts Chat webhook. e.g. https://chat.googleapis.com/v1/spaces…'
      },
      {
        required: false,
        name: :branches_to_be_notified,
        type: String,
        desc: 'Branches for which notifications are to be sent'
      }
    ].flatten,
    'harbor' => [
      {
        required: true,
        name: :url,
        type: String,
        desc: 'The base URL to the Harbor instance which is being linked to this GitLab project. For example, https://demo.goharbor.io.'
      },
      {
        required: true,
        name: :project_name,
        type: String,
        desc: 'The Project name to the Harbor instance. For example, testproject.'
      },
      {
        required: true,
        name: :username,
        type: String,
        desc: 'The username created from Harbor interface.'
      },
      {
        required: true,
        name: :password,
        type: String,
        desc: 'The password of the user.'
      }
    ],
    'irker' => [
      {
        required: true,
        name: :recipients,
        type: String,
        desc: 'Recipients/channels separated by whitespaces'
      },
      {
        required: false,
        name: :default_irc_uri,
        type: String,
        desc: 'Default: irc://irc.network.net:6697'
      },
      {
        required: false,
        name: :server_host,
        type: String,
        desc: 'Server host. Default localhost'
      },
      {
        required: false,
        name: :server_port,
        type: Integer,
        desc: 'Server port. Default 6659'
      },
      {
        required: false,
        name: :colorize_messages,
        type: ::Grape::API::Boolean,
        desc: 'Colorize messages'
      }
    ],
    'jenkins' => [
      {
        required: true,
        name: :jenkins_url,
        type: String,
        desc: 'Jenkins root URL like https://jenkins.example.com'
      },
      {
        required: false,
        name: :enable_ssl_verification,
        type: ::Grape::API::Boolean,
        desc: 'Enable SSL verification'
      },
      {
        required: true,
        name: :project_name,
        type: String,
        desc: 'The URL-friendly project name. Example: my_project_name'
      },
      {
        required: false,
        name: :username,
        type: String,
        desc: 'A user with access to the Jenkins server, if applicable'
      },
      {
        required: false,
        name: :password,
        type: String,
        desc: 'The password of the user'
      }
    ],
    'jira' => [
      {
        required: true,
        name: :url,
        type: String,
        desc: 'The base URL to the Jira instance web interface which is being linked to this GitLab project. E.g., https://jira.example.com'
      },
      {
        required: false,
        name: :api_url,
        type: String,
        desc: 'The base URL to the Jira instance API. Web URL value will be used if not set. E.g., https://jira-api.example.com'
      },
      {
        required: false,
        name: :jira_auth_type,
        type: Integer,
        desc: 'The authentication method to be used with Jira. `0` means Basic Authentication. `1` means Jira personal access token. Defaults to `0`'
      },
      {
        required: false,
        name: :username,
        type: String,
        desc: 'The email or username to be used with Jira. For Jira Cloud use an email, for Jira Data Center and Jira Server use a username. Required when using Basic authentication (`jira_auth_type` is `0`)'
      },
      {
        required: true,
        name: :password,
        type: String,
        desc: 'The Jira API token, password, or personal access token to be used with Jira. When your authentication method is Basic (`jira_auth_type` is `0`) use an API token for Jira Cloud, or a password for Jira Data Center or Jira Server. When your authentication method is Jira personal access token (`jira_auth_type` is `1`) use a personal access token'
      },
      {
        required: false,
        name: :jira_issue_transition_automatic,
        type: ::Grape::API::Boolean,
        desc: 'Enable automatic issue transitions'
      },
      {
        required: false,
        name: :jira_issue_transition_id,
        type: String,
        desc: 'The ID of one or more transitions for custom issue transitions'
      },
      {
        required: false,
        name: :jira_issue_prefix,
        type: String,
        desc: 'Prefix to match Jira issue keys'
      },
      {
        required: false,
        name: :jira_issue_regex,
        type: String,
        desc: 'Regular expression to match Jira issue keys'
      },
      {
        required: false,
        name: :comment_on_event_enabled,
        type: ::Grape::API::Boolean,
        desc: 'Enable comments inside Jira issues on each GitLab event (commit / merge request)'
      }
    ],
    'mattermost-slash-commands' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The Mattermost token'
      }
    ],
    'shimo' => [
      {
        required: true,
        name: :external_wiki_url,
        type: String,
        desc: 'Shimo workspace URL'
      }
    ],
    'slack-slash-commands' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The Slack token'
      }
    ],
    'packagist' => [
      {
        required: true,
        name: :username,
        type: String,
        desc: 'The username'
      },
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The Packagist API token'
      },
      {
        required: false,
        name: :server,
        type: String,
        desc: 'The server'
      }
    ],
    'pipelines-email' => [
      {
        required: true,
        name: :recipients,
        type: String,
        desc: 'Comma-separated list of recipient email addresses'
      },
      {
        required: false,
        name: :notify_only_broken_pipelines,
        type: ::Grape::API::Boolean,
        desc: 'Notify only broken pipelines'
      },
      {
        required: false,
        name: :notify_only_default_branch,
        type: ::Grape::API::Boolean,
        desc: 'Send notifications only for the default branch'
      },
      {
        required: false,
        name: :branches_to_be_notified,
        type: String,
        desc: 'Branches for which notifications are to be sent'
      }
    ],
    'pivotaltracker' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The Pivotaltracker token'
      },
      {
        required: false,
        name: :restrict_to_branch,
        type: String,
        desc: 'Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.'
      }
    ],
    'prometheus' => [
      {
        required: true,
        name: :api_url,
        type: String,
        desc: 'Prometheus API Base URL, like http://prometheus.example.com/'
      },
      {
        required: true,
        name: :google_iap_audience_client_id,
        type: String,
        desc: 'Client ID of the IAP-secured resource (looks like IAP_CLIENT_ID.apps.googleusercontent.com)'
      },
      {
        required: true,
        name: :google_iap_service_account_json,
        type: String,
        desc: 'Contents of the credentials.json file of your service account, like: { "type": "service_account", "project_id": ... }'
      }
    ],
    'pumble' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'The Pumble chat webhook. For example, https://api.pumble.com/workspaces/x/...'
      }
    ].flatten,
    'pushover' => [
      {
        required: true,
        name: :api_key,
        type: String,
        desc: 'The application key'
      },
      {
        required: true,
        name: :user_key,
        type: String,
        desc: 'The user key'
      },
      {
        required: true,
        name: :priority,
        type: String,
        desc: 'The priority'
      },
      {
        required: true,
        name: :device,
        type: String,
        desc: 'Leave blank for all active devices'
      },
      {
        required: true,
        name: :sound,
        type: String,
        desc: 'The sound of the notification'
      }
    ],
    'redmine' => [
      {
        required: true,
        name: :new_issue_url,
        type: String,
        desc: 'The new issue URL'
      },
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'The project URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'The issues URL'
      }
    ],
    'ewm' => [
      {
        required: true,
        name: :new_issue_url,
        type: String,
        desc: 'New Issue URL'
      },
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'Project URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'Issues URL'
      }
    ],
    'youtrack' => [
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'The project URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'The issues URL'
      }
    ],
    'clickup' => [
      {
        required: true,
        name: :project_url,
        type: String,
        desc: 'The project URL'
      },
      {
        required: true,
        name: :issues_url,
        type: String,
        desc: 'The issues URL'
      }
    ],
    'slack' => [
      chat_notification_settings,
      chat_notification_flags,
      chat_notification_channels
    ].flatten,
    'microsoft-teams' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'The Microsoft Teams webhook. e.g. https://outlook.office.com/webhook/…'
      },
      {
        required: false,
        name: :branches_to_be_notified,
        type: String,
        desc: 'Branches for which notifications are to be sent'
      },
      chat_notification_flags
    ].flatten,
    'mattermost' => [
      chat_notification_settings,
      chat_notification_flags,
      chat_notification_channels
    ].flatten,
    'teamcity' => [
      {
        required: true,
        name: :teamcity_url,
        type: String,
        desc: 'TeamCity root URL like https://teamcity.example.com'
      },
      {
        required: false,
        name: :enable_ssl_verification,
        type: ::Grape::API::Boolean,
        desc: 'Enable SSL verification'
      },
      {
        required: true,
        name: :build_type,
        type: String,
        desc: 'Build configuration ID'
      },
      {
        required: true,
        name: :username,
        type: String,
        desc: 'A user with permissions to trigger a manual build'
      },
      {
        required: true,
        name: :password,
        type: String,
        desc: 'The password of the user'
      }
    ],
    'telegram' => [
      {
        required: true,
        name: :token,
        type: String,
        desc: 'The Telegram chat token. For example, 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11'
      },
      {
        required: true,
        name: :room,
        type: String,
        desc: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername)'
      },
      chat_notification_flags
    ].flatten,
    'unify-circuit' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'The Unify Circuit webhook. e.g. https://circuit.com/rest/v2/webhooks/incoming/…'
      }
    ].flatten,
    'webex-teams' => [
      {
        required: true,
        name: :webhook,
        type: String,
        desc: 'The Webex Teams webhook. For example, https://api.ciscospark.com/v1/webhooks/incoming/...'
      }
    ].flatten,
    'zentao' => [
      {
        required: true,
        name: :url,
        type: String,
        desc: 'The base URL to the ZenTao instance web interface which is being linked to this GitLab project. For example, https://www.zentao.net'
      },
      {
        required: false,
        name: :api_url,
        type: String,
        desc: 'The base URL to the ZenTao instance API. Web URL value will be used if not set. For example, https://www.zentao.net'
      },
      {
        required: true,
        name: :api_token,
        type: String,
        desc: 'The API token created from ZenTao dashboard'
      },
      {
        required: true,
        name: :zentao_product_xid,
        type: String,
        desc: 'The product ID of ZenTao project'
      }
    ],
    'squash-tm' => [
      {
        required: true,
        name: :url,
        type: String,
        desc: 'The Squash TM webhook URL'
      },
      {
        required: false,
        name: :token,
        type: String,
        desc: 'The secret token'
      }
    ]
  }
end