sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go (3,319 lines of code) (raw):

//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armoperationalinsights import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) // MarshalJSON implements the json.Marshaller interface for type AssociatedWorkspace. func (a AssociatedWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "associateDate", a.AssociateDate) populate(objectMap, "resourceId", a.ResourceID) populate(objectMap, "workspaceId", a.WorkspaceID) populate(objectMap, "workspaceName", a.WorkspaceName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AssociatedWorkspace. func (a *AssociatedWorkspace) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "associateDate": err = unpopulate(val, "AssociateDate", &a.AssociateDate) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &a.ResourceID) delete(rawMsg, key) case "workspaceId": err = unpopulate(val, "WorkspaceID", &a.WorkspaceID) delete(rawMsg, key) case "workspaceName": err = unpopulate(val, "WorkspaceName", &a.WorkspaceName) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AvailableServiceTier. func (a AvailableServiceTier) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacityReservationLevel", a.CapacityReservationLevel) populate(objectMap, "defaultRetention", a.DefaultRetention) populate(objectMap, "enabled", a.Enabled) populate(objectMap, "lastSkuUpdate", a.LastSKUUpdate) populate(objectMap, "maximumRetention", a.MaximumRetention) populate(objectMap, "minimumRetention", a.MinimumRetention) populate(objectMap, "serviceTier", a.ServiceTier) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AvailableServiceTier. func (a *AvailableServiceTier) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "capacityReservationLevel": err = unpopulate(val, "CapacityReservationLevel", &a.CapacityReservationLevel) delete(rawMsg, key) case "defaultRetention": err = unpopulate(val, "DefaultRetention", &a.DefaultRetention) delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &a.Enabled) delete(rawMsg, key) case "lastSkuUpdate": err = unpopulate(val, "LastSKUUpdate", &a.LastSKUUpdate) delete(rawMsg, key) case "maximumRetention": err = unpopulate(val, "MaximumRetention", &a.MaximumRetention) delete(rawMsg, key) case "minimumRetention": err = unpopulate(val, "MinimumRetention", &a.MinimumRetention) delete(rawMsg, key) case "serviceTier": err = unpopulate(val, "ServiceTier", &a.ServiceTier) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AzureEntityResource. func (a AzureEntityResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", a.Etag) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource. func (a *AzureEntityResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "etag": err = unpopulate(val, "Etag", &a.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AzureResourceProperties. func (a AzureResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "systemData", a.SystemData) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceProperties. func (a *AzureResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CapacityReservationProperties. func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "lastSkuUpdate", c.LastSKUUpdate) populate(objectMap, "minCapacity", c.MinCapacity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CapacityReservationProperties. func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "lastSkuUpdate": err = unpopulate(val, "LastSKUUpdate", &c.LastSKUUpdate) delete(rawMsg, key) case "minCapacity": err = unpopulate(val, "MinCapacity", &c.MinCapacity) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Cluster. func (c Cluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "sku", c.SKU) populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. func (c *Cluster) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClusterListResult. func (c ClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. func (c *ClusterListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClusterPatch. func (c ClusterPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", c.Identity) populate(objectMap, "properties", c.Properties) populate(objectMap, "sku", c.SKU) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatch. func (c *ClusterPatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "identity": err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClusterPatchProperties. func (c ClusterPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "billingType", c.BillingType) populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPatchProperties. func (c *ClusterPatchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "billingType": err = unpopulate(val, "BillingType", &c.BillingType) delete(rawMsg, key) case "keyVaultProperties": err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClusterProperties. func (c ClusterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "associatedWorkspaces", c.AssociatedWorkspaces) populate(objectMap, "billingType", c.BillingType) populate(objectMap, "capacityReservationProperties", c.CapacityReservationProperties) populate(objectMap, "clusterId", c.ClusterID) populate(objectMap, "createdDate", c.CreatedDate) populate(objectMap, "isAvailabilityZonesEnabled", c.IsAvailabilityZonesEnabled) populate(objectMap, "isDoubleEncryptionEnabled", c.IsDoubleEncryptionEnabled) populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) populate(objectMap, "lastModifiedDate", c.LastModifiedDate) populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. func (c *ClusterProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "associatedWorkspaces": err = unpopulate(val, "AssociatedWorkspaces", &c.AssociatedWorkspaces) delete(rawMsg, key) case "billingType": err = unpopulate(val, "BillingType", &c.BillingType) delete(rawMsg, key) case "capacityReservationProperties": err = unpopulate(val, "CapacityReservationProperties", &c.CapacityReservationProperties) delete(rawMsg, key) case "clusterId": err = unpopulate(val, "ClusterID", &c.ClusterID) delete(rawMsg, key) case "createdDate": err = unpopulate(val, "CreatedDate", &c.CreatedDate) delete(rawMsg, key) case "isAvailabilityZonesEnabled": err = unpopulate(val, "IsAvailabilityZonesEnabled", &c.IsAvailabilityZonesEnabled) delete(rawMsg, key) case "isDoubleEncryptionEnabled": err = unpopulate(val, "IsDoubleEncryptionEnabled", &c.IsDoubleEncryptionEnabled) delete(rawMsg, key) case "keyVaultProperties": err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) delete(rawMsg, key) case "lastModifiedDate": err = unpopulate(val, "LastModifiedDate", &c.LastModifiedDate) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClusterSKU. func (c ClusterSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacity", c.Capacity) populate(objectMap, "name", c.Name) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSKU. func (c *ClusterSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "capacity": err = unpopulate(val, "Capacity", &c.Capacity) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Column. func (c Column) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataTypeHint", c.DataTypeHint) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) populate(objectMap, "isDefaultDisplay", c.IsDefaultDisplay) populate(objectMap, "isHidden", c.IsHidden) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Column. func (c *Column) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "dataTypeHint": err = unpopulate(val, "DataTypeHint", &c.DataTypeHint) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &c.DisplayName) delete(rawMsg, key) case "isDefaultDisplay": err = unpopulate(val, "IsDefaultDisplay", &c.IsDefaultDisplay) delete(rawMsg, key) case "isHidden": err = unpopulate(val, "IsHidden", &c.IsHidden) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CoreSummary. func (c CoreSummary) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "numberOfDocuments", c.NumberOfDocuments) populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CoreSummary. func (c *CoreSummary) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "numberOfDocuments": err = unpopulate(val, "NumberOfDocuments", &c.NumberOfDocuments) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataExport. func (d DataExport) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataExport. func (d *DataExport) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataExportListResult. func (d DataExportListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataExportListResult. func (d *DataExportListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataExportProperties. func (d DataExportProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "createdDate", d.CreatedDate) populate(objectMap, "dataExportId", d.DataExportID) populate(objectMap, "destination", d.Destination) populate(objectMap, "enable", d.Enable) populate(objectMap, "lastModifiedDate", d.LastModifiedDate) populate(objectMap, "tableNames", d.TableNames) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataExportProperties. func (d *DataExportProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "createdDate": err = unpopulate(val, "CreatedDate", &d.CreatedDate) delete(rawMsg, key) case "dataExportId": err = unpopulate(val, "DataExportID", &d.DataExportID) delete(rawMsg, key) case "destination": err = unpopulate(val, "Destination", &d.Destination) delete(rawMsg, key) case "enable": err = unpopulate(val, "Enable", &d.Enable) delete(rawMsg, key) case "lastModifiedDate": err = unpopulate(val, "LastModifiedDate", &d.LastModifiedDate) delete(rawMsg, key) case "tableNames": err = unpopulate(val, "TableNames", &d.TableNames) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataSource. func (d DataSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", d.Etag) populate(objectMap, "id", d.ID) populate(objectMap, "kind", d.Kind) populate(objectMap, "name", d.Name) populateAny(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataSource. func (d *DataSource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "etag": err = unpopulate(val, "Etag", &d.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataSourceFilter. func (d DataSourceFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "kind", d.Kind) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataSourceFilter. func (d *DataSourceFilter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "kind": err = unpopulate(val, "Kind", &d.Kind) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DataSourceListResult. func (d DataSourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DataSourceListResult. func (d *DataSourceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Destination. func (d Destination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "metaData", d.MetaData) populate(objectMap, "resourceId", d.ResourceID) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Destination. func (d *Destination) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "metaData": err = unpopulate(val, "MetaData", &d.MetaData) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &d.ResourceID) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DestinationMetaData. func (d DestinationMetaData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eventHubName", d.EventHubName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DestinationMetaData. func (d *DestinationMetaData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "eventHubName": err = unpopulate(val, "EventHubName", &d.EventHubName) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateAny(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "info": err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) populate(objectMap, "message", e.Message) populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. func (e *ErrorResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "error": err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Identity. func (i Identity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Identity. func (i *Identity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "principalId": err = unpopulate(val, "PrincipalID", &i.PrincipalID) delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &i.TenantID) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) case "userAssignedIdentities": err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type IntelligencePack. func (i IntelligencePack) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", i.DisplayName) populate(objectMap, "enabled", i.Enabled) populate(objectMap, "name", i.Name) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type IntelligencePack. func (i *IntelligencePack) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &i.DisplayName) delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &i.Enabled) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyName", k.KeyName) populate(objectMap, "keyRsaSize", k.KeyRsaSize) populate(objectMap, "keyVaultUri", k.KeyVaultURI) populate(objectMap, "keyVersion", k.KeyVersion) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { case "keyName": err = unpopulate(val, "KeyName", &k.KeyName) delete(rawMsg, key) case "keyRsaSize": err = unpopulate(val, "KeyRsaSize", &k.KeyRsaSize) delete(rawMsg, key) case "keyVaultUri": err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) delete(rawMsg, key) case "keyVersion": err = unpopulate(val, "KeyVersion", &k.KeyVersion) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedService. func (l LinkedService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) populate(objectMap, "tags", l.Tags) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedService. func (l *LinkedService) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedServiceListResult. func (l LinkedServiceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedServiceListResult. func (l *LinkedServiceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedServiceProperties. func (l LinkedServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "provisioningState", l.ProvisioningState) populate(objectMap, "resourceId", l.ResourceID) populate(objectMap, "writeAccessResourceId", l.WriteAccessResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedServiceProperties. func (l *LinkedServiceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "provisioningState": err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &l.ResourceID) delete(rawMsg, key) case "writeAccessResourceId": err = unpopulate(val, "WriteAccessResourceID", &l.WriteAccessResourceID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedStorageAccountsListResult. func (l LinkedStorageAccountsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsListResult. func (l *LinkedStorageAccountsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedStorageAccountsProperties. func (l LinkedStorageAccountsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataSourceType", l.DataSourceType) populate(objectMap, "storageAccountIds", l.StorageAccountIDs) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsProperties. func (l *LinkedStorageAccountsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "dataSourceType": err = unpopulate(val, "DataSourceType", &l.DataSourceType) delete(rawMsg, key) case "storageAccountIds": err = unpopulate(val, "StorageAccountIDs", &l.StorageAccountIDs) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LinkedStorageAccountsResource. func (l LinkedStorageAccountsResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsResource. func (l *LinkedStorageAccountsResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPack. func (l LogAnalyticsQueryPack) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "location", l.Location) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) populate(objectMap, "tags", l.Tags) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPack. func (l *LogAnalyticsQueryPack) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &l.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackListResult. func (l LogAnalyticsQueryPackListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", l.NextLink) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackListResult. func (l *LogAnalyticsQueryPackListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackProperties. func (l LogAnalyticsQueryPackProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "provisioningState", l.ProvisioningState) populate(objectMap, "queryPackId", l.QueryPackID) populateDateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) populateDateTimeRFC3339(objectMap, "timeModified", l.TimeModified) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackProperties. func (l *LogAnalyticsQueryPackProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "provisioningState": err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) delete(rawMsg, key) case "queryPackId": err = unpopulate(val, "QueryPackID", &l.QueryPackID) delete(rawMsg, key) case "timeCreated": err = unpopulateDateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) delete(rawMsg, key) case "timeModified": err = unpopulateDateTimeRFC3339(val, "TimeModified", &l.TimeModified) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuery. func (l LogAnalyticsQueryPackQuery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", l.ID) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) populate(objectMap, "systemData", l.SystemData) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuery. func (l *LogAnalyticsQueryPackQuery) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &l.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryListResult. func (l LogAnalyticsQueryPackQueryListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", l.NextLink) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryListResult. func (l *LogAnalyticsQueryPackQueryListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryProperties. func (l LogAnalyticsQueryPackQueryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "author", l.Author) populate(objectMap, "body", l.Body) populate(objectMap, "description", l.Description) populate(objectMap, "displayName", l.DisplayName) populate(objectMap, "id", l.ID) populateAny(objectMap, "properties", l.Properties) populate(objectMap, "related", l.Related) populate(objectMap, "tags", l.Tags) populateDateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) populateDateTimeRFC3339(objectMap, "timeModified", l.TimeModified) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryProperties. func (l *LogAnalyticsQueryPackQueryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "author": err = unpopulate(val, "Author", &l.Author) delete(rawMsg, key) case "body": err = unpopulate(val, "Body", &l.Body) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &l.DisplayName) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "related": err = unpopulate(val, "Related", &l.Related) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) case "timeCreated": err = unpopulateDateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) delete(rawMsg, key) case "timeModified": err = unpopulateDateTimeRFC3339(val, "TimeModified", &l.TimeModified) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryPropertiesRelated. func (l LogAnalyticsQueryPackQueryPropertiesRelated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "categories", l.Categories) populate(objectMap, "resourceTypes", l.ResourceTypes) populate(objectMap, "solutions", l.Solutions) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryPropertiesRelated. func (l *LogAnalyticsQueryPackQueryPropertiesRelated) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "categories": err = unpopulate(val, "Categories", &l.Categories) delete(rawMsg, key) case "resourceTypes": err = unpopulate(val, "ResourceTypes", &l.ResourceTypes) delete(rawMsg, key) case "solutions": err = unpopulate(val, "Solutions", &l.Solutions) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchProperties. func (l LogAnalyticsQueryPackQuerySearchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "related", l.Related) populate(objectMap, "tags", l.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuerySearchProperties. func (l *LogAnalyticsQueryPackQuerySearchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "related": err = unpopulate(val, "Related", &l.Related) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchPropertiesRelated. func (l LogAnalyticsQueryPackQuerySearchPropertiesRelated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "categories", l.Categories) populate(objectMap, "resourceTypes", l.ResourceTypes) populate(objectMap, "solutions", l.Solutions) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQuerySearchPropertiesRelated. func (l *LogAnalyticsQueryPackQuerySearchPropertiesRelated) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "categories": err = unpopulate(val, "Categories", &l.Categories) delete(rawMsg, key) case "resourceTypes": err = unpopulate(val, "ResourceTypes", &l.ResourceTypes) delete(rawMsg, key) case "solutions": err = unpopulate(val, "Solutions", &l.Solutions) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ManagementGroup. func (m ManagementGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroup. func (m *ManagementGroup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ManagementGroupProperties. func (m ManagementGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "created", m.Created) populateDateTimeRFC3339(objectMap, "dataReceived", m.DataReceived) populate(objectMap, "id", m.ID) populate(objectMap, "isGateway", m.IsGateway) populate(objectMap, "name", m.Name) populate(objectMap, "sku", m.SKU) populate(objectMap, "serverCount", m.ServerCount) populate(objectMap, "version", m.Version) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupProperties. func (m *ManagementGroupProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "created": err = unpopulateDateTimeRFC3339(val, "Created", &m.Created) delete(rawMsg, key) case "dataReceived": err = unpopulateDateTimeRFC3339(val, "DataReceived", &m.DataReceived) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "isGateway": err = unpopulate(val, "IsGateway", &m.IsGateway) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &m.SKU) delete(rawMsg, key) case "serverCount": err = unpopulate(val, "ServerCount", &m.ServerCount) delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &m.Version) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type MetricName. func (m MetricName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "localizedValue", m.LocalizedValue) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type MetricName. func (m *MetricName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "localizedValue": err = unpopulate(val, "LocalizedValue", &m.LocalizedValue) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "name", o.Name) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Operation. func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. func (o *OperationDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationStatus. func (o OperationStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "startTime", o.StartTime) populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. func (o *OperationStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "endTime": err = unpopulate(val, "EndTime", &o.EndTime) delete(rawMsg, key) case "error": err = unpopulate(val, "Error", &o.Error) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "startTime": err = unpopulate(val, "StartTime", &o.StartTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &o.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopedResource. func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "resourceId", p.ResourceID) populate(objectMap, "scopeId", p.ScopeID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource. func (p *PrivateLinkScopedResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "resourceId": err = unpopulate(val, "ResourceID", &p.ResourceID) delete(rawMsg, key) case "scopeId": err = unpopulate(val, "ScopeID", &p.ScopeID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type QueryPacksResource. func (q QueryPacksResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", q.ID) populate(objectMap, "location", q.Location) populate(objectMap, "name", q.Name) populate(objectMap, "tags", q.Tags) populate(objectMap, "type", q.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type QueryPacksResource. func (q *QueryPacksResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &q.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &q.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &q.Name) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &q.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &q.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Resource. func (r *Resource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type RestoredLogs. func (r RestoredLogs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endRestoreTime", r.EndRestoreTime) populate(objectMap, "sourceTable", r.SourceTable) populateDateTimeRFC3339(objectMap, "startRestoreTime", r.StartRestoreTime) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type RestoredLogs. func (r *RestoredLogs) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "endRestoreTime": err = unpopulateDateTimeRFC3339(val, "EndRestoreTime", &r.EndRestoreTime) delete(rawMsg, key) case "sourceTable": err = unpopulate(val, "SourceTable", &r.SourceTable) delete(rawMsg, key) case "startRestoreTime": err = unpopulateDateTimeRFC3339(val, "StartRestoreTime", &r.StartRestoreTime) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ResultStatistics. func (r ResultStatistics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "ingestedRecords", r.IngestedRecords) populate(objectMap, "progress", r.Progress) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ResultStatistics. func (r *ResultStatistics) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "ingestedRecords": err = unpopulate(val, "IngestedRecords", &r.IngestedRecords) delete(rawMsg, key) case "progress": err = unpopulate(val, "Progress", &r.Progress) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SavedSearch. func (s SavedSearch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", s.Etag) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SavedSearch. func (s *SavedSearch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "etag": err = unpopulate(val, "Etag", &s.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SavedSearchProperties. func (s SavedSearchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "category", s.Category) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "functionAlias", s.FunctionAlias) populate(objectMap, "functionParameters", s.FunctionParameters) populate(objectMap, "query", s.Query) populate(objectMap, "tags", s.Tags) populate(objectMap, "version", s.Version) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SavedSearchProperties. func (s *SavedSearchProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "category": err = unpopulate(val, "Category", &s.Category) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) case "functionAlias": err = unpopulate(val, "FunctionAlias", &s.FunctionAlias) delete(rawMsg, key) case "functionParameters": err = unpopulate(val, "FunctionParameters", &s.FunctionParameters) delete(rawMsg, key) case "query": err = unpopulate(val, "Query", &s.Query) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SavedSearchesListResult. func (s SavedSearchesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SavedSearchesListResult. func (s *SavedSearchesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Schema. func (s Schema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "categories", s.Categories) populate(objectMap, "columns", s.Columns) populate(objectMap, "description", s.Description) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "labels", s.Labels) populate(objectMap, "name", s.Name) populate(objectMap, "restoredLogs", s.RestoredLogs) populate(objectMap, "searchResults", s.SearchResults) populate(objectMap, "solutions", s.Solutions) populate(objectMap, "source", s.Source) populate(objectMap, "standardColumns", s.StandardColumns) populate(objectMap, "tableSubType", s.TableSubType) populate(objectMap, "tableType", s.TableType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Schema. func (s *Schema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "categories": err = unpopulate(val, "Categories", &s.Categories) delete(rawMsg, key) case "columns": err = unpopulate(val, "Columns", &s.Columns) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) case "labels": err = unpopulate(val, "Labels", &s.Labels) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "restoredLogs": err = unpopulate(val, "RestoredLogs", &s.RestoredLogs) delete(rawMsg, key) case "searchResults": err = unpopulate(val, "SearchResults", &s.SearchResults) delete(rawMsg, key) case "solutions": err = unpopulate(val, "Solutions", &s.Solutions) delete(rawMsg, key) case "source": err = unpopulate(val, "Source", &s.Source) delete(rawMsg, key) case "standardColumns": err = unpopulate(val, "StandardColumns", &s.StandardColumns) delete(rawMsg, key) case "tableSubType": err = unpopulate(val, "TableSubType", &s.TableSubType) delete(rawMsg, key) case "tableType": err = unpopulate(val, "TableType", &s.TableType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchGetSchemaResponse. func (s SearchGetSchemaResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "metadata", s.Metadata) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchGetSchemaResponse. func (s *SearchGetSchemaResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "metadata": err = unpopulate(val, "Metadata", &s.Metadata) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchMetadata. func (s SearchMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "aggregatedGroupingFields", s.AggregatedGroupingFields) populate(objectMap, "aggregatedValueField", s.AggregatedValueField) populate(objectMap, "coreSummaries", s.CoreSummaries) populate(objectMap, "eTag", s.ETag) populate(objectMap, "id", s.ID) populateDateTimeRFC3339(objectMap, "lastUpdated", s.LastUpdated) populate(objectMap, "max", s.Max) populate(objectMap, "requestTime", s.RequestTime) populate(objectMap, "resultType", s.ResultType) populate(objectMap, "schema", s.Schema) populate(objectMap, "requestId", s.SearchID) populate(objectMap, "sort", s.Sort) populateDateTimeRFC3339(objectMap, "startTime", s.StartTime) populate(objectMap, "status", s.Status) populate(objectMap, "sum", s.Sum) populate(objectMap, "top", s.Top) populate(objectMap, "total", s.Total) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadata. func (s *SearchMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "aggregatedGroupingFields": err = unpopulate(val, "AggregatedGroupingFields", &s.AggregatedGroupingFields) delete(rawMsg, key) case "aggregatedValueField": err = unpopulate(val, "AggregatedValueField", &s.AggregatedValueField) delete(rawMsg, key) case "coreSummaries": err = unpopulate(val, "CoreSummaries", &s.CoreSummaries) delete(rawMsg, key) case "eTag": err = unpopulate(val, "ETag", &s.ETag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "lastUpdated": err = unpopulateDateTimeRFC3339(val, "LastUpdated", &s.LastUpdated) delete(rawMsg, key) case "max": err = unpopulate(val, "Max", &s.Max) delete(rawMsg, key) case "requestTime": err = unpopulate(val, "RequestTime", &s.RequestTime) delete(rawMsg, key) case "resultType": err = unpopulate(val, "ResultType", &s.ResultType) delete(rawMsg, key) case "schema": err = unpopulate(val, "Schema", &s.Schema) delete(rawMsg, key) case "requestId": err = unpopulate(val, "SearchID", &s.SearchID) delete(rawMsg, key) case "sort": err = unpopulate(val, "Sort", &s.Sort) delete(rawMsg, key) case "startTime": err = unpopulateDateTimeRFC3339(val, "StartTime", &s.StartTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "sum": err = unpopulate(val, "Sum", &s.Sum) delete(rawMsg, key) case "top": err = unpopulate(val, "Top", &s.Top) delete(rawMsg, key) case "total": err = unpopulate(val, "Total", &s.Total) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchMetadataSchema. func (s SearchMetadataSchema) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", s.Name) populate(objectMap, "version", s.Version) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadataSchema. func (s *SearchMetadataSchema) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &s.Version) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchResults. func (s SearchResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", s.Description) populateDateTimeRFC3339(objectMap, "endSearchTime", s.EndSearchTime) populate(objectMap, "limit", s.Limit) populate(objectMap, "query", s.Query) populate(objectMap, "sourceTable", s.SourceTable) populateDateTimeRFC3339(objectMap, "startSearchTime", s.StartSearchTime) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchResults. func (s *SearchResults) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) case "endSearchTime": err = unpopulateDateTimeRFC3339(val, "EndSearchTime", &s.EndSearchTime) delete(rawMsg, key) case "limit": err = unpopulate(val, "Limit", &s.Limit) delete(rawMsg, key) case "query": err = unpopulate(val, "Query", &s.Query) delete(rawMsg, key) case "sourceTable": err = unpopulate(val, "SourceTable", &s.SourceTable) delete(rawMsg, key) case "startSearchTime": err = unpopulateDateTimeRFC3339(val, "StartSearchTime", &s.StartSearchTime) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchSchemaValue. func (s SearchSchemaValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "facet", s.Facet) populate(objectMap, "indexed", s.Indexed) populate(objectMap, "name", s.Name) populate(objectMap, "ownerType", s.OwnerType) populate(objectMap, "stored", s.Stored) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchSchemaValue. func (s *SearchSchemaValue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) case "facet": err = unpopulate(val, "Facet", &s.Facet) delete(rawMsg, key) case "indexed": err = unpopulate(val, "Indexed", &s.Indexed) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "ownerType": err = unpopulate(val, "OwnerType", &s.OwnerType) delete(rawMsg, key) case "stored": err = unpopulate(val, "Stored", &s.Stored) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SearchSort. func (s SearchSort) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", s.Name) populate(objectMap, "order", s.Order) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SearchSort. func (s *SearchSort) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "order": err = unpopulate(val, "Order", &s.Order) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SharedKeys. func (s SharedKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "primarySharedKey", s.PrimarySharedKey) populate(objectMap, "secondarySharedKey", s.SecondarySharedKey) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SharedKeys. func (s *SharedKeys) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "primarySharedKey": err = unpopulate(val, "PrimarySharedKey", &s.PrimarySharedKey) delete(rawMsg, key) case "secondarySharedKey": err = unpopulate(val, "SecondarySharedKey", &s.SecondarySharedKey) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageAccount. func (s StorageAccount) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "key", s.Key) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. func (s *StorageAccount) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageInsight. func (s StorageInsight) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eTag", s.ETag) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsight. func (s *StorageInsight) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "eTag": err = unpopulate(val, "ETag", &s.ETag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageInsightListResult. func (s StorageInsightListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "@odata.nextLink", s.ODataNextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightListResult. func (s *StorageInsightListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "@odata.nextLink": err = unpopulate(val, "ODataNextLink", &s.ODataNextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageInsightProperties. func (s StorageInsightProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "containers", s.Containers) populate(objectMap, "status", s.Status) populate(objectMap, "storageAccount", s.StorageAccount) populate(objectMap, "tables", s.Tables) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightProperties. func (s *StorageInsightProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "containers": err = unpopulate(val, "Containers", &s.Containers) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) case "storageAccount": err = unpopulate(val, "StorageAccount", &s.StorageAccount) delete(rawMsg, key) case "tables": err = unpopulate(val, "Tables", &s.Tables) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageInsightStatus. func (s StorageInsightStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", s.Description) populate(objectMap, "state", s.State) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageInsightStatus. func (s *StorageInsightStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. func (s SystemDataAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemDataAutoGenerated. func (s *SystemDataAutoGenerated) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Table. func (t Table) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Table. func (t *Table) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TableProperties. func (t TableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "archiveRetentionInDays", t.ArchiveRetentionInDays) populate(objectMap, "lastPlanModifiedDate", t.LastPlanModifiedDate) populate(objectMap, "plan", t.Plan) populate(objectMap, "provisioningState", t.ProvisioningState) populate(objectMap, "restoredLogs", t.RestoredLogs) populate(objectMap, "resultStatistics", t.ResultStatistics) populate(objectMap, "retentionInDays", t.RetentionInDays) populate(objectMap, "schema", t.Schema) populate(objectMap, "searchResults", t.SearchResults) populate(objectMap, "totalRetentionInDays", t.TotalRetentionInDays) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TableProperties. func (t *TableProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "archiveRetentionInDays": err = unpopulate(val, "ArchiveRetentionInDays", &t.ArchiveRetentionInDays) delete(rawMsg, key) case "lastPlanModifiedDate": err = unpopulate(val, "LastPlanModifiedDate", &t.LastPlanModifiedDate) delete(rawMsg, key) case "plan": err = unpopulate(val, "Plan", &t.Plan) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) case "restoredLogs": err = unpopulate(val, "RestoredLogs", &t.RestoredLogs) delete(rawMsg, key) case "resultStatistics": err = unpopulate(val, "ResultStatistics", &t.ResultStatistics) delete(rawMsg, key) case "retentionInDays": err = unpopulate(val, "RetentionInDays", &t.RetentionInDays) delete(rawMsg, key) case "schema": err = unpopulate(val, "Schema", &t.Schema) delete(rawMsg, key) case "searchResults": err = unpopulate(val, "SearchResults", &t.SearchResults) delete(rawMsg, key) case "totalRetentionInDays": err = unpopulate(val, "TotalRetentionInDays", &t.TotalRetentionInDays) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TablesListResult. func (t TablesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TablesListResult. func (t *TablesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Tag. func (t Tag) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", t.Name) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Tag. func (t *Tag) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TagsResource. func (t TagsResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource. func (t *TagsResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. func (t *TrackedResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UsageMetric. func (u UsageMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "currentValue", u.CurrentValue) populate(objectMap, "limit", u.Limit) populate(objectMap, "name", u.Name) populateDateTimeRFC3339(objectMap, "nextResetTime", u.NextResetTime) populate(objectMap, "quotaPeriod", u.QuotaPeriod) populate(objectMap, "unit", u.Unit) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UsageMetric. func (u *UsageMetric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "currentValue": err = unpopulate(val, "CurrentValue", &u.CurrentValue) delete(rawMsg, key) case "limit": err = unpopulate(val, "Limit", &u.Limit) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &u.Name) delete(rawMsg, key) case "nextResetTime": err = unpopulateDateTimeRFC3339(val, "NextResetTime", &u.NextResetTime) delete(rawMsg, key) case "quotaPeriod": err = unpopulate(val, "QuotaPeriod", &u.QuotaPeriod) delete(rawMsg, key) case "unit": err = unpopulate(val, "Unit", &u.Unit) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties. func (u UserIdentityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties. func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "clientId": err = unpopulate(val, "ClientID", &u.ClientID) delete(rawMsg, key) case "principalId": err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Workspace. func (w Workspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eTag", w.ETag) populate(objectMap, "id", w.ID) populate(objectMap, "location", w.Location) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) populate(objectMap, "systemData", w.SystemData) populate(objectMap, "tags", w.Tags) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Workspace. func (w *Workspace) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "eTag": err = unpopulate(val, "ETag", &w.ETag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &w.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &w.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &w.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &w.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &w.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceCapping. func (w WorkspaceCapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dailyQuotaGb", w.DailyQuotaGb) populate(objectMap, "dataIngestionStatus", w.DataIngestionStatus) populate(objectMap, "quotaNextResetTime", w.QuotaNextResetTime) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceCapping. func (w *WorkspaceCapping) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "dailyQuotaGb": err = unpopulate(val, "DailyQuotaGb", &w.DailyQuotaGb) delete(rawMsg, key) case "dataIngestionStatus": err = unpopulate(val, "DataIngestionStatus", &w.DataIngestionStatus) delete(rawMsg, key) case "quotaNextResetTime": err = unpopulate(val, "QuotaNextResetTime", &w.QuotaNextResetTime) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceFeatures. func (w WorkspaceFeatures) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clusterResourceId", w.ClusterResourceID) populate(objectMap, "disableLocalAuth", w.DisableLocalAuth) populate(objectMap, "enableDataExport", w.EnableDataExport) populate(objectMap, "enableLogAccessUsingOnlyResourcePermissions", w.EnableLogAccessUsingOnlyResourcePermissions) populate(objectMap, "immediatePurgeDataOn30Days", w.ImmediatePurgeDataOn30Days) if w.AdditionalProperties != nil { for key, val := range w.AdditionalProperties { objectMap[key] = val } } return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceFeatures. func (w *WorkspaceFeatures) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "clusterResourceId": err = unpopulate(val, "ClusterResourceID", &w.ClusterResourceID) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &w.DisableLocalAuth) delete(rawMsg, key) case "enableDataExport": err = unpopulate(val, "EnableDataExport", &w.EnableDataExport) delete(rawMsg, key) case "enableLogAccessUsingOnlyResourcePermissions": err = unpopulate(val, "EnableLogAccessUsingOnlyResourcePermissions", &w.EnableLogAccessUsingOnlyResourcePermissions) delete(rawMsg, key) case "immediatePurgeDataOn30Days": err = unpopulate(val, "ImmediatePurgeDataOn30Days", &w.ImmediatePurgeDataOn30Days) delete(rawMsg, key) default: if w.AdditionalProperties == nil { w.AdditionalProperties = map[string]any{} } if val != nil { var aux any err = json.Unmarshal(val, &aux) w.AdditionalProperties[key] = aux } delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceListManagementGroupsResult. func (w WorkspaceListManagementGroupsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListManagementGroupsResult. func (w *WorkspaceListManagementGroupsResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceListResult. func (w WorkspaceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListResult. func (w *WorkspaceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceListUsagesResult. func (w WorkspaceListUsagesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListUsagesResult. func (w *WorkspaceListUsagesResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "value": err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. func (w WorkspacePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", w.Etag) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) populate(objectMap, "tags", w.Tags) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePatch. func (w *WorkspacePatch) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "etag": err = unpopulate(val, "Etag", &w.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &w.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &w.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &w.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "createdDate", w.CreatedDate) populate(objectMap, "customerId", w.CustomerID) populate(objectMap, "defaultDataCollectionRuleResourceId", w.DefaultDataCollectionRuleResourceID) populate(objectMap, "features", w.Features) populate(objectMap, "forceCmkForQuery", w.ForceCmkForQuery) populate(objectMap, "modifiedDate", w.ModifiedDate) populate(objectMap, "privateLinkScopedResources", w.PrivateLinkScopedResources) populate(objectMap, "provisioningState", w.ProvisioningState) populate(objectMap, "publicNetworkAccessForIngestion", w.PublicNetworkAccessForIngestion) populate(objectMap, "publicNetworkAccessForQuery", w.PublicNetworkAccessForQuery) populate(objectMap, "retentionInDays", w.RetentionInDays) populate(objectMap, "sku", w.SKU) populate(objectMap, "workspaceCapping", w.WorkspaceCapping) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceProperties. func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "createdDate": err = unpopulate(val, "CreatedDate", &w.CreatedDate) delete(rawMsg, key) case "customerId": err = unpopulate(val, "CustomerID", &w.CustomerID) delete(rawMsg, key) case "defaultDataCollectionRuleResourceId": err = unpopulate(val, "DefaultDataCollectionRuleResourceID", &w.DefaultDataCollectionRuleResourceID) delete(rawMsg, key) case "features": err = unpopulate(val, "Features", &w.Features) delete(rawMsg, key) case "forceCmkForQuery": err = unpopulate(val, "ForceCmkForQuery", &w.ForceCmkForQuery) delete(rawMsg, key) case "modifiedDate": err = unpopulate(val, "ModifiedDate", &w.ModifiedDate) delete(rawMsg, key) case "privateLinkScopedResources": err = unpopulate(val, "PrivateLinkScopedResources", &w.PrivateLinkScopedResources) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccessForIngestion": err = unpopulate(val, "PublicNetworkAccessForIngestion", &w.PublicNetworkAccessForIngestion) delete(rawMsg, key) case "publicNetworkAccessForQuery": err = unpopulate(val, "PublicNetworkAccessForQuery", &w.PublicNetworkAccessForQuery) delete(rawMsg, key) case "retentionInDays": err = unpopulate(val, "RetentionInDays", &w.RetentionInDays) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &w.SKU) delete(rawMsg, key) case "workspaceCapping": err = unpopulate(val, "WorkspaceCapping", &w.WorkspaceCapping) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeBody. func (w WorkspacePurgeBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "filters", w.Filters) populate(objectMap, "table", w.Table) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeBody. func (w *WorkspacePurgeBody) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "filters": err = unpopulate(val, "Filters", &w.Filters) delete(rawMsg, key) case "table": err = unpopulate(val, "Table", &w.Table) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeBodyFilters. func (w WorkspacePurgeBodyFilters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "column", w.Column) populate(objectMap, "key", w.Key) populate(objectMap, "operator", w.Operator) populateAny(objectMap, "value", w.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeBodyFilters. func (w *WorkspacePurgeBodyFilters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "column": err = unpopulate(val, "Column", &w.Column) delete(rawMsg, key) case "key": err = unpopulate(val, "Key", &w.Key) delete(rawMsg, key) case "operator": err = unpopulate(val, "Operator", &w.Operator) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &w.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeResponse. func (w WorkspacePurgeResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "operationId", w.OperationID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeResponse. func (w *WorkspacePurgeResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "operationId": err = unpopulate(val, "OperationID", &w.OperationID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspacePurgeStatusResponse. func (w WorkspacePurgeStatusResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "status", w.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspacePurgeStatusResponse. func (w *WorkspacePurgeStatusResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "status": err = unpopulate(val, "Status", &w.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WorkspaceSKU. func (w WorkspaceSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacityReservationLevel", w.CapacityReservationLevel) populate(objectMap, "lastSkuUpdate", w.LastSKUUpdate) populate(objectMap, "name", w.Name) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceSKU. func (w *WorkspaceSKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "capacityReservationLevel": err = unpopulate(val, "CapacityReservationLevel", &w.CapacityReservationLevel) delete(rawMsg, key) case "lastSkuUpdate": err = unpopulate(val, "LastSKUUpdate", &w.LastSKUUpdate) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &w.Name) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil } else if !reflect.ValueOf(v).IsNil() { m[k] = v } } func populateAny(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil } else { m[k] = v } } func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { return fmt.Errorf("struct field %s: %v", fn, err) } return nil }