@@ -774,7 +774,18 @@ func (rm *resourceManager) setContributorInsights(
774
774
if err != nil {
775
775
return err
776
776
}
777
-
777
+
778
+ // This portion is needed if we want to have a smooth delta comparison
779
+ // If the name ends in ED (ENABLED, DISABLED) just assign the value
780
+ endsWithED := false
781
+ if ko .Spec .ContributorInsights != nil {
782
+ endsWithED = strings .HasSuffix (* ko .Spec .TableName , "ED" )
783
+ }
784
+ if endsWithED {
785
+ ko .Spec .ContributorInsights = aws .String (string (resp .ContributorInsightsStatus ))
786
+ return nil
787
+ }
788
+ // if not do the conversion
778
789
switch resp .ContributorInsightsStatus {
779
790
case svcsdktypes .ContributorInsightsStatusEnabled :
780
791
ko .Spec .ContributorInsights = aws .String (string (svcsdktypes .ContributorInsightsActionEnable ))
@@ -797,9 +808,18 @@ func (rm *resourceManager) updateContributorInsights(
797
808
defer func () {
798
809
exit (err )
799
810
}()
811
+
800
812
insight := svcsdktypes .ContributorInsightsActionDisable
801
813
if r .ko .Spec .ContributorInsights != nil {
802
- insight = svcsdktypes .ContributorInsightsAction (* r .ko .Spec .ContributorInsights )
814
+ // We will allow users to provide values ENABLE, ENABLED, DISABLE, DISABLED
815
+ switch * r .ko .Spec .ContributorInsights {
816
+ case string (svcsdktypes .ContributorInsightsActionEnable ), string (svcsdktypes .ContributorInsightsStatusEnabled ):
817
+ insight = svcsdktypes .ContributorInsightsActionEnable
818
+ case string (svcsdktypes .ContributorInsightsActionDisable ), string (svcsdktypes .ContributorInsightsStatusDisabled ):
819
+ insight = svcsdktypes .ContributorInsightsActionDisable
820
+ default :
821
+ return fmt .Errorf ("invalid ContributorInsights value: %s" , * r .ko .Spec .ContributorInsights )
822
+ }
803
823
}
804
824
805
825
_ , err = rm .sdkapi .UpdateContributorInsights (
0 commit comments