-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathentity_create.go
More file actions
2421 lines (2221 loc) · 73.4 KB
/
Copy pathentity_create.go
File metadata and controls
2421 lines (2221 loc) · 73.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
// Code generated by ent, DO NOT EDIT.
package generated
import (
"context"
"fmt"
"time"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"github.com/theopenlane/core/common/enums"
"github.com/theopenlane/core/common/models"
"github.com/theopenlane/core/internal/ent/generated/assessmentresponse"
"github.com/theopenlane/core/internal/ent/generated/asset"
"github.com/theopenlane/core/internal/ent/generated/campaign"
"github.com/theopenlane/core/internal/ent/generated/contact"
"github.com/theopenlane/core/internal/ent/generated/control"
"github.com/theopenlane/core/internal/ent/generated/customtypeenum"
"github.com/theopenlane/core/internal/ent/generated/documentdata"
"github.com/theopenlane/core/internal/ent/generated/entity"
"github.com/theopenlane/core/internal/ent/generated/entitytype"
"github.com/theopenlane/core/internal/ent/generated/file"
"github.com/theopenlane/core/internal/ent/generated/group"
"github.com/theopenlane/core/internal/ent/generated/identityholder"
"github.com/theopenlane/core/internal/ent/generated/integration"
"github.com/theopenlane/core/internal/ent/generated/internalpolicy"
"github.com/theopenlane/core/internal/ent/generated/note"
"github.com/theopenlane/core/internal/ent/generated/organization"
"github.com/theopenlane/core/internal/ent/generated/platform"
"github.com/theopenlane/core/internal/ent/generated/scan"
"github.com/theopenlane/core/internal/ent/generated/subcontrol"
"github.com/theopenlane/core/internal/ent/generated/subprocessor"
"github.com/theopenlane/core/internal/ent/generated/user"
"github.com/theopenlane/core/internal/ent/generated/vendorriskscore"
)
// EntityCreate is the builder for creating a Entity entity.
type EntityCreate struct {
config
mutation *EntityMutation
hooks []Hook
}
// SetCreatedAt sets the "created_at" field.
func (_c *EntityCreate) SetCreatedAt(v time.Time) *EntityCreate {
_c.mutation.SetCreatedAt(v)
return _c
}
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableCreatedAt(v *time.Time) *EntityCreate {
if v != nil {
_c.SetCreatedAt(*v)
}
return _c
}
// SetUpdatedAt sets the "updated_at" field.
func (_c *EntityCreate) SetUpdatedAt(v time.Time) *EntityCreate {
_c.mutation.SetUpdatedAt(v)
return _c
}
// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableUpdatedAt(v *time.Time) *EntityCreate {
if v != nil {
_c.SetUpdatedAt(*v)
}
return _c
}
// SetCreatedBy sets the "created_by" field.
func (_c *EntityCreate) SetCreatedBy(v string) *EntityCreate {
_c.mutation.SetCreatedBy(v)
return _c
}
// SetNillableCreatedBy sets the "created_by" field if the given value is not nil.
func (_c *EntityCreate) SetNillableCreatedBy(v *string) *EntityCreate {
if v != nil {
_c.SetCreatedBy(*v)
}
return _c
}
// SetUpdatedBy sets the "updated_by" field.
func (_c *EntityCreate) SetUpdatedBy(v string) *EntityCreate {
_c.mutation.SetUpdatedBy(v)
return _c
}
// SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.
func (_c *EntityCreate) SetNillableUpdatedBy(v *string) *EntityCreate {
if v != nil {
_c.SetUpdatedBy(*v)
}
return _c
}
// SetDeletedAt sets the "deleted_at" field.
func (_c *EntityCreate) SetDeletedAt(v time.Time) *EntityCreate {
_c.mutation.SetDeletedAt(v)
return _c
}
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableDeletedAt(v *time.Time) *EntityCreate {
if v != nil {
_c.SetDeletedAt(*v)
}
return _c
}
// SetDeletedBy sets the "deleted_by" field.
func (_c *EntityCreate) SetDeletedBy(v string) *EntityCreate {
_c.mutation.SetDeletedBy(v)
return _c
}
// SetNillableDeletedBy sets the "deleted_by" field if the given value is not nil.
func (_c *EntityCreate) SetNillableDeletedBy(v *string) *EntityCreate {
if v != nil {
_c.SetDeletedBy(*v)
}
return _c
}
// SetTags sets the "tags" field.
func (_c *EntityCreate) SetTags(v []string) *EntityCreate {
_c.mutation.SetTags(v)
return _c
}
// SetOwnerID sets the "owner_id" field.
func (_c *EntityCreate) SetOwnerID(v string) *EntityCreate {
_c.mutation.SetOwnerID(v)
return _c
}
// SetNillableOwnerID sets the "owner_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableOwnerID(v *string) *EntityCreate {
if v != nil {
_c.SetOwnerID(*v)
}
return _c
}
// SetInternalOwner sets the "internal_owner" field.
func (_c *EntityCreate) SetInternalOwner(v string) *EntityCreate {
_c.mutation.SetInternalOwner(v)
return _c
}
// SetNillableInternalOwner sets the "internal_owner" field if the given value is not nil.
func (_c *EntityCreate) SetNillableInternalOwner(v *string) *EntityCreate {
if v != nil {
_c.SetInternalOwner(*v)
}
return _c
}
// SetInternalOwnerUserID sets the "internal_owner_user_id" field.
func (_c *EntityCreate) SetInternalOwnerUserID(v string) *EntityCreate {
_c.mutation.SetInternalOwnerUserID(v)
return _c
}
// SetNillableInternalOwnerUserID sets the "internal_owner_user_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableInternalOwnerUserID(v *string) *EntityCreate {
if v != nil {
_c.SetInternalOwnerUserID(*v)
}
return _c
}
// SetInternalOwnerGroupID sets the "internal_owner_group_id" field.
func (_c *EntityCreate) SetInternalOwnerGroupID(v string) *EntityCreate {
_c.mutation.SetInternalOwnerGroupID(v)
return _c
}
// SetNillableInternalOwnerGroupID sets the "internal_owner_group_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableInternalOwnerGroupID(v *string) *EntityCreate {
if v != nil {
_c.SetInternalOwnerGroupID(*v)
}
return _c
}
// SetReviewedBy sets the "reviewed_by" field.
func (_c *EntityCreate) SetReviewedBy(v string) *EntityCreate {
_c.mutation.SetReviewedBy(v)
return _c
}
// SetNillableReviewedBy sets the "reviewed_by" field if the given value is not nil.
func (_c *EntityCreate) SetNillableReviewedBy(v *string) *EntityCreate {
if v != nil {
_c.SetReviewedBy(*v)
}
return _c
}
// SetReviewedByUserID sets the "reviewed_by_user_id" field.
func (_c *EntityCreate) SetReviewedByUserID(v string) *EntityCreate {
_c.mutation.SetReviewedByUserID(v)
return _c
}
// SetNillableReviewedByUserID sets the "reviewed_by_user_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableReviewedByUserID(v *string) *EntityCreate {
if v != nil {
_c.SetReviewedByUserID(*v)
}
return _c
}
// SetReviewedByGroupID sets the "reviewed_by_group_id" field.
func (_c *EntityCreate) SetReviewedByGroupID(v string) *EntityCreate {
_c.mutation.SetReviewedByGroupID(v)
return _c
}
// SetNillableReviewedByGroupID sets the "reviewed_by_group_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableReviewedByGroupID(v *string) *EntityCreate {
if v != nil {
_c.SetReviewedByGroupID(*v)
}
return _c
}
// SetLastReviewedAt sets the "last_reviewed_at" field.
func (_c *EntityCreate) SetLastReviewedAt(v models.DateTime) *EntityCreate {
_c.mutation.SetLastReviewedAt(v)
return _c
}
// SetNillableLastReviewedAt sets the "last_reviewed_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableLastReviewedAt(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetLastReviewedAt(*v)
}
return _c
}
// SetSystemOwned sets the "system_owned" field.
func (_c *EntityCreate) SetSystemOwned(v bool) *EntityCreate {
_c.mutation.SetSystemOwned(v)
return _c
}
// SetNillableSystemOwned sets the "system_owned" field if the given value is not nil.
func (_c *EntityCreate) SetNillableSystemOwned(v *bool) *EntityCreate {
if v != nil {
_c.SetSystemOwned(*v)
}
return _c
}
// SetInternalNotes sets the "internal_notes" field.
func (_c *EntityCreate) SetInternalNotes(v string) *EntityCreate {
_c.mutation.SetInternalNotes(v)
return _c
}
// SetNillableInternalNotes sets the "internal_notes" field if the given value is not nil.
func (_c *EntityCreate) SetNillableInternalNotes(v *string) *EntityCreate {
if v != nil {
_c.SetInternalNotes(*v)
}
return _c
}
// SetSystemInternalID sets the "system_internal_id" field.
func (_c *EntityCreate) SetSystemInternalID(v string) *EntityCreate {
_c.mutation.SetSystemInternalID(v)
return _c
}
// SetNillableSystemInternalID sets the "system_internal_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableSystemInternalID(v *string) *EntityCreate {
if v != nil {
_c.SetSystemInternalID(*v)
}
return _c
}
// SetEntityRelationshipStateName sets the "entity_relationship_state_name" field.
func (_c *EntityCreate) SetEntityRelationshipStateName(v string) *EntityCreate {
_c.mutation.SetEntityRelationshipStateName(v)
return _c
}
// SetNillableEntityRelationshipStateName sets the "entity_relationship_state_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntityRelationshipStateName(v *string) *EntityCreate {
if v != nil {
_c.SetEntityRelationshipStateName(*v)
}
return _c
}
// SetEntityRelationshipStateID sets the "entity_relationship_state_id" field.
func (_c *EntityCreate) SetEntityRelationshipStateID(v string) *EntityCreate {
_c.mutation.SetEntityRelationshipStateID(v)
return _c
}
// SetNillableEntityRelationshipStateID sets the "entity_relationship_state_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntityRelationshipStateID(v *string) *EntityCreate {
if v != nil {
_c.SetEntityRelationshipStateID(*v)
}
return _c
}
// SetEntitySecurityQuestionnaireStatusName sets the "entity_security_questionnaire_status_name" field.
func (_c *EntityCreate) SetEntitySecurityQuestionnaireStatusName(v string) *EntityCreate {
_c.mutation.SetEntitySecurityQuestionnaireStatusName(v)
return _c
}
// SetNillableEntitySecurityQuestionnaireStatusName sets the "entity_security_questionnaire_status_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntitySecurityQuestionnaireStatusName(v *string) *EntityCreate {
if v != nil {
_c.SetEntitySecurityQuestionnaireStatusName(*v)
}
return _c
}
// SetEntitySecurityQuestionnaireStatusID sets the "entity_security_questionnaire_status_id" field.
func (_c *EntityCreate) SetEntitySecurityQuestionnaireStatusID(v string) *EntityCreate {
_c.mutation.SetEntitySecurityQuestionnaireStatusID(v)
return _c
}
// SetNillableEntitySecurityQuestionnaireStatusID sets the "entity_security_questionnaire_status_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntitySecurityQuestionnaireStatusID(v *string) *EntityCreate {
if v != nil {
_c.SetEntitySecurityQuestionnaireStatusID(*v)
}
return _c
}
// SetEntitySourceTypeName sets the "entity_source_type_name" field.
func (_c *EntityCreate) SetEntitySourceTypeName(v string) *EntityCreate {
_c.mutation.SetEntitySourceTypeName(v)
return _c
}
// SetNillableEntitySourceTypeName sets the "entity_source_type_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntitySourceTypeName(v *string) *EntityCreate {
if v != nil {
_c.SetEntitySourceTypeName(*v)
}
return _c
}
// SetEntitySourceTypeID sets the "entity_source_type_id" field.
func (_c *EntityCreate) SetEntitySourceTypeID(v string) *EntityCreate {
_c.mutation.SetEntitySourceTypeID(v)
return _c
}
// SetNillableEntitySourceTypeID sets the "entity_source_type_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntitySourceTypeID(v *string) *EntityCreate {
if v != nil {
_c.SetEntitySourceTypeID(*v)
}
return _c
}
// SetEnvironmentName sets the "environment_name" field.
func (_c *EntityCreate) SetEnvironmentName(v string) *EntityCreate {
_c.mutation.SetEnvironmentName(v)
return _c
}
// SetNillableEnvironmentName sets the "environment_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEnvironmentName(v *string) *EntityCreate {
if v != nil {
_c.SetEnvironmentName(*v)
}
return _c
}
// SetEnvironmentID sets the "environment_id" field.
func (_c *EntityCreate) SetEnvironmentID(v string) *EntityCreate {
_c.mutation.SetEnvironmentID(v)
return _c
}
// SetNillableEnvironmentID sets the "environment_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEnvironmentID(v *string) *EntityCreate {
if v != nil {
_c.SetEnvironmentID(*v)
}
return _c
}
// SetScopeName sets the "scope_name" field.
func (_c *EntityCreate) SetScopeName(v string) *EntityCreate {
_c.mutation.SetScopeName(v)
return _c
}
// SetNillableScopeName sets the "scope_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableScopeName(v *string) *EntityCreate {
if v != nil {
_c.SetScopeName(*v)
}
return _c
}
// SetScopeID sets the "scope_id" field.
func (_c *EntityCreate) SetScopeID(v string) *EntityCreate {
_c.mutation.SetScopeID(v)
return _c
}
// SetNillableScopeID sets the "scope_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableScopeID(v *string) *EntityCreate {
if v != nil {
_c.SetScopeID(*v)
}
return _c
}
// SetName sets the "name" field.
func (_c *EntityCreate) SetName(v string) *EntityCreate {
_c.mutation.SetName(v)
return _c
}
// SetNillableName sets the "name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableName(v *string) *EntityCreate {
if v != nil {
_c.SetName(*v)
}
return _c
}
// SetDisplayName sets the "display_name" field.
func (_c *EntityCreate) SetDisplayName(v string) *EntityCreate {
_c.mutation.SetDisplayName(v)
return _c
}
// SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (_c *EntityCreate) SetNillableDisplayName(v *string) *EntityCreate {
if v != nil {
_c.SetDisplayName(*v)
}
return _c
}
// SetDescription sets the "description" field.
func (_c *EntityCreate) SetDescription(v string) *EntityCreate {
_c.mutation.SetDescription(v)
return _c
}
// SetNillableDescription sets the "description" field if the given value is not nil.
func (_c *EntityCreate) SetNillableDescription(v *string) *EntityCreate {
if v != nil {
_c.SetDescription(*v)
}
return _c
}
// SetDomains sets the "domains" field.
func (_c *EntityCreate) SetDomains(v []string) *EntityCreate {
_c.mutation.SetDomains(v)
return _c
}
// SetEntityTypeID sets the "entity_type_id" field.
func (_c *EntityCreate) SetEntityTypeID(v string) *EntityCreate {
_c.mutation.SetEntityTypeID(v)
return _c
}
// SetNillableEntityTypeID sets the "entity_type_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableEntityTypeID(v *string) *EntityCreate {
if v != nil {
_c.SetEntityTypeID(*v)
}
return _c
}
// SetStatus sets the "status" field.
func (_c *EntityCreate) SetStatus(v enums.EntityStatus) *EntityCreate {
_c.mutation.SetStatus(v)
return _c
}
// SetNillableStatus sets the "status" field if the given value is not nil.
func (_c *EntityCreate) SetNillableStatus(v *enums.EntityStatus) *EntityCreate {
if v != nil {
_c.SetStatus(*v)
}
return _c
}
// SetApprovedForUse sets the "approved_for_use" field.
func (_c *EntityCreate) SetApprovedForUse(v bool) *EntityCreate {
_c.mutation.SetApprovedForUse(v)
return _c
}
// SetNillableApprovedForUse sets the "approved_for_use" field if the given value is not nil.
func (_c *EntityCreate) SetNillableApprovedForUse(v *bool) *EntityCreate {
if v != nil {
_c.SetApprovedForUse(*v)
}
return _c
}
// SetLinkedAssetIds sets the "linked_asset_ids" field.
func (_c *EntityCreate) SetLinkedAssetIds(v []string) *EntityCreate {
_c.mutation.SetLinkedAssetIds(v)
return _c
}
// SetHasSoc2 sets the "has_soc2" field.
func (_c *EntityCreate) SetHasSoc2(v bool) *EntityCreate {
_c.mutation.SetHasSoc2(v)
return _c
}
// SetNillableHasSoc2 sets the "has_soc2" field if the given value is not nil.
func (_c *EntityCreate) SetNillableHasSoc2(v *bool) *EntityCreate {
if v != nil {
_c.SetHasSoc2(*v)
}
return _c
}
// SetSoc2PeriodEnd sets the "soc2_period_end" field.
func (_c *EntityCreate) SetSoc2PeriodEnd(v models.DateTime) *EntityCreate {
_c.mutation.SetSoc2PeriodEnd(v)
return _c
}
// SetNillableSoc2PeriodEnd sets the "soc2_period_end" field if the given value is not nil.
func (_c *EntityCreate) SetNillableSoc2PeriodEnd(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetSoc2PeriodEnd(*v)
}
return _c
}
// SetContractStartDate sets the "contract_start_date" field.
func (_c *EntityCreate) SetContractStartDate(v models.DateTime) *EntityCreate {
_c.mutation.SetContractStartDate(v)
return _c
}
// SetNillableContractStartDate sets the "contract_start_date" field if the given value is not nil.
func (_c *EntityCreate) SetNillableContractStartDate(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetContractStartDate(*v)
}
return _c
}
// SetContractEndDate sets the "contract_end_date" field.
func (_c *EntityCreate) SetContractEndDate(v models.DateTime) *EntityCreate {
_c.mutation.SetContractEndDate(v)
return _c
}
// SetNillableContractEndDate sets the "contract_end_date" field if the given value is not nil.
func (_c *EntityCreate) SetNillableContractEndDate(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetContractEndDate(*v)
}
return _c
}
// SetAutoRenews sets the "auto_renews" field.
func (_c *EntityCreate) SetAutoRenews(v bool) *EntityCreate {
_c.mutation.SetAutoRenews(v)
return _c
}
// SetNillableAutoRenews sets the "auto_renews" field if the given value is not nil.
func (_c *EntityCreate) SetNillableAutoRenews(v *bool) *EntityCreate {
if v != nil {
_c.SetAutoRenews(*v)
}
return _c
}
// SetTerminationNoticeDays sets the "termination_notice_days" field.
func (_c *EntityCreate) SetTerminationNoticeDays(v int) *EntityCreate {
_c.mutation.SetTerminationNoticeDays(v)
return _c
}
// SetNillableTerminationNoticeDays sets the "termination_notice_days" field if the given value is not nil.
func (_c *EntityCreate) SetNillableTerminationNoticeDays(v *int) *EntityCreate {
if v != nil {
_c.SetTerminationNoticeDays(*v)
}
return _c
}
// SetAnnualSpend sets the "annual_spend" field.
func (_c *EntityCreate) SetAnnualSpend(v float64) *EntityCreate {
_c.mutation.SetAnnualSpend(v)
return _c
}
// SetNillableAnnualSpend sets the "annual_spend" field if the given value is not nil.
func (_c *EntityCreate) SetNillableAnnualSpend(v *float64) *EntityCreate {
if v != nil {
_c.SetAnnualSpend(*v)
}
return _c
}
// SetSpendCurrency sets the "spend_currency" field.
func (_c *EntityCreate) SetSpendCurrency(v string) *EntityCreate {
_c.mutation.SetSpendCurrency(v)
return _c
}
// SetNillableSpendCurrency sets the "spend_currency" field if the given value is not nil.
func (_c *EntityCreate) SetNillableSpendCurrency(v *string) *EntityCreate {
if v != nil {
_c.SetSpendCurrency(*v)
}
return _c
}
// SetBillingModel sets the "billing_model" field.
func (_c *EntityCreate) SetBillingModel(v string) *EntityCreate {
_c.mutation.SetBillingModel(v)
return _c
}
// SetNillableBillingModel sets the "billing_model" field if the given value is not nil.
func (_c *EntityCreate) SetNillableBillingModel(v *string) *EntityCreate {
if v != nil {
_c.SetBillingModel(*v)
}
return _c
}
// SetRenewalRisk sets the "renewal_risk" field.
func (_c *EntityCreate) SetRenewalRisk(v string) *EntityCreate {
_c.mutation.SetRenewalRisk(v)
return _c
}
// SetNillableRenewalRisk sets the "renewal_risk" field if the given value is not nil.
func (_c *EntityCreate) SetNillableRenewalRisk(v *string) *EntityCreate {
if v != nil {
_c.SetRenewalRisk(*v)
}
return _c
}
// SetSSOEnforced sets the "sso_enforced" field.
func (_c *EntityCreate) SetSSOEnforced(v bool) *EntityCreate {
_c.mutation.SetSSOEnforced(v)
return _c
}
// SetNillableSSOEnforced sets the "sso_enforced" field if the given value is not nil.
func (_c *EntityCreate) SetNillableSSOEnforced(v *bool) *EntityCreate {
if v != nil {
_c.SetSSOEnforced(*v)
}
return _c
}
// SetMfaSupported sets the "mfa_supported" field.
func (_c *EntityCreate) SetMfaSupported(v bool) *EntityCreate {
_c.mutation.SetMfaSupported(v)
return _c
}
// SetNillableMfaSupported sets the "mfa_supported" field if the given value is not nil.
func (_c *EntityCreate) SetNillableMfaSupported(v *bool) *EntityCreate {
if v != nil {
_c.SetMfaSupported(*v)
}
return _c
}
// SetMfaEnforced sets the "mfa_enforced" field.
func (_c *EntityCreate) SetMfaEnforced(v bool) *EntityCreate {
_c.mutation.SetMfaEnforced(v)
return _c
}
// SetNillableMfaEnforced sets the "mfa_enforced" field if the given value is not nil.
func (_c *EntityCreate) SetNillableMfaEnforced(v *bool) *EntityCreate {
if v != nil {
_c.SetMfaEnforced(*v)
}
return _c
}
// SetStatusPageURL sets the "status_page_url" field.
func (_c *EntityCreate) SetStatusPageURL(v string) *EntityCreate {
_c.mutation.SetStatusPageURL(v)
return _c
}
// SetNillableStatusPageURL sets the "status_page_url" field if the given value is not nil.
func (_c *EntityCreate) SetNillableStatusPageURL(v *string) *EntityCreate {
if v != nil {
_c.SetStatusPageURL(*v)
}
return _c
}
// SetProvidedServices sets the "provided_services" field.
func (_c *EntityCreate) SetProvidedServices(v []string) *EntityCreate {
_c.mutation.SetProvidedServices(v)
return _c
}
// SetLinks sets the "links" field.
func (_c *EntityCreate) SetLinks(v []string) *EntityCreate {
_c.mutation.SetLinks(v)
return _c
}
// SetRiskRating sets the "risk_rating" field.
func (_c *EntityCreate) SetRiskRating(v string) *EntityCreate {
_c.mutation.SetRiskRating(v)
return _c
}
// SetNillableRiskRating sets the "risk_rating" field if the given value is not nil.
func (_c *EntityCreate) SetNillableRiskRating(v *string) *EntityCreate {
if v != nil {
_c.SetRiskRating(*v)
}
return _c
}
// SetRiskScore sets the "risk_score" field.
func (_c *EntityCreate) SetRiskScore(v int) *EntityCreate {
_c.mutation.SetRiskScore(v)
return _c
}
// SetNillableRiskScore sets the "risk_score" field if the given value is not nil.
func (_c *EntityCreate) SetNillableRiskScore(v *int) *EntityCreate {
if v != nil {
_c.SetRiskScore(*v)
}
return _c
}
// SetRiskScoreCoverage sets the "risk_score_coverage" field.
func (_c *EntityCreate) SetRiskScoreCoverage(v int) *EntityCreate {
_c.mutation.SetRiskScoreCoverage(v)
return _c
}
// SetNillableRiskScoreCoverage sets the "risk_score_coverage" field if the given value is not nil.
func (_c *EntityCreate) SetNillableRiskScoreCoverage(v *int) *EntityCreate {
if v != nil {
_c.SetRiskScoreCoverage(*v)
}
return _c
}
// SetTier sets the "tier" field.
func (_c *EntityCreate) SetTier(v enums.VendorTier) *EntityCreate {
_c.mutation.SetTier(v)
return _c
}
// SetNillableTier sets the "tier" field if the given value is not nil.
func (_c *EntityCreate) SetNillableTier(v *enums.VendorTier) *EntityCreate {
if v != nil {
_c.SetTier(*v)
}
return _c
}
// SetReviewFrequency sets the "review_frequency" field.
func (_c *EntityCreate) SetReviewFrequency(v enums.Frequency) *EntityCreate {
_c.mutation.SetReviewFrequency(v)
return _c
}
// SetNillableReviewFrequency sets the "review_frequency" field if the given value is not nil.
func (_c *EntityCreate) SetNillableReviewFrequency(v *enums.Frequency) *EntityCreate {
if v != nil {
_c.SetReviewFrequency(*v)
}
return _c
}
// SetNextReviewAt sets the "next_review_at" field.
func (_c *EntityCreate) SetNextReviewAt(v models.DateTime) *EntityCreate {
_c.mutation.SetNextReviewAt(v)
return _c
}
// SetNillableNextReviewAt sets the "next_review_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableNextReviewAt(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetNextReviewAt(*v)
}
return _c
}
// SetContractRenewalAt sets the "contract_renewal_at" field.
func (_c *EntityCreate) SetContractRenewalAt(v models.DateTime) *EntityCreate {
_c.mutation.SetContractRenewalAt(v)
return _c
}
// SetNillableContractRenewalAt sets the "contract_renewal_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableContractRenewalAt(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetContractRenewalAt(*v)
}
return _c
}
// SetVendorMetadata sets the "vendor_metadata" field.
func (_c *EntityCreate) SetVendorMetadata(v map[string]interface{}) *EntityCreate {
_c.mutation.SetVendorMetadata(v)
return _c
}
// SetLogoRemoteURL sets the "logo_remote_url" field.
func (_c *EntityCreate) SetLogoRemoteURL(v string) *EntityCreate {
_c.mutation.SetLogoRemoteURL(v)
return _c
}
// SetNillableLogoRemoteURL sets the "logo_remote_url" field if the given value is not nil.
func (_c *EntityCreate) SetNillableLogoRemoteURL(v *string) *EntityCreate {
if v != nil {
_c.SetLogoRemoteURL(*v)
}
return _c
}
// SetLogoFileID sets the "logo_file_id" field.
func (_c *EntityCreate) SetLogoFileID(v string) *EntityCreate {
_c.mutation.SetLogoFileID(v)
return _c
}
// SetNillableLogoFileID sets the "logo_file_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableLogoFileID(v *string) *EntityCreate {
if v != nil {
_c.SetLogoFileID(*v)
}
return _c
}
// SetExternalID sets the "external_id" field.
func (_c *EntityCreate) SetExternalID(v string) *EntityCreate {
_c.mutation.SetExternalID(v)
return _c
}
// SetNillableExternalID sets the "external_id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableExternalID(v *string) *EntityCreate {
if v != nil {
_c.SetExternalID(*v)
}
return _c
}
// SetObservedAt sets the "observed_at" field.
func (_c *EntityCreate) SetObservedAt(v models.DateTime) *EntityCreate {
_c.mutation.SetObservedAt(v)
return _c
}
// SetNillableObservedAt sets the "observed_at" field if the given value is not nil.
func (_c *EntityCreate) SetNillableObservedAt(v *models.DateTime) *EntityCreate {
if v != nil {
_c.SetObservedAt(*v)
}
return _c
}
// SetID sets the "id" field.
func (_c *EntityCreate) SetID(v string) *EntityCreate {
_c.mutation.SetID(v)
return _c
}
// SetNillableID sets the "id" field if the given value is not nil.
func (_c *EntityCreate) SetNillableID(v *string) *EntityCreate {
if v != nil {
_c.SetID(*v)
}
return _c
}
// SetOwner sets the "owner" edge to the Organization entity.
func (_c *EntityCreate) SetOwner(v *Organization) *EntityCreate {
return _c.SetOwnerID(v.ID)
}
// AddBlockedGroupIDs adds the "blocked_groups" edge to the Group entity by IDs.
func (_c *EntityCreate) AddBlockedGroupIDs(ids ...string) *EntityCreate {
_c.mutation.AddBlockedGroupIDs(ids...)
return _c
}
// AddBlockedGroups adds the "blocked_groups" edges to the Group entity.
func (_c *EntityCreate) AddBlockedGroups(v ...*Group) *EntityCreate {
ids := make([]string, len(v))
for i := range v {
ids[i] = v[i].ID
}
return _c.AddBlockedGroupIDs(ids...)
}
// AddEditorIDs adds the "editors" edge to the Group entity by IDs.
func (_c *EntityCreate) AddEditorIDs(ids ...string) *EntityCreate {
_c.mutation.AddEditorIDs(ids...)
return _c
}
// AddEditors adds the "editors" edges to the Group entity.
func (_c *EntityCreate) AddEditors(v ...*Group) *EntityCreate {
ids := make([]string, len(v))
for i := range v {
ids[i] = v[i].ID
}
return _c.AddEditorIDs(ids...)
}
// AddViewerIDs adds the "viewers" edge to the Group entity by IDs.
func (_c *EntityCreate) AddViewerIDs(ids ...string) *EntityCreate {
_c.mutation.AddViewerIDs(ids...)
return _c
}
// AddViewers adds the "viewers" edges to the Group entity.
func (_c *EntityCreate) AddViewers(v ...*Group) *EntityCreate {
ids := make([]string, len(v))
for i := range v {
ids[i] = v[i].ID
}
return _c.AddViewerIDs(ids...)
}
// SetInternalOwnerUser sets the "internal_owner_user" edge to the User entity.
func (_c *EntityCreate) SetInternalOwnerUser(v *User) *EntityCreate {
return _c.SetInternalOwnerUserID(v.ID)
}
// SetInternalOwnerGroup sets the "internal_owner_group" edge to the Group entity.
func (_c *EntityCreate) SetInternalOwnerGroup(v *Group) *EntityCreate {
return _c.SetInternalOwnerGroupID(v.ID)
}
// SetReviewedByUser sets the "reviewed_by_user" edge to the User entity.
func (_c *EntityCreate) SetReviewedByUser(v *User) *EntityCreate {
return _c.SetReviewedByUserID(v.ID)
}
// SetReviewedByGroup sets the "reviewed_by_group" edge to the Group entity.
func (_c *EntityCreate) SetReviewedByGroup(v *Group) *EntityCreate {
return _c.SetReviewedByGroupID(v.ID)
}
// SetEntityRelationshipState sets the "entity_relationship_state" edge to the CustomTypeEnum entity.
func (_c *EntityCreate) SetEntityRelationshipState(v *CustomTypeEnum) *EntityCreate {
return _c.SetEntityRelationshipStateID(v.ID)
}
// SetEntitySecurityQuestionnaireStatus sets the "entity_security_questionnaire_status" edge to the CustomTypeEnum entity.
func (_c *EntityCreate) SetEntitySecurityQuestionnaireStatus(v *CustomTypeEnum) *EntityCreate {
return _c.SetEntitySecurityQuestionnaireStatusID(v.ID)
}
// SetEntitySourceType sets the "entity_source_type" edge to the CustomTypeEnum entity.
func (_c *EntityCreate) SetEntitySourceType(v *CustomTypeEnum) *EntityCreate {
return _c.SetEntitySourceTypeID(v.ID)
}
// SetEnvironment sets the "environment" edge to the CustomTypeEnum entity.
func (_c *EntityCreate) SetEnvironment(v *CustomTypeEnum) *EntityCreate {
return _c.SetEnvironmentID(v.ID)
}
// SetScope sets the "scope" edge to the CustomTypeEnum entity.
func (_c *EntityCreate) SetScope(v *CustomTypeEnum) *EntityCreate {
return _c.SetScopeID(v.ID)
}