terrars-integrations-github 0.1.0

Pre-generated Terrars Github bindings
Documentation
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
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
957
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
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
use serde::Serialize;
use std::cell::RefCell;
use std::rc::Rc;
use terrars::*;
use super::provider::ProviderGithub;

#[derive(Serialize)]
struct RepositoryData {
    #[serde(skip_serializing_if = "Vec::is_empty")]
    depends_on: Vec<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    provider: Option<String>,
    #[serde(skip_serializing_if = "SerdeSkipDefault::is_default")]
    lifecycle: ResourceLifecycle,
    #[serde(skip_serializing_if = "Option::is_none")]
    for_each: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_auto_merge: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_merge_commit: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_rebase_merge: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_squash_merge: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    allow_update_branch: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    archive_on_destroy: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    archived: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    auto_init: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    default_branch: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    delete_branch_on_merge: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    description: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    gitignore_template: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    has_discussions: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    has_downloads: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    has_issues: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    has_projects: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    has_wiki: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    homepage_url: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    id: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    ignore_vulnerability_alerts_during_read: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    is_template: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    license_template: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    merge_commit_message: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    merge_commit_title: Option<PrimField<String>>,
    name: PrimField<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    private: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    squash_merge_commit_message: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    squash_merge_commit_title: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    topics: Option<SetField<PrimField<String>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    visibility: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    vulnerability_alerts: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    web_commit_signoff_required: Option<PrimField<bool>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pages: Option<Vec<RepositoryPagesEl>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    security_and_analysis: Option<Vec<RepositorySecurityAndAnalysisEl>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    template: Option<Vec<RepositoryTemplateEl>>,
    dynamic: RepositoryDynamic,
}

struct Repository_ {
    shared: StackShared,
    tf_id: String,
    data: RefCell<RepositoryData>,
}

#[derive(Clone)]
pub struct Repository(Rc<Repository_>);

impl Repository {
    fn shared(&self) -> &StackShared {
        &self.0.shared
    }

    pub fn depends_on(self, dep: &impl Referable) -> Self {
        self.0.data.borrow_mut().depends_on.push(dep.extract_ref());
        self
    }

    pub fn set_provider(self, provider: &ProviderGithub) -> Self {
        self.0.data.borrow_mut().provider = Some(provider.provider_ref());
        self
    }

    pub fn set_create_before_destroy(self, v: bool) -> Self {
        self.0.data.borrow_mut().lifecycle.create_before_destroy = v;
        self
    }

    pub fn set_prevent_destroy(self, v: bool) -> Self {
        self.0.data.borrow_mut().lifecycle.prevent_destroy = v;
        self
    }

    pub fn ignore_changes_to_all(self) -> Self {
        self.0.data.borrow_mut().lifecycle.ignore_changes = Some(IgnoreChanges::All(IgnoreChangesAll::All));
        self
    }

    pub fn ignore_changes_to_attr(self, attr: impl ToString) -> Self {
        {
            let mut d = self.0.data.borrow_mut();
            if match &mut d.lifecycle.ignore_changes {
                Some(i) => match i {
                    IgnoreChanges::All(_) => {
                        true
                    },
                    IgnoreChanges::Refs(r) => {
                        r.push(attr.to_string());
                        false
                    },
                },
                None => true,
            } {
                d.lifecycle.ignore_changes = Some(IgnoreChanges::Refs(vec![attr.to_string()]));
            }
        }
        self
    }

    pub fn replace_triggered_by_resource(self, r: &impl Resource) -> Self {
        self.0.data.borrow_mut().lifecycle.replace_triggered_by.push(r.extract_ref());
        self
    }

    pub fn replace_triggered_by_attr(self, attr: impl ToString) -> Self {
        self.0.data.borrow_mut().lifecycle.replace_triggered_by.push(attr.to_string());
        self
    }

    #[doc= "Set the field `allow_auto_merge`.\nSet to 'true' to allow auto-merging pull requests on the repository."]
    pub fn set_allow_auto_merge(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().allow_auto_merge = Some(v.into());
        self
    }

    #[doc= "Set the field `allow_merge_commit`.\nSet to 'false' to disable merge commits on the repository."]
    pub fn set_allow_merge_commit(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().allow_merge_commit = Some(v.into());
        self
    }

    #[doc= "Set the field `allow_rebase_merge`.\nSet to 'false' to disable rebase merges on the repository."]
    pub fn set_allow_rebase_merge(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().allow_rebase_merge = Some(v.into());
        self
    }

    #[doc= "Set the field `allow_squash_merge`.\nSet to 'false' to disable squash merges on the repository."]
    pub fn set_allow_squash_merge(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().allow_squash_merge = Some(v.into());
        self
    }

    #[doc= "Set the field `allow_update_branch`.\n Set to 'true' to always suggest updating pull request branches."]
    pub fn set_allow_update_branch(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().allow_update_branch = Some(v.into());
        self
    }

    #[doc= "Set the field `archive_on_destroy`.\nSet to 'true' to archive the repository instead of deleting on destroy."]
    pub fn set_archive_on_destroy(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().archive_on_destroy = Some(v.into());
        self
    }

    #[doc= "Set the field `archived`.\nSpecifies if the repository should be archived. Defaults to 'false'. NOTE Currently, the API does not support unarchiving."]
    pub fn set_archived(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().archived = Some(v.into());
        self
    }

    #[doc= "Set the field `auto_init`.\nSet to 'true' to produce an initial commit in the repository."]
    pub fn set_auto_init(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().auto_init = Some(v.into());
        self
    }

    #[doc= "Set the field `default_branch`.\nCan only be set after initial repository creation, and only if the target branch exists"]
    pub fn set_default_branch(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().default_branch = Some(v.into());
        self
    }

    #[doc= "Set the field `delete_branch_on_merge`.\nAutomatically delete head branch after a pull request is merged. Defaults to 'false'."]
    pub fn set_delete_branch_on_merge(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().delete_branch_on_merge = Some(v.into());
        self
    }

    #[doc= "Set the field `description`.\nA description of the repository."]
    pub fn set_description(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().description = Some(v.into());
        self
    }

    #[doc= "Set the field `gitignore_template`.\nUse the name of the template without the extension. For example, 'Haskell'."]
    pub fn set_gitignore_template(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().gitignore_template = Some(v.into());
        self
    }

    #[doc= "Set the field `has_discussions`.\nSet to 'true' to enable GitHub Discussions on the repository. Defaults to 'false'."]
    pub fn set_has_discussions(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().has_discussions = Some(v.into());
        self
    }

    #[doc= "Set the field `has_downloads`.\nSet to 'true' to enable the (deprecated) downloads features on the repository."]
    pub fn set_has_downloads(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().has_downloads = Some(v.into());
        self
    }

    #[doc= "Set the field `has_issues`.\nSet to 'true' to enable the GitHub Issues features on the repository"]
    pub fn set_has_issues(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().has_issues = Some(v.into());
        self
    }

    #[doc= "Set the field `has_projects`.\nSet to 'true' to enable the GitHub Projects features on the repository. Per the GitHub documentation when in an organization that has disabled repository projects it will default to 'false' and will otherwise default to 'true'. If you specify 'true' when it has been disabled it will return an error."]
    pub fn set_has_projects(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().has_projects = Some(v.into());
        self
    }

    #[doc= "Set the field `has_wiki`.\nSet to 'true' to enable the GitHub Wiki features on the repository."]
    pub fn set_has_wiki(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().has_wiki = Some(v.into());
        self
    }

    #[doc= "Set the field `homepage_url`.\nURL of a page describing the project."]
    pub fn set_homepage_url(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().homepage_url = Some(v.into());
        self
    }

    #[doc= "Set the field `id`.\n"]
    pub fn set_id(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().id = Some(v.into());
        self
    }

    #[doc= "Set the field `ignore_vulnerability_alerts_during_read`.\nSet to true to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read."]
    pub fn set_ignore_vulnerability_alerts_during_read(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().ignore_vulnerability_alerts_during_read = Some(v.into());
        self
    }

    #[doc= "Set the field `is_template`.\nSet to 'true' to tell GitHub that this is a template repository."]
    pub fn set_is_template(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().is_template = Some(v.into());
        self
    }

    #[doc= "Set the field `license_template`.\nUse the name of the template without the extension. For example, 'mit' or 'mpl-2.0'."]
    pub fn set_license_template(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().license_template = Some(v.into());
        self
    }

    #[doc= "Set the field `merge_commit_message`.\nCan be 'PR_BODY', 'PR_TITLE', or 'BLANK' for a default merge commit message."]
    pub fn set_merge_commit_message(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().merge_commit_message = Some(v.into());
        self
    }

    #[doc= "Set the field `merge_commit_title`.\nCan be 'PR_TITLE' or 'MERGE_MESSAGE' for a default merge commit title."]
    pub fn set_merge_commit_title(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().merge_commit_title = Some(v.into());
        self
    }

    #[doc= "Set the field `private`.\n"]
    pub fn set_private(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().private = Some(v.into());
        self
    }

    #[doc= "Set the field `squash_merge_commit_message`.\nCan be 'PR_BODY', 'COMMIT_MESSAGES', or 'BLANK' for a default squash merge commit message."]
    pub fn set_squash_merge_commit_message(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().squash_merge_commit_message = Some(v.into());
        self
    }

    #[doc= "Set the field `squash_merge_commit_title`.\nCan be 'PR_TITLE' or 'COMMIT_OR_PR_TITLE' for a default squash merge commit title."]
    pub fn set_squash_merge_commit_title(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().squash_merge_commit_title = Some(v.into());
        self
    }

    #[doc= "Set the field `topics`.\nThe list of topics of the repository."]
    pub fn set_topics(self, v: impl Into<SetField<PrimField<String>>>) -> Self {
        self.0.data.borrow_mut().topics = Some(v.into());
        self
    }

    #[doc= "Set the field `visibility`.\nCan be 'public' or 'private'. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be 'internal'."]
    pub fn set_visibility(self, v: impl Into<PrimField<String>>) -> Self {
        self.0.data.borrow_mut().visibility = Some(v.into());
        self
    }

    #[doc= "Set the field `vulnerability_alerts`.\nSet to 'true' to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default). Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings."]
    pub fn set_vulnerability_alerts(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().vulnerability_alerts = Some(v.into());
        self
    }

    #[doc= "Set the field `web_commit_signoff_required`.\nRequire contributors to sign off on web-based commits. Defaults to 'false'."]
    pub fn set_web_commit_signoff_required(self, v: impl Into<PrimField<bool>>) -> Self {
        self.0.data.borrow_mut().web_commit_signoff_required = Some(v.into());
        self
    }

    #[doc= "Set the field `pages`.\n"]
    pub fn set_pages(self, v: impl Into<BlockAssignable<RepositoryPagesEl>>) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.0.data.borrow_mut().pages = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.0.data.borrow_mut().dynamic.pages = Some(d);
            },
        }
        self
    }

    #[doc= "Set the field `security_and_analysis`.\n"]
    pub fn set_security_and_analysis(self, v: impl Into<BlockAssignable<RepositorySecurityAndAnalysisEl>>) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.0.data.borrow_mut().security_and_analysis = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.0.data.borrow_mut().dynamic.security_and_analysis = Some(d);
            },
        }
        self
    }

    #[doc= "Set the field `template`.\n"]
    pub fn set_template(self, v: impl Into<BlockAssignable<RepositoryTemplateEl>>) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.0.data.borrow_mut().template = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.0.data.borrow_mut().dynamic.template = Some(d);
            },
        }
        self
    }

    #[doc= "Get a reference to the value of field `allow_auto_merge` after provisioning.\nSet to 'true' to allow auto-merging pull requests on the repository."]
    pub fn allow_auto_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_auto_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_merge_commit` after provisioning.\nSet to 'false' to disable merge commits on the repository."]
    pub fn allow_merge_commit(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_merge_commit", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_rebase_merge` after provisioning.\nSet to 'false' to disable rebase merges on the repository."]
    pub fn allow_rebase_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_rebase_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_squash_merge` after provisioning.\nSet to 'false' to disable squash merges on the repository."]
    pub fn allow_squash_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_squash_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_update_branch` after provisioning.\n Set to 'true' to always suggest updating pull request branches."]
    pub fn allow_update_branch(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_update_branch", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `archive_on_destroy` after provisioning.\nSet to 'true' to archive the repository instead of deleting on destroy."]
    pub fn archive_on_destroy(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.archive_on_destroy", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `archived` after provisioning.\nSpecifies if the repository should be archived. Defaults to 'false'. NOTE Currently, the API does not support unarchiving."]
    pub fn archived(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.archived", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `auto_init` after provisioning.\nSet to 'true' to produce an initial commit in the repository."]
    pub fn auto_init(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.auto_init", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `default_branch` after provisioning.\nCan only be set after initial repository creation, and only if the target branch exists"]
    pub fn default_branch(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.default_branch", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `delete_branch_on_merge` after provisioning.\nAutomatically delete head branch after a pull request is merged. Defaults to 'false'."]
    pub fn delete_branch_on_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.delete_branch_on_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `description` after provisioning.\nA description of the repository."]
    pub fn description(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.description", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `etag` after provisioning.\n"]
    pub fn etag(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.etag", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `full_name` after provisioning.\nA string of the form 'orgname/reponame'."]
    pub fn full_name(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.full_name", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `git_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository anonymously via the git protocol."]
    pub fn git_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.git_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `gitignore_template` after provisioning.\nUse the name of the template without the extension. For example, 'Haskell'."]
    pub fn gitignore_template(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.gitignore_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_discussions` after provisioning.\nSet to 'true' to enable GitHub Discussions on the repository. Defaults to 'false'."]
    pub fn has_discussions(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_discussions", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_downloads` after provisioning.\nSet to 'true' to enable the (deprecated) downloads features on the repository."]
    pub fn has_downloads(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_downloads", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_issues` after provisioning.\nSet to 'true' to enable the GitHub Issues features on the repository"]
    pub fn has_issues(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_issues", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_projects` after provisioning.\nSet to 'true' to enable the GitHub Projects features on the repository. Per the GitHub documentation when in an organization that has disabled repository projects it will default to 'false' and will otherwise default to 'true'. If you specify 'true' when it has been disabled it will return an error."]
    pub fn has_projects(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_projects", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_wiki` after provisioning.\nSet to 'true' to enable the GitHub Wiki features on the repository."]
    pub fn has_wiki(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_wiki", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `homepage_url` after provisioning.\nURL of a page describing the project."]
    pub fn homepage_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.homepage_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `html_url` after provisioning.\nURL to the repository on the web."]
    pub fn html_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.html_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `http_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository via HTTPS."]
    pub fn http_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.http_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `id` after provisioning.\n"]
    pub fn id(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `ignore_vulnerability_alerts_during_read` after provisioning.\nSet to true to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read."]
    pub fn ignore_vulnerability_alerts_during_read(&self) -> PrimExpr<bool> {
        PrimExpr::new(
            self.shared().clone(),
            format!("{}.ignore_vulnerability_alerts_during_read", self.extract_ref()),
        )
    }

    #[doc= "Get a reference to the value of field `is_template` after provisioning.\nSet to 'true' to tell GitHub that this is a template repository."]
    pub fn is_template(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.is_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `license_template` after provisioning.\nUse the name of the template without the extension. For example, 'mit' or 'mpl-2.0'."]
    pub fn license_template(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.license_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `merge_commit_message` after provisioning.\nCan be 'PR_BODY', 'PR_TITLE', or 'BLANK' for a default merge commit message."]
    pub fn merge_commit_message(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.merge_commit_message", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `merge_commit_title` after provisioning.\nCan be 'PR_TITLE' or 'MERGE_MESSAGE' for a default merge commit title."]
    pub fn merge_commit_title(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.merge_commit_title", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `name` after provisioning.\nThe name of the repository."]
    pub fn name(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.name", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `node_id` after provisioning.\nGraphQL global node id for use with v4 API."]
    pub fn node_id(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.node_id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `primary_language` after provisioning.\n"]
    pub fn primary_language(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.primary_language", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `private` after provisioning.\n"]
    pub fn private(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.private", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `repo_id` after provisioning.\nGitHub ID for the repository."]
    pub fn repo_id(&self) -> PrimExpr<f64> {
        PrimExpr::new(self.shared().clone(), format!("{}.repo_id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `squash_merge_commit_message` after provisioning.\nCan be 'PR_BODY', 'COMMIT_MESSAGES', or 'BLANK' for a default squash merge commit message."]
    pub fn squash_merge_commit_message(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.squash_merge_commit_message", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `squash_merge_commit_title` after provisioning.\nCan be 'PR_TITLE' or 'COMMIT_OR_PR_TITLE' for a default squash merge commit title."]
    pub fn squash_merge_commit_title(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.squash_merge_commit_title", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `ssh_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository via SSH."]
    pub fn ssh_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.ssh_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `svn_url` after provisioning.\nURL that can be provided to 'svn checkout' to check out the repository via GitHub's Subversion protocol emulation."]
    pub fn svn_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.svn_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `topics` after provisioning.\nThe list of topics of the repository."]
    pub fn topics(&self) -> SetRef<PrimExpr<String>> {
        SetRef::new(self.shared().clone(), format!("{}.topics", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `visibility` after provisioning.\nCan be 'public' or 'private'. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be 'internal'."]
    pub fn visibility(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.visibility", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `vulnerability_alerts` after provisioning.\nSet to 'true' to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default). Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings."]
    pub fn vulnerability_alerts(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.vulnerability_alerts", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `web_commit_signoff_required` after provisioning.\nRequire contributors to sign off on web-based commits. Defaults to 'false'."]
    pub fn web_commit_signoff_required(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.web_commit_signoff_required", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `pages` after provisioning.\n"]
    pub fn pages(&self) -> ListRef<RepositoryPagesElRef> {
        ListRef::new(self.shared().clone(), format!("{}.pages", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `security_and_analysis` after provisioning.\n"]
    pub fn security_and_analysis(&self) -> ListRef<RepositorySecurityAndAnalysisElRef> {
        ListRef::new(self.shared().clone(), format!("{}.security_and_analysis", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `template` after provisioning.\n"]
    pub fn template(&self) -> ListRef<RepositoryTemplateElRef> {
        ListRef::new(self.shared().clone(), format!("{}.template", self.extract_ref()))
    }
}

impl Referable for Repository {
    fn extract_ref(&self) -> String {
        format!("{}.{}", self.0.extract_resource_type(), self.0.extract_tf_id())
    }
}

impl Resource for Repository { }

impl ToListMappable for Repository {
    type O = ListRef<RepositoryRef>;

    fn do_map(self, base: String) -> Self::O {
        self.0.data.borrow_mut().for_each = Some(format!("${{{}}}", base));
        ListRef::new(self.0.shared.clone(), self.extract_ref())
    }
}

impl Resource_ for Repository_ {
    fn extract_resource_type(&self) -> String {
        "github_repository".into()
    }

    fn extract_tf_id(&self) -> String {
        self.tf_id.clone()
    }

    fn extract_value(&self) -> serde_json::Value {
        serde_json::to_value(&self.data).unwrap()
    }
}

pub struct BuildRepository {
    pub tf_id: String,
    #[doc= "The name of the repository."]
    pub name: PrimField<String>,
}

impl BuildRepository {
    pub fn build(self, stack: &mut Stack) -> Repository {
        let out = Repository(Rc::new(Repository_ {
            shared: stack.shared.clone(),
            tf_id: self.tf_id,
            data: RefCell::new(RepositoryData {
                depends_on: core::default::Default::default(),
                provider: None,
                lifecycle: core::default::Default::default(),
                for_each: None,
                allow_auto_merge: core::default::Default::default(),
                allow_merge_commit: core::default::Default::default(),
                allow_rebase_merge: core::default::Default::default(),
                allow_squash_merge: core::default::Default::default(),
                allow_update_branch: core::default::Default::default(),
                archive_on_destroy: core::default::Default::default(),
                archived: core::default::Default::default(),
                auto_init: core::default::Default::default(),
                default_branch: core::default::Default::default(),
                delete_branch_on_merge: core::default::Default::default(),
                description: core::default::Default::default(),
                gitignore_template: core::default::Default::default(),
                has_discussions: core::default::Default::default(),
                has_downloads: core::default::Default::default(),
                has_issues: core::default::Default::default(),
                has_projects: core::default::Default::default(),
                has_wiki: core::default::Default::default(),
                homepage_url: core::default::Default::default(),
                id: core::default::Default::default(),
                ignore_vulnerability_alerts_during_read: core::default::Default::default(),
                is_template: core::default::Default::default(),
                license_template: core::default::Default::default(),
                merge_commit_message: core::default::Default::default(),
                merge_commit_title: core::default::Default::default(),
                name: self.name,
                private: core::default::Default::default(),
                squash_merge_commit_message: core::default::Default::default(),
                squash_merge_commit_title: core::default::Default::default(),
                topics: core::default::Default::default(),
                visibility: core::default::Default::default(),
                vulnerability_alerts: core::default::Default::default(),
                web_commit_signoff_required: core::default::Default::default(),
                pages: core::default::Default::default(),
                security_and_analysis: core::default::Default::default(),
                template: core::default::Default::default(),
                dynamic: Default::default(),
            }),
        }));
        stack.add_resource(out.0.clone());
        out
    }
}

pub struct RepositoryRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositoryRef {
    fn new(shared: StackShared, base: String) -> Self {
        Self {
            shared: shared,
            base: base,
        }
    }
}

impl RepositoryRef {
    fn extract_ref(&self) -> String {
        self.base.clone()
    }

    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `allow_auto_merge` after provisioning.\nSet to 'true' to allow auto-merging pull requests on the repository."]
    pub fn allow_auto_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_auto_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_merge_commit` after provisioning.\nSet to 'false' to disable merge commits on the repository."]
    pub fn allow_merge_commit(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_merge_commit", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_rebase_merge` after provisioning.\nSet to 'false' to disable rebase merges on the repository."]
    pub fn allow_rebase_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_rebase_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_squash_merge` after provisioning.\nSet to 'false' to disable squash merges on the repository."]
    pub fn allow_squash_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_squash_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `allow_update_branch` after provisioning.\n Set to 'true' to always suggest updating pull request branches."]
    pub fn allow_update_branch(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.allow_update_branch", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `archive_on_destroy` after provisioning.\nSet to 'true' to archive the repository instead of deleting on destroy."]
    pub fn archive_on_destroy(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.archive_on_destroy", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `archived` after provisioning.\nSpecifies if the repository should be archived. Defaults to 'false'. NOTE Currently, the API does not support unarchiving."]
    pub fn archived(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.archived", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `auto_init` after provisioning.\nSet to 'true' to produce an initial commit in the repository."]
    pub fn auto_init(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.auto_init", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `default_branch` after provisioning.\nCan only be set after initial repository creation, and only if the target branch exists"]
    pub fn default_branch(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.default_branch", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `delete_branch_on_merge` after provisioning.\nAutomatically delete head branch after a pull request is merged. Defaults to 'false'."]
    pub fn delete_branch_on_merge(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.delete_branch_on_merge", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `description` after provisioning.\nA description of the repository."]
    pub fn description(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.description", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `etag` after provisioning.\n"]
    pub fn etag(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.etag", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `full_name` after provisioning.\nA string of the form 'orgname/reponame'."]
    pub fn full_name(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.full_name", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `git_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository anonymously via the git protocol."]
    pub fn git_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.git_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `gitignore_template` after provisioning.\nUse the name of the template without the extension. For example, 'Haskell'."]
    pub fn gitignore_template(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.gitignore_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_discussions` after provisioning.\nSet to 'true' to enable GitHub Discussions on the repository. Defaults to 'false'."]
    pub fn has_discussions(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_discussions", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_downloads` after provisioning.\nSet to 'true' to enable the (deprecated) downloads features on the repository."]
    pub fn has_downloads(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_downloads", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_issues` after provisioning.\nSet to 'true' to enable the GitHub Issues features on the repository"]
    pub fn has_issues(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_issues", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_projects` after provisioning.\nSet to 'true' to enable the GitHub Projects features on the repository. Per the GitHub documentation when in an organization that has disabled repository projects it will default to 'false' and will otherwise default to 'true'. If you specify 'true' when it has been disabled it will return an error."]
    pub fn has_projects(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_projects", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `has_wiki` after provisioning.\nSet to 'true' to enable the GitHub Wiki features on the repository."]
    pub fn has_wiki(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.has_wiki", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `homepage_url` after provisioning.\nURL of a page describing the project."]
    pub fn homepage_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.homepage_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `html_url` after provisioning.\nURL to the repository on the web."]
    pub fn html_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.html_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `http_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository via HTTPS."]
    pub fn http_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.http_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `id` after provisioning.\n"]
    pub fn id(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `ignore_vulnerability_alerts_during_read` after provisioning.\nSet to true to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read."]
    pub fn ignore_vulnerability_alerts_during_read(&self) -> PrimExpr<bool> {
        PrimExpr::new(
            self.shared().clone(),
            format!("{}.ignore_vulnerability_alerts_during_read", self.extract_ref()),
        )
    }

    #[doc= "Get a reference to the value of field `is_template` after provisioning.\nSet to 'true' to tell GitHub that this is a template repository."]
    pub fn is_template(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.is_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `license_template` after provisioning.\nUse the name of the template without the extension. For example, 'mit' or 'mpl-2.0'."]
    pub fn license_template(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.license_template", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `merge_commit_message` after provisioning.\nCan be 'PR_BODY', 'PR_TITLE', or 'BLANK' for a default merge commit message."]
    pub fn merge_commit_message(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.merge_commit_message", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `merge_commit_title` after provisioning.\nCan be 'PR_TITLE' or 'MERGE_MESSAGE' for a default merge commit title."]
    pub fn merge_commit_title(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.merge_commit_title", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `name` after provisioning.\nThe name of the repository."]
    pub fn name(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.name", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `node_id` after provisioning.\nGraphQL global node id for use with v4 API."]
    pub fn node_id(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.node_id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `primary_language` after provisioning.\n"]
    pub fn primary_language(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.primary_language", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `private` after provisioning.\n"]
    pub fn private(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.private", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `repo_id` after provisioning.\nGitHub ID for the repository."]
    pub fn repo_id(&self) -> PrimExpr<f64> {
        PrimExpr::new(self.shared().clone(), format!("{}.repo_id", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `squash_merge_commit_message` after provisioning.\nCan be 'PR_BODY', 'COMMIT_MESSAGES', or 'BLANK' for a default squash merge commit message."]
    pub fn squash_merge_commit_message(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.squash_merge_commit_message", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `squash_merge_commit_title` after provisioning.\nCan be 'PR_TITLE' or 'COMMIT_OR_PR_TITLE' for a default squash merge commit title."]
    pub fn squash_merge_commit_title(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.squash_merge_commit_title", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `ssh_clone_url` after provisioning.\nURL that can be provided to 'git clone' to clone the repository via SSH."]
    pub fn ssh_clone_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.ssh_clone_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `svn_url` after provisioning.\nURL that can be provided to 'svn checkout' to check out the repository via GitHub's Subversion protocol emulation."]
    pub fn svn_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.svn_url", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `topics` after provisioning.\nThe list of topics of the repository."]
    pub fn topics(&self) -> SetRef<PrimExpr<String>> {
        SetRef::new(self.shared().clone(), format!("{}.topics", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `visibility` after provisioning.\nCan be 'public' or 'private'. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be 'internal'."]
    pub fn visibility(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.visibility", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `vulnerability_alerts` after provisioning.\nSet to 'true' to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default). Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings."]
    pub fn vulnerability_alerts(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.vulnerability_alerts", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `web_commit_signoff_required` after provisioning.\nRequire contributors to sign off on web-based commits. Defaults to 'false'."]
    pub fn web_commit_signoff_required(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.web_commit_signoff_required", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `pages` after provisioning.\n"]
    pub fn pages(&self) -> ListRef<RepositoryPagesElRef> {
        ListRef::new(self.shared().clone(), format!("{}.pages", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `security_and_analysis` after provisioning.\n"]
    pub fn security_and_analysis(&self) -> ListRef<RepositorySecurityAndAnalysisElRef> {
        ListRef::new(self.shared().clone(), format!("{}.security_and_analysis", self.extract_ref()))
    }

    #[doc= "Get a reference to the value of field `template` after provisioning.\n"]
    pub fn template(&self) -> ListRef<RepositoryTemplateElRef> {
        ListRef::new(self.shared().clone(), format!("{}.template", self.extract_ref()))
    }
}

#[derive(Serialize)]
pub struct RepositoryPagesElSourceEl {
    branch: PrimField<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    path: Option<PrimField<String>>,
}

impl RepositoryPagesElSourceEl {
    #[doc= "Set the field `path`.\nThe repository directory from which the site publishes (Default: '/')"]
    pub fn set_path(mut self, v: impl Into<PrimField<String>>) -> Self {
        self.path = Some(v.into());
        self
    }
}

impl ToListMappable for RepositoryPagesElSourceEl {
    type O = BlockAssignable<RepositoryPagesElSourceEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositoryPagesElSourceEl {
    #[doc= "The repository branch used to publish the site's source files. (i.e. 'main' or 'gh-pages')"]
    pub branch: PrimField<String>,
}

impl BuildRepositoryPagesElSourceEl {
    pub fn build(self) -> RepositoryPagesElSourceEl {
        RepositoryPagesElSourceEl {
            branch: self.branch,
            path: core::default::Default::default(),
        }
    }
}

pub struct RepositoryPagesElSourceElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositoryPagesElSourceElRef {
    fn new(shared: StackShared, base: String) -> RepositoryPagesElSourceElRef {
        RepositoryPagesElSourceElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositoryPagesElSourceElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `branch` after provisioning.\nThe repository branch used to publish the site's source files. (i.e. 'main' or 'gh-pages')"]
    pub fn branch(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.branch", self.base))
    }

    #[doc= "Get a reference to the value of field `path` after provisioning.\nThe repository directory from which the site publishes (Default: '/')"]
    pub fn path(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.path", self.base))
    }
}

#[derive(Serialize, Default)]
struct RepositoryPagesElDynamic {
    source: Option<DynamicBlock<RepositoryPagesElSourceEl>>,
}

#[derive(Serialize)]
pub struct RepositoryPagesEl {
    #[serde(skip_serializing_if = "Option::is_none")]
    build_type: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    cname: Option<PrimField<String>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    source: Option<Vec<RepositoryPagesElSourceEl>>,
    dynamic: RepositoryPagesElDynamic,
}

impl RepositoryPagesEl {
    #[doc= "Set the field `build_type`.\nThe type the page should be sourced."]
    pub fn set_build_type(mut self, v: impl Into<PrimField<String>>) -> Self {
        self.build_type = Some(v.into());
        self
    }

    #[doc= "Set the field `cname`.\nThe custom domain for the repository. This can only be set after the repository has been created."]
    pub fn set_cname(mut self, v: impl Into<PrimField<String>>) -> Self {
        self.cname = Some(v.into());
        self
    }

    #[doc= "Set the field `source`.\n"]
    pub fn set_source(mut self, v: impl Into<BlockAssignable<RepositoryPagesElSourceEl>>) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.source = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.dynamic.source = Some(d);
            },
        }
        self
    }
}

impl ToListMappable for RepositoryPagesEl {
    type O = BlockAssignable<RepositoryPagesEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositoryPagesEl {}

impl BuildRepositoryPagesEl {
    pub fn build(self) -> RepositoryPagesEl {
        RepositoryPagesEl {
            build_type: core::default::Default::default(),
            cname: core::default::Default::default(),
            source: core::default::Default::default(),
            dynamic: Default::default(),
        }
    }
}

pub struct RepositoryPagesElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositoryPagesElRef {
    fn new(shared: StackShared, base: String) -> RepositoryPagesElRef {
        RepositoryPagesElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositoryPagesElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `build_type` after provisioning.\nThe type the page should be sourced."]
    pub fn build_type(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.build_type", self.base))
    }

    #[doc= "Get a reference to the value of field `cname` after provisioning.\nThe custom domain for the repository. This can only be set after the repository has been created."]
    pub fn cname(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.cname", self.base))
    }

    #[doc= "Get a reference to the value of field `custom_404` after provisioning.\nWhether the rendered GitHub Pages site has a custom 404 page"]
    pub fn custom_404(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.custom_404", self.base))
    }

    #[doc= "Get a reference to the value of field `html_url` after provisioning.\nURL to the repository on the web."]
    pub fn html_url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.html_url", self.base))
    }

    #[doc= "Get a reference to the value of field `status` after provisioning.\nThe GitHub Pages site's build status e.g. building or built."]
    pub fn status(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.status", self.base))
    }

    #[doc= "Get a reference to the value of field `url` after provisioning.\n"]
    pub fn url(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.url", self.base))
    }

    #[doc= "Get a reference to the value of field `source` after provisioning.\n"]
    pub fn source(&self) -> ListRef<RepositoryPagesElSourceElRef> {
        ListRef::new(self.shared().clone(), format!("{}.source", self.base))
    }
}

#[derive(Serialize)]
pub struct RepositorySecurityAndAnalysisElAdvancedSecurityEl {
    status: PrimField<String>,
}

impl RepositorySecurityAndAnalysisElAdvancedSecurityEl { }

impl ToListMappable for RepositorySecurityAndAnalysisElAdvancedSecurityEl {
    type O = BlockAssignable<RepositorySecurityAndAnalysisElAdvancedSecurityEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositorySecurityAndAnalysisElAdvancedSecurityEl {
    #[doc= "Set to 'enabled' to enable advanced security features on the repository. Can be 'enabled' or 'disabled'."]
    pub status: PrimField<String>,
}

impl BuildRepositorySecurityAndAnalysisElAdvancedSecurityEl {
    pub fn build(self) -> RepositorySecurityAndAnalysisElAdvancedSecurityEl {
        RepositorySecurityAndAnalysisElAdvancedSecurityEl { status: self.status }
    }
}

pub struct RepositorySecurityAndAnalysisElAdvancedSecurityElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositorySecurityAndAnalysisElAdvancedSecurityElRef {
    fn new(shared: StackShared, base: String) -> RepositorySecurityAndAnalysisElAdvancedSecurityElRef {
        RepositorySecurityAndAnalysisElAdvancedSecurityElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositorySecurityAndAnalysisElAdvancedSecurityElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `status` after provisioning.\nSet to 'enabled' to enable advanced security features on the repository. Can be 'enabled' or 'disabled'."]
    pub fn status(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.status", self.base))
    }
}

#[derive(Serialize)]
pub struct RepositorySecurityAndAnalysisElSecretScanningEl {
    status: PrimField<String>,
}

impl RepositorySecurityAndAnalysisElSecretScanningEl { }

impl ToListMappable for RepositorySecurityAndAnalysisElSecretScanningEl {
    type O = BlockAssignable<RepositorySecurityAndAnalysisElSecretScanningEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositorySecurityAndAnalysisElSecretScanningEl {
    #[doc= "Set to 'enabled' to enable secret scanning on the repository. Can be 'enabled' or 'disabled'. If set to 'enabled', the repository's visibility must be 'public' or 'security_and_analysis[0].advanced_security[0].status' must also be set to 'enabled'."]
    pub status: PrimField<String>,
}

impl BuildRepositorySecurityAndAnalysisElSecretScanningEl {
    pub fn build(self) -> RepositorySecurityAndAnalysisElSecretScanningEl {
        RepositorySecurityAndAnalysisElSecretScanningEl { status: self.status }
    }
}

pub struct RepositorySecurityAndAnalysisElSecretScanningElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositorySecurityAndAnalysisElSecretScanningElRef {
    fn new(shared: StackShared, base: String) -> RepositorySecurityAndAnalysisElSecretScanningElRef {
        RepositorySecurityAndAnalysisElSecretScanningElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositorySecurityAndAnalysisElSecretScanningElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `status` after provisioning.\nSet to 'enabled' to enable secret scanning on the repository. Can be 'enabled' or 'disabled'. If set to 'enabled', the repository's visibility must be 'public' or 'security_and_analysis[0].advanced_security[0].status' must also be set to 'enabled'."]
    pub fn status(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.status", self.base))
    }
}

#[derive(Serialize)]
pub struct RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl {
    status: PrimField<String>,
}

impl RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl { }

impl ToListMappable for RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl {
    type O = BlockAssignable<RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositorySecurityAndAnalysisElSecretScanningPushProtectionEl {
    #[doc= "Set to 'enabled' to enable secret scanning push protection on the repository. Can be 'enabled' or 'disabled'. If set to 'enabled', the repository's visibility must be 'public' or 'security_and_analysis[0].advanced_security[0].status' must also be set to 'enabled'."]
    pub status: PrimField<String>,
}

impl BuildRepositorySecurityAndAnalysisElSecretScanningPushProtectionEl {
    pub fn build(self) -> RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl {
        RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl { status: self.status }
    }
}

pub struct RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef {
    fn new(shared: StackShared, base: String) -> RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef {
        RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `status` after provisioning.\nSet to 'enabled' to enable secret scanning push protection on the repository. Can be 'enabled' or 'disabled'. If set to 'enabled', the repository's visibility must be 'public' or 'security_and_analysis[0].advanced_security[0].status' must also be set to 'enabled'."]
    pub fn status(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.status", self.base))
    }
}

#[derive(Serialize, Default)]
struct RepositorySecurityAndAnalysisElDynamic {
    advanced_security: Option<DynamicBlock<RepositorySecurityAndAnalysisElAdvancedSecurityEl>>,
    secret_scanning: Option<DynamicBlock<RepositorySecurityAndAnalysisElSecretScanningEl>>,
    secret_scanning_push_protection: Option<
        DynamicBlock<RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl>,
    >,
}

#[derive(Serialize)]
pub struct RepositorySecurityAndAnalysisEl {
    #[serde(skip_serializing_if = "Option::is_none")]
    advanced_security: Option<Vec<RepositorySecurityAndAnalysisElAdvancedSecurityEl>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    secret_scanning: Option<Vec<RepositorySecurityAndAnalysisElSecretScanningEl>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    secret_scanning_push_protection: Option<Vec<RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl>>,
    dynamic: RepositorySecurityAndAnalysisElDynamic,
}

impl RepositorySecurityAndAnalysisEl {
    #[doc= "Set the field `advanced_security`.\n"]
    pub fn set_advanced_security(
        mut self,
        v: impl Into<BlockAssignable<RepositorySecurityAndAnalysisElAdvancedSecurityEl>>,
    ) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.advanced_security = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.dynamic.advanced_security = Some(d);
            },
        }
        self
    }

    #[doc= "Set the field `secret_scanning`.\n"]
    pub fn set_secret_scanning(
        mut self,
        v: impl Into<BlockAssignable<RepositorySecurityAndAnalysisElSecretScanningEl>>,
    ) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.secret_scanning = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.dynamic.secret_scanning = Some(d);
            },
        }
        self
    }

    #[doc= "Set the field `secret_scanning_push_protection`.\n"]
    pub fn set_secret_scanning_push_protection(
        mut self,
        v: impl Into<BlockAssignable<RepositorySecurityAndAnalysisElSecretScanningPushProtectionEl>>,
    ) -> Self {
        match v.into() {
            BlockAssignable::Literal(v) => {
                self.secret_scanning_push_protection = Some(v);
            },
            BlockAssignable::Dynamic(d) => {
                self.dynamic.secret_scanning_push_protection = Some(d);
            },
        }
        self
    }
}

impl ToListMappable for RepositorySecurityAndAnalysisEl {
    type O = BlockAssignable<RepositorySecurityAndAnalysisEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositorySecurityAndAnalysisEl {}

impl BuildRepositorySecurityAndAnalysisEl {
    pub fn build(self) -> RepositorySecurityAndAnalysisEl {
        RepositorySecurityAndAnalysisEl {
            advanced_security: core::default::Default::default(),
            secret_scanning: core::default::Default::default(),
            secret_scanning_push_protection: core::default::Default::default(),
            dynamic: Default::default(),
        }
    }
}

pub struct RepositorySecurityAndAnalysisElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositorySecurityAndAnalysisElRef {
    fn new(shared: StackShared, base: String) -> RepositorySecurityAndAnalysisElRef {
        RepositorySecurityAndAnalysisElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositorySecurityAndAnalysisElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `advanced_security` after provisioning.\n"]
    pub fn advanced_security(&self) -> ListRef<RepositorySecurityAndAnalysisElAdvancedSecurityElRef> {
        ListRef::new(self.shared().clone(), format!("{}.advanced_security", self.base))
    }

    #[doc= "Get a reference to the value of field `secret_scanning` after provisioning.\n"]
    pub fn secret_scanning(&self) -> ListRef<RepositorySecurityAndAnalysisElSecretScanningElRef> {
        ListRef::new(self.shared().clone(), format!("{}.secret_scanning", self.base))
    }

    #[doc= "Get a reference to the value of field `secret_scanning_push_protection` after provisioning.\n"]
    pub fn secret_scanning_push_protection(
        &self,
    ) -> ListRef<RepositorySecurityAndAnalysisElSecretScanningPushProtectionElRef> {
        ListRef::new(self.shared().clone(), format!("{}.secret_scanning_push_protection", self.base))
    }
}

#[derive(Serialize)]
pub struct RepositoryTemplateEl {
    #[serde(skip_serializing_if = "Option::is_none")]
    include_all_branches: Option<PrimField<bool>>,
    owner: PrimField<String>,
    repository: PrimField<String>,
}

impl RepositoryTemplateEl {
    #[doc= "Set the field `include_all_branches`.\nWhether the new repository should include all the branches from the template repository (defaults to 'false', which includes only the default branch from the template)."]
    pub fn set_include_all_branches(mut self, v: impl Into<PrimField<bool>>) -> Self {
        self.include_all_branches = Some(v.into());
        self
    }
}

impl ToListMappable for RepositoryTemplateEl {
    type O = BlockAssignable<RepositoryTemplateEl>;

    fn do_map(self, base: String) -> Self::O {
        BlockAssignable::Dynamic(DynamicBlock {
            for_each: format!("${{{}}}", base),
            iterator: "each".into(),
            content: self,
        })
    }
}

pub struct BuildRepositoryTemplateEl {
    #[doc= "The GitHub organization or user the template repository is owned by."]
    pub owner: PrimField<String>,
    #[doc= "The name of the template repository."]
    pub repository: PrimField<String>,
}

impl BuildRepositoryTemplateEl {
    pub fn build(self) -> RepositoryTemplateEl {
        RepositoryTemplateEl {
            include_all_branches: core::default::Default::default(),
            owner: self.owner,
            repository: self.repository,
        }
    }
}

pub struct RepositoryTemplateElRef {
    shared: StackShared,
    base: String,
}

impl Ref for RepositoryTemplateElRef {
    fn new(shared: StackShared, base: String) -> RepositoryTemplateElRef {
        RepositoryTemplateElRef {
            shared: shared,
            base: base.to_string(),
        }
    }
}

impl RepositoryTemplateElRef {
    fn shared(&self) -> &StackShared {
        &self.shared
    }

    #[doc= "Get a reference to the value of field `include_all_branches` after provisioning.\nWhether the new repository should include all the branches from the template repository (defaults to 'false', which includes only the default branch from the template)."]
    pub fn include_all_branches(&self) -> PrimExpr<bool> {
        PrimExpr::new(self.shared().clone(), format!("{}.include_all_branches", self.base))
    }

    #[doc= "Get a reference to the value of field `owner` after provisioning.\nThe GitHub organization or user the template repository is owned by."]
    pub fn owner(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.owner", self.base))
    }

    #[doc= "Get a reference to the value of field `repository` after provisioning.\nThe name of the template repository."]
    pub fn repository(&self) -> PrimExpr<String> {
        PrimExpr::new(self.shared().clone(), format!("{}.repository", self.base))
    }
}

#[derive(Serialize, Default)]
struct RepositoryDynamic {
    pages: Option<DynamicBlock<RepositoryPagesEl>>,
    security_and_analysis: Option<DynamicBlock<RepositorySecurityAndAnalysisEl>>,
    template: Option<DynamicBlock<RepositoryTemplateEl>>,
}