@@ -709,6 +709,30 @@ func (sa *SearchAssets) MarshalJSON() ([]byte, error) {
709
709
customJSON ["guid" ] = * sa .Guid
710
710
}
711
711
712
+ if sa .Status != nil {
713
+ customJSON ["status" ] = * sa .Status
714
+ }
715
+
716
+ if sa .CreatedBy != nil {
717
+ customJSON ["createdBy" ] = * sa .CreatedBy
718
+ }
719
+
720
+ if sa .CreateTime != nil {
721
+ customJSON ["createTime" ] = * sa .CreateTime
722
+ }
723
+
724
+ if sa .UpdateTime != nil {
725
+ customJSON ["updateTime" ] = * sa .UpdateTime
726
+ }
727
+
728
+ if sa .UpdatedBy != nil {
729
+ customJSON ["updatedBy" ] = * sa .UpdatedBy
730
+ }
731
+
732
+ if sa .DisplayText != nil && * sa .DisplayText != "" {
733
+ customJSON ["DisplayText" ] = * sa .DisplayText
734
+ }
735
+
712
736
if sa .Asset .DisplayName != nil && * sa .Asset .DisplayName != "" {
713
737
attributes ["DisplayText" ] = * sa .Asset .DisplayName
714
738
}
@@ -832,6 +856,27 @@ func (sa *SearchAssets) MarshalJSON() ([]byte, error) {
832
856
attributes ["roleId" ] = * sa .RoleId
833
857
}
834
858
859
+ // Handle nested AccessControl field
860
+ accessControl := map [string ]interface {}{}
861
+
862
+ if sa .AccessControl .Guid != nil && * sa .AccessControl .Guid != "" {
863
+ accessControl ["guid" ] = * sa .AccessControl .Guid
864
+ }
865
+
866
+ if sa .AccessControl .TypeName != nil && * sa .AccessControl .TypeName != "" {
867
+ accessControl ["typeName" ] = * sa .AccessControl .TypeName
868
+ }
869
+
870
+ if sa .AccessControl .UniqueAttributes .QualifiedName != nil && * sa .AccessControl .UniqueAttributes .QualifiedName != "" {
871
+ accessControl ["uniqueAttributes" ] = map [string ]interface {}{
872
+ "qualifiedName" : sa .AccessControl .UniqueAttributes .QualifiedName ,
873
+ }
874
+ }
875
+
876
+ if len (accessControl ) > 0 {
877
+ attributes ["accessControl" ] = accessControl
878
+ }
879
+
835
880
// Marshal the custom JSON
836
881
return json .MarshalIndent (customJSON , "" , " " )
837
882
}
@@ -843,14 +888,15 @@ func (sa *SearchAssets) UnmarshalJSON(data []byte) error {
843
888
structs.Table
844
889
structs.Column
845
890
structs.AuthPolicy
846
- structs.AccessControl
847
891
structs.Persona
848
892
structs.Purpose
849
- QualifiedName * string `json:"qualifiedName,omitempty"`
850
- Name * string `json:"name,omitempty"`
851
- SearchAttributes * SearchAttributes `json:"attributes,omitempty"`
852
- SearchMeanings []Meanings `json:"meanings,omitempty"`
853
- NotNull * bool `json:"notNull,omitempty"`
893
+ structs.AccessControl
894
+ QualifiedName * string `json:"qualifiedName,omitempty"`
895
+ Name * string `json:"name,omitempty"`
896
+ SearchAttributes * SearchAttributes `json:"attributes,omitempty"`
897
+ SearchMeanings []Meanings `json:"meanings,omitempty"`
898
+ NotNull * bool `json:"notNull,omitempty"`
899
+
854
900
rawSearchAttributes map [string ]interface {}
855
901
}
856
902
@@ -877,6 +923,8 @@ func (sa *SearchAssets) UnmarshalJSON(data []byte) error {
877
923
sa .Column = aux .Column
878
924
sa .NotNull = aux .NotNull
879
925
sa .SearchMeanings = meaningsData .SearchMeanings
926
+ sa .AuthPolicy = aux .AuthPolicy
927
+ sa .AccessControl = aux .AccessControl
880
928
881
929
// Check if any search attributes are present
882
930
if aux .SearchAttributes != nil {
@@ -990,6 +1038,13 @@ func (sa *SearchAssets) UnmarshalJSON(data []byte) error {
990
1038
sa .PersonaUsers = aux .SearchAttributes .PersonaUsers
991
1039
sa .RoleId = aux .SearchAttributes .RoleId
992
1040
1041
+ if aux .SearchAttributes .AccessControl != nil {
1042
+ // Attributes under AccessControl struct
1043
+ sa .AccessControl .TypeName = aux .SearchAttributes .AccessControl .TypeName
1044
+ sa .AccessControl .Guid = aux .SearchAttributes .AccessControl .Guid
1045
+ sa .AccessControl .UniqueAttributes .QualifiedName = aux .SearchAttributes .AccessControl .UniqueAttributes .QualifiedName
1046
+ }
1047
+
993
1048
// Populate `rawSearchAttributes` (necessary for setting `SearchAssets.CustomMetadataSets`)
994
1049
// First, unmarshal the data into a `rawSearchAsset` map
995
1050
var rawSearchAsset map [string ]interface {}
0 commit comments