//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 arminformaticadatamgmt

import (
	"encoding/json"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
	"reflect"
)

// MarshalJSON implements the json.Marshaller interface for type AdvancedCustomProperties.
func (a AdvancedCustomProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "key", a.Key)
	populate(objectMap, "value", a.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedCustomProperties.
func (a *AdvancedCustomProperties) 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 "key":
			err = unpopulate(val, "Key", &a.Key)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &a.Value)
			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 ApplicationConfigs.
func (a ApplicationConfigs) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "customized", a.Customized)
	populate(objectMap, "defaultValue", a.DefaultValue)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "platform", a.Platform)
	populate(objectMap, "type", a.Type)
	populate(objectMap, "value", a.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationConfigs.
func (a *ApplicationConfigs) 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 "customized":
			err = unpopulate(val, "Customized", &a.Customized)
			delete(rawMsg, key)
		case "defaultValue":
			err = unpopulate(val, "DefaultValue", &a.DefaultValue)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "platform":
			err = unpopulate(val, "Platform", &a.Platform)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &a.Value)
			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 ApplicationTypeMetadata.
func (a ApplicationTypeMetadata) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "value", a.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationTypeMetadata.
func (a *ApplicationTypeMetadata) 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 "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &a.Value)
			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 CdiConfigProps.
func (c CdiConfigProps) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "applicationConfigs", c.ApplicationConfigs)
	populate(objectMap, "engineName", c.EngineName)
	populate(objectMap, "engineVersion", c.EngineVersion)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CdiConfigProps.
func (c *CdiConfigProps) 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 "applicationConfigs":
			err = unpopulate(val, "ApplicationConfigs", &c.ApplicationConfigs)
			delete(rawMsg, key)
		case "engineName":
			err = unpopulate(val, "EngineName", &c.EngineName)
			delete(rawMsg, key)
		case "engineVersion":
			err = unpopulate(val, "EngineVersion", &c.EngineVersion)
			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 CheckDependenciesResponse.
func (c CheckDependenciesResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "count", c.Count)
	populate(objectMap, "id", c.ID)
	populate(objectMap, "references", c.References)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CheckDependenciesResponse.
func (c *CheckDependenciesResponse) 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 "count":
			err = unpopulate(val, "Count", &c.Count)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &c.ID)
			delete(rawMsg, key)
		case "references":
			err = unpopulate(val, "References", &c.References)
			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 CompanyDetails.
func (c CompanyDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "business", c.Business)
	populate(objectMap, "companyName", c.CompanyName)
	populate(objectMap, "country", c.Country)
	populate(objectMap, "domain", c.Domain)
	populate(objectMap, "numberOfEmployees", c.NumberOfEmployees)
	populate(objectMap, "officeAddress", c.OfficeAddress)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CompanyDetails.
func (c *CompanyDetails) 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 "business":
			err = unpopulate(val, "Business", &c.Business)
			delete(rawMsg, key)
		case "companyName":
			err = unpopulate(val, "CompanyName", &c.CompanyName)
			delete(rawMsg, key)
		case "country":
			err = unpopulate(val, "Country", &c.Country)
			delete(rawMsg, key)
		case "domain":
			err = unpopulate(val, "Domain", &c.Domain)
			delete(rawMsg, key)
		case "numberOfEmployees":
			err = unpopulate(val, "NumberOfEmployees", &c.NumberOfEmployees)
			delete(rawMsg, key)
		case "officeAddress":
			err = unpopulate(val, "OfficeAddress", &c.OfficeAddress)
			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 CompanyDetailsUpdate.
func (c CompanyDetailsUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "business", c.Business)
	populate(objectMap, "companyName", c.CompanyName)
	populate(objectMap, "country", c.Country)
	populate(objectMap, "domain", c.Domain)
	populate(objectMap, "numberOfEmployees", c.NumberOfEmployees)
	populate(objectMap, "officeAddress", c.OfficeAddress)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CompanyDetailsUpdate.
func (c *CompanyDetailsUpdate) 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 "business":
			err = unpopulate(val, "Business", &c.Business)
			delete(rawMsg, key)
		case "companyName":
			err = unpopulate(val, "CompanyName", &c.CompanyName)
			delete(rawMsg, key)
		case "country":
			err = unpopulate(val, "Country", &c.Country)
			delete(rawMsg, key)
		case "domain":
			err = unpopulate(val, "Domain", &c.Domain)
			delete(rawMsg, key)
		case "numberOfEmployees":
			err = unpopulate(val, "NumberOfEmployees", &c.NumberOfEmployees)
			delete(rawMsg, key)
		case "officeAddress":
			err = unpopulate(val, "OfficeAddress", &c.OfficeAddress)
			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 ComputeUnitsMetadata.
func (c ComputeUnitsMetadata) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "value", c.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ComputeUnitsMetadata.
func (c *ComputeUnitsMetadata) 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 "name":
			err = unpopulate(val, "Name", &c.Name)
			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 InfaRuntimeResourceFetchMetaData.
func (i InfaRuntimeResourceFetchMetaData) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "createdBy", i.CreatedBy)
	populate(objectMap, "createdTime", i.CreatedTime)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "id", i.ID)
	populate(objectMap, "name", i.Name)
	populate(objectMap, "serverlessConfigProperties", i.ServerlessConfigProperties)
	populate(objectMap, "status", i.Status)
	populate(objectMap, "statusLocalized", i.StatusLocalized)
	populate(objectMap, "statusMessage", i.StatusMessage)
	populate(objectMap, "type", i.Type)
	populate(objectMap, "updatedBy", i.UpdatedBy)
	populate(objectMap, "updatedTime", i.UpdatedTime)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InfaRuntimeResourceFetchMetaData.
func (i *InfaRuntimeResourceFetchMetaData) 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 "createdBy":
			err = unpopulate(val, "CreatedBy", &i.CreatedBy)
			delete(rawMsg, key)
		case "createdTime":
			err = unpopulate(val, "CreatedTime", &i.CreatedTime)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "serverlessConfigProperties":
			err = unpopulate(val, "ServerlessConfigProperties", &i.ServerlessConfigProperties)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &i.Status)
			delete(rawMsg, key)
		case "statusLocalized":
			err = unpopulate(val, "StatusLocalized", &i.StatusLocalized)
			delete(rawMsg, key)
		case "statusMessage":
			err = unpopulate(val, "StatusMessage", &i.StatusMessage)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "updatedBy":
			err = unpopulate(val, "UpdatedBy", &i.UpdatedBy)
			delete(rawMsg, key)
		case "updatedTime":
			err = unpopulate(val, "UpdatedTime", &i.UpdatedTime)
			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 InfaServerlessFetchConfigProperties.
func (i InfaServerlessFetchConfigProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "advancedCustomProperties", i.AdvancedCustomProperties)
	populate(objectMap, "applicationType", i.ApplicationType)
	populate(objectMap, "computeUnits", i.ComputeUnits)
	populate(objectMap, "executionTimeout", i.ExecutionTimeout)
	populate(objectMap, "platform", i.Platform)
	populate(objectMap, "region", i.Region)
	populate(objectMap, "resourceGroupName", i.ResourceGroupName)
	populate(objectMap, "serverlessArmResourceId", i.ServerlessArmResourceID)
	populate(objectMap, "subnet", i.Subnet)
	populate(objectMap, "subscriptionId", i.SubscriptionID)
	populate(objectMap, "supplementaryFileLocation", i.SupplementaryFileLocation)
	populate(objectMap, "tags", i.Tags)
	populate(objectMap, "tenantId", i.TenantID)
	populate(objectMap, "vnet", i.Vnet)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InfaServerlessFetchConfigProperties.
func (i *InfaServerlessFetchConfigProperties) 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 "advancedCustomProperties":
			err = unpopulate(val, "AdvancedCustomProperties", &i.AdvancedCustomProperties)
			delete(rawMsg, key)
		case "applicationType":
			err = unpopulate(val, "ApplicationType", &i.ApplicationType)
			delete(rawMsg, key)
		case "computeUnits":
			err = unpopulate(val, "ComputeUnits", &i.ComputeUnits)
			delete(rawMsg, key)
		case "executionTimeout":
			err = unpopulate(val, "ExecutionTimeout", &i.ExecutionTimeout)
			delete(rawMsg, key)
		case "platform":
			err = unpopulate(val, "Platform", &i.Platform)
			delete(rawMsg, key)
		case "region":
			err = unpopulate(val, "Region", &i.Region)
			delete(rawMsg, key)
		case "resourceGroupName":
			err = unpopulate(val, "ResourceGroupName", &i.ResourceGroupName)
			delete(rawMsg, key)
		case "serverlessArmResourceId":
			err = unpopulate(val, "ServerlessArmResourceID", &i.ServerlessArmResourceID)
			delete(rawMsg, key)
		case "subnet":
			err = unpopulate(val, "Subnet", &i.Subnet)
			delete(rawMsg, key)
		case "subscriptionId":
			err = unpopulate(val, "SubscriptionID", &i.SubscriptionID)
			delete(rawMsg, key)
		case "supplementaryFileLocation":
			err = unpopulate(val, "SupplementaryFileLocation", &i.SupplementaryFileLocation)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &i.Tags)
			delete(rawMsg, key)
		case "tenantId":
			err = unpopulate(val, "TenantID", &i.TenantID)
			delete(rawMsg, key)
		case "vnet":
			err = unpopulate(val, "Vnet", &i.Vnet)
			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 InformaticaOrganizationResource.
func (i InformaticaOrganizationResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", i.ID)
	populate(objectMap, "location", i.Location)
	populate(objectMap, "name", i.Name)
	populate(objectMap, "properties", i.Properties)
	populate(objectMap, "systemData", i.SystemData)
	populate(objectMap, "tags", i.Tags)
	populate(objectMap, "type", i.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaOrganizationResource.
func (i *InformaticaOrganizationResource) 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 "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &i.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &i.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &i.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &i.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			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 InformaticaOrganizationResourceListResult.
func (i InformaticaOrganizationResourceListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "nextLink", i.NextLink)
	populate(objectMap, "value", i.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaOrganizationResourceListResult.
func (i *InformaticaOrganizationResourceListResult) 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 "nextLink":
			err = unpopulate(val, "NextLink", &i.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &i.Value)
			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 InformaticaOrganizationResourceUpdate.
func (i InformaticaOrganizationResourceUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", i.Properties)
	populate(objectMap, "tags", i.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaOrganizationResourceUpdate.
func (i *InformaticaOrganizationResourceUpdate) 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 "properties":
			err = unpopulate(val, "Properties", &i.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &i.Tags)
			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 InformaticaProperties.
func (i InformaticaProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "informaticaRegion", i.InformaticaRegion)
	populate(objectMap, "organizationId", i.OrganizationID)
	populate(objectMap, "organizationName", i.OrganizationName)
	populate(objectMap, "singleSignOnUrl", i.SingleSignOnURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaProperties.
func (i *InformaticaProperties) 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 "informaticaRegion":
			err = unpopulate(val, "InformaticaRegion", &i.InformaticaRegion)
			delete(rawMsg, key)
		case "organizationId":
			err = unpopulate(val, "OrganizationID", &i.OrganizationID)
			delete(rawMsg, key)
		case "organizationName":
			err = unpopulate(val, "OrganizationName", &i.OrganizationName)
			delete(rawMsg, key)
		case "singleSignOnUrl":
			err = unpopulate(val, "SingleSignOnURL", &i.SingleSignOnURL)
			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 InformaticaServerlessRuntimeProperties.
func (i InformaticaServerlessRuntimeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "advancedCustomProperties", i.AdvancedCustomProperties)
	populate(objectMap, "applicationType", i.ApplicationType)
	populate(objectMap, "computeUnits", i.ComputeUnits)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "executionTimeout", i.ExecutionTimeout)
	populate(objectMap, "platform", i.Platform)
	populate(objectMap, "provisioningState", i.ProvisioningState)
	populate(objectMap, "serverlessAccountLocation", i.ServerlessAccountLocation)
	populate(objectMap, "serverlessRuntimeConfig", i.ServerlessRuntimeConfig)
	populate(objectMap, "serverlessRuntimeNetworkProfile", i.ServerlessRuntimeNetworkProfile)
	populate(objectMap, "serverlessRuntimeTags", i.ServerlessRuntimeTags)
	populate(objectMap, "serverlessRuntimeUserContextProperties", i.ServerlessRuntimeUserContextProperties)
	populate(objectMap, "supplementaryFileLocation", i.SupplementaryFileLocation)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaServerlessRuntimeProperties.
func (i *InformaticaServerlessRuntimeProperties) 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 "advancedCustomProperties":
			err = unpopulate(val, "AdvancedCustomProperties", &i.AdvancedCustomProperties)
			delete(rawMsg, key)
		case "applicationType":
			err = unpopulate(val, "ApplicationType", &i.ApplicationType)
			delete(rawMsg, key)
		case "computeUnits":
			err = unpopulate(val, "ComputeUnits", &i.ComputeUnits)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "executionTimeout":
			err = unpopulate(val, "ExecutionTimeout", &i.ExecutionTimeout)
			delete(rawMsg, key)
		case "platform":
			err = unpopulate(val, "Platform", &i.Platform)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &i.ProvisioningState)
			delete(rawMsg, key)
		case "serverlessAccountLocation":
			err = unpopulate(val, "ServerlessAccountLocation", &i.ServerlessAccountLocation)
			delete(rawMsg, key)
		case "serverlessRuntimeConfig":
			err = unpopulate(val, "ServerlessRuntimeConfig", &i.ServerlessRuntimeConfig)
			delete(rawMsg, key)
		case "serverlessRuntimeNetworkProfile":
			err = unpopulate(val, "ServerlessRuntimeNetworkProfile", &i.ServerlessRuntimeNetworkProfile)
			delete(rawMsg, key)
		case "serverlessRuntimeTags":
			err = unpopulate(val, "ServerlessRuntimeTags", &i.ServerlessRuntimeTags)
			delete(rawMsg, key)
		case "serverlessRuntimeUserContextProperties":
			err = unpopulate(val, "ServerlessRuntimeUserContextProperties", &i.ServerlessRuntimeUserContextProperties)
			delete(rawMsg, key)
		case "supplementaryFileLocation":
			err = unpopulate(val, "SupplementaryFileLocation", &i.SupplementaryFileLocation)
			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 InformaticaServerlessRuntimeResource.
func (i InformaticaServerlessRuntimeResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", i.ID)
	populate(objectMap, "name", i.Name)
	populate(objectMap, "properties", i.Properties)
	populate(objectMap, "systemData", i.SystemData)
	populate(objectMap, "type", i.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaServerlessRuntimeResource.
func (i *InformaticaServerlessRuntimeResource) 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 "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &i.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &i.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			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 InformaticaServerlessRuntimeResourceList.
func (i InformaticaServerlessRuntimeResourceList) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "informaticaRuntimeResources", i.InformaticaRuntimeResources)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaServerlessRuntimeResourceList.
func (i *InformaticaServerlessRuntimeResourceList) 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 "informaticaRuntimeResources":
			err = unpopulate(val, "InformaticaRuntimeResources", &i.InformaticaRuntimeResources)
			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 InformaticaServerlessRuntimeResourceListResult.
func (i InformaticaServerlessRuntimeResourceListResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "nextLink", i.NextLink)
	populate(objectMap, "value", i.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaServerlessRuntimeResourceListResult.
func (i *InformaticaServerlessRuntimeResourceListResult) 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 "nextLink":
			err = unpopulate(val, "NextLink", &i.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &i.Value)
			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 InformaticaServerlessRuntimeResourceUpdate.
func (i InformaticaServerlessRuntimeResourceUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", i.Properties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformaticaServerlessRuntimeResourceUpdate.
func (i *InformaticaServerlessRuntimeResourceUpdate) 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 "properties":
			err = unpopulate(val, "Properties", &i.Properties)
			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 LinkOrganization.
func (l LinkOrganization) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "token", l.Token)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LinkOrganization.
func (l *LinkOrganization) 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 "token":
			err = unpopulate(val, "Token", &l.Token)
			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 MarketplaceDetails.
func (m MarketplaceDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "marketplaceSubscriptionId", m.MarketplaceSubscriptionID)
	populate(objectMap, "offerDetails", m.OfferDetails)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceDetails.
func (m *MarketplaceDetails) 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 "marketplaceSubscriptionId":
			err = unpopulate(val, "MarketplaceSubscriptionID", &m.MarketplaceSubscriptionID)
			delete(rawMsg, key)
		case "offerDetails":
			err = unpopulate(val, "OfferDetails", &m.OfferDetails)
			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 MarketplaceDetailsUpdate.
func (m MarketplaceDetailsUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "marketplaceSubscriptionId", m.MarketplaceSubscriptionID)
	populate(objectMap, "offerDetails", m.OfferDetails)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceDetailsUpdate.
func (m *MarketplaceDetailsUpdate) 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 "marketplaceSubscriptionId":
			err = unpopulate(val, "MarketplaceSubscriptionID", &m.MarketplaceSubscriptionID)
			delete(rawMsg, key)
		case "offerDetails":
			err = unpopulate(val, "OfferDetails", &m.OfferDetails)
			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 NetworkInterfaceConfiguration.
func (n NetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "subnetId", n.SubnetID)
	populate(objectMap, "vnetId", n.VnetID)
	populate(objectMap, "vnetResourceGuid", n.VnetResourceGUID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceConfiguration.
func (n *NetworkInterfaceConfiguration) 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", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "subnetId":
			err = unpopulate(val, "SubnetID", &n.SubnetID)
			delete(rawMsg, key)
		case "vnetId":
			err = unpopulate(val, "VnetID", &n.VnetID)
			delete(rawMsg, key)
		case "vnetResourceGuid":
			err = unpopulate(val, "VnetResourceGUID", &n.VnetResourceGUID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkInterfaceConfigurationUpdate.
func (n NetworkInterfaceConfigurationUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "subnetId", n.SubnetID)
	populate(objectMap, "vnetId", n.VnetID)
	populate(objectMap, "vnetResourceGuid", n.VnetResourceGUID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkInterfaceConfigurationUpdate.
func (n *NetworkInterfaceConfigurationUpdate) 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", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "subnetId":
			err = unpopulate(val, "SubnetID", &n.SubnetID)
			delete(rawMsg, key)
		case "vnetId":
			err = unpopulate(val, "VnetID", &n.VnetID)
			delete(rawMsg, key)
		case "vnetResourceGuid":
			err = unpopulate(val, "VnetResourceGUID", &n.VnetResourceGUID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OfferDetails.
func (o OfferDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "offerId", o.OfferID)
	populate(objectMap, "planId", o.PlanID)
	populate(objectMap, "planName", o.PlanName)
	populate(objectMap, "publisherId", o.PublisherID)
	populate(objectMap, "termId", o.TermID)
	populate(objectMap, "termUnit", o.TermUnit)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OfferDetails.
func (o *OfferDetails) 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 "offerId":
			err = unpopulate(val, "OfferID", &o.OfferID)
			delete(rawMsg, key)
		case "planId":
			err = unpopulate(val, "PlanID", &o.PlanID)
			delete(rawMsg, key)
		case "planName":
			err = unpopulate(val, "PlanName", &o.PlanName)
			delete(rawMsg, key)
		case "publisherId":
			err = unpopulate(val, "PublisherID", &o.PublisherID)
			delete(rawMsg, key)
		case "termId":
			err = unpopulate(val, "TermID", &o.TermID)
			delete(rawMsg, key)
		case "termUnit":
			err = unpopulate(val, "TermUnit", &o.TermUnit)
			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 OfferDetailsUpdate.
func (o OfferDetailsUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "offerId", o.OfferID)
	populate(objectMap, "planId", o.PlanID)
	populate(objectMap, "planName", o.PlanName)
	populate(objectMap, "publisherId", o.PublisherID)
	populate(objectMap, "termId", o.TermID)
	populate(objectMap, "termUnit", o.TermUnit)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OfferDetailsUpdate.
func (o *OfferDetailsUpdate) 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 "offerId":
			err = unpopulate(val, "OfferID", &o.OfferID)
			delete(rawMsg, key)
		case "planId":
			err = unpopulate(val, "PlanID", &o.PlanID)
			delete(rawMsg, key)
		case "planName":
			err = unpopulate(val, "PlanName", &o.PlanName)
			delete(rawMsg, key)
		case "publisherId":
			err = unpopulate(val, "PublisherID", &o.PublisherID)
			delete(rawMsg, key)
		case "termId":
			err = unpopulate(val, "TermID", &o.TermID)
			delete(rawMsg, key)
		case "termUnit":
			err = unpopulate(val, "TermUnit", &o.TermUnit)
			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 Operation.
func (o Operation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "actionType", o.ActionType)
	populate(objectMap, "display", o.Display)
	populate(objectMap, "isDataAction", o.IsDataAction)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "origin", o.Origin)
	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 "actionType":
			err = unpopulate(val, "ActionType", &o.ActionType)
			delete(rawMsg, key)
		case "display":
			err = unpopulate(val, "Display", &o.Display)
			delete(rawMsg, key)
		case "isDataAction":
			err = unpopulate(val, "IsDataAction", &o.IsDataAction)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &o.Name)
			delete(rawMsg, key)
		case "origin":
			err = unpopulate(val, "Origin", &o.Origin)
			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 OrganizationProperties.
func (o OrganizationProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "companyDetails", o.CompanyDetails)
	populate(objectMap, "informaticaProperties", o.InformaticaProperties)
	populate(objectMap, "linkOrganization", o.LinkOrganization)
	populate(objectMap, "marketplaceDetails", o.MarketplaceDetails)
	populate(objectMap, "provisioningState", o.ProvisioningState)
	populate(objectMap, "userDetails", o.UserDetails)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrganizationProperties.
func (o *OrganizationProperties) 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 "companyDetails":
			err = unpopulate(val, "CompanyDetails", &o.CompanyDetails)
			delete(rawMsg, key)
		case "informaticaProperties":
			err = unpopulate(val, "InformaticaProperties", &o.InformaticaProperties)
			delete(rawMsg, key)
		case "linkOrganization":
			err = unpopulate(val, "LinkOrganization", &o.LinkOrganization)
			delete(rawMsg, key)
		case "marketplaceDetails":
			err = unpopulate(val, "MarketplaceDetails", &o.MarketplaceDetails)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &o.ProvisioningState)
			delete(rawMsg, key)
		case "userDetails":
			err = unpopulate(val, "UserDetails", &o.UserDetails)
			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 OrganizationPropertiesCustomUpdate.
func (o OrganizationPropertiesCustomUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "companyDetails", o.CompanyDetails)
	populate(objectMap, "existingResourceId", o.ExistingResourceID)
	populate(objectMap, "informaticaOrganizationProperties", o.InformaticaOrganizationProperties)
	populate(objectMap, "marketplaceDetails", o.MarketplaceDetails)
	populate(objectMap, "userDetails", o.UserDetails)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrganizationPropertiesCustomUpdate.
func (o *OrganizationPropertiesCustomUpdate) 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 "companyDetails":
			err = unpopulate(val, "CompanyDetails", &o.CompanyDetails)
			delete(rawMsg, key)
		case "existingResourceId":
			err = unpopulate(val, "ExistingResourceID", &o.ExistingResourceID)
			delete(rawMsg, key)
		case "informaticaOrganizationProperties":
			err = unpopulate(val, "InformaticaOrganizationProperties", &o.InformaticaOrganizationProperties)
			delete(rawMsg, key)
		case "marketplaceDetails":
			err = unpopulate(val, "MarketplaceDetails", &o.MarketplaceDetails)
			delete(rawMsg, key)
		case "userDetails":
			err = unpopulate(val, "UserDetails", &o.UserDetails)
			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 RegionsMetadata.
func (r RegionsMetadata) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", r.ID)
	populate(objectMap, "name", r.Name)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RegionsMetadata.
func (r *RegionsMetadata) 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)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ServerlessConfigProperties.
func (s ServerlessConfigProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "applicationTypes", s.ApplicationTypes)
	populate(objectMap, "computeUnits", s.ComputeUnits)
	populate(objectMap, "executionTimeout", s.ExecutionTimeout)
	populate(objectMap, "platform", s.Platform)
	populate(objectMap, "regions", s.Regions)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessConfigProperties.
func (s *ServerlessConfigProperties) 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 "applicationTypes":
			err = unpopulate(val, "ApplicationTypes", &s.ApplicationTypes)
			delete(rawMsg, key)
		case "computeUnits":
			err = unpopulate(val, "ComputeUnits", &s.ComputeUnits)
			delete(rawMsg, key)
		case "executionTimeout":
			err = unpopulate(val, "ExecutionTimeout", &s.ExecutionTimeout)
			delete(rawMsg, key)
		case "platform":
			err = unpopulate(val, "Platform", &s.Platform)
			delete(rawMsg, key)
		case "regions":
			err = unpopulate(val, "Regions", &s.Regions)
			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 ServerlessMetadataResponse.
func (s ServerlessMetadataResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "serverlessConfigProperties", s.ServerlessConfigProperties)
	populate(objectMap, "serverlessRuntimeConfigProperties", s.ServerlessRuntimeConfigProperties)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessMetadataResponse.
func (s *ServerlessMetadataResponse) 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 "serverlessConfigProperties":
			err = unpopulate(val, "ServerlessConfigProperties", &s.ServerlessConfigProperties)
			delete(rawMsg, key)
		case "serverlessRuntimeConfigProperties":
			err = unpopulate(val, "ServerlessRuntimeConfigProperties", &s.ServerlessRuntimeConfigProperties)
			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 ServerlessRuntimeConfigProperties.
func (s ServerlessRuntimeConfigProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "cdiConfigProps", s.CdiConfigProps)
	populate(objectMap, "cdieConfigProps", s.CdieConfigProps)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeConfigProperties.
func (s *ServerlessRuntimeConfigProperties) 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 "cdiConfigProps":
			err = unpopulate(val, "CdiConfigProps", &s.CdiConfigProps)
			delete(rawMsg, key)
		case "cdieConfigProps":
			err = unpopulate(val, "CdieConfigProps", &s.CdieConfigProps)
			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 ServerlessRuntimeConfigPropertiesUpdate.
func (s ServerlessRuntimeConfigPropertiesUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "cdiConfigProps", s.CdiConfigProps)
	populate(objectMap, "cdieConfigProps", s.CdieConfigProps)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeConfigPropertiesUpdate.
func (s *ServerlessRuntimeConfigPropertiesUpdate) 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 "cdiConfigProps":
			err = unpopulate(val, "CdiConfigProps", &s.CdiConfigProps)
			delete(rawMsg, key)
		case "cdieConfigProps":
			err = unpopulate(val, "CdieConfigProps", &s.CdieConfigProps)
			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 ServerlessRuntimeDependency.
func (s ServerlessRuntimeDependency) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "appContextId", s.AppContextID)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "documentType", s.DocumentType)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "lastUpdatedTime", s.LastUpdatedTime)
	populate(objectMap, "path", s.Path)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeDependency.
func (s *ServerlessRuntimeDependency) 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 "appContextId":
			err = unpopulate(val, "AppContextID", &s.AppContextID)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "documentType":
			err = unpopulate(val, "DocumentType", &s.DocumentType)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &s.ID)
			delete(rawMsg, key)
		case "lastUpdatedTime":
			err = unpopulate(val, "LastUpdatedTime", &s.LastUpdatedTime)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &s.Path)
			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 ServerlessRuntimeNetworkProfile.
func (s ServerlessRuntimeNetworkProfile) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "networkInterfaceConfiguration", s.NetworkInterfaceConfiguration)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeNetworkProfile.
func (s *ServerlessRuntimeNetworkProfile) 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 "networkInterfaceConfiguration":
			err = unpopulate(val, "NetworkInterfaceConfiguration", &s.NetworkInterfaceConfiguration)
			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 ServerlessRuntimeNetworkProfileUpdate.
func (s ServerlessRuntimeNetworkProfileUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "networkInterfaceConfiguration", s.NetworkInterfaceConfiguration)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeNetworkProfileUpdate.
func (s *ServerlessRuntimeNetworkProfileUpdate) 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 "networkInterfaceConfiguration":
			err = unpopulate(val, "NetworkInterfaceConfiguration", &s.NetworkInterfaceConfiguration)
			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 ServerlessRuntimePropertiesCustomUpdate.
func (s ServerlessRuntimePropertiesCustomUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "advancedCustomProperties", s.AdvancedCustomProperties)
	populate(objectMap, "applicationType", s.ApplicationType)
	populate(objectMap, "computeUnits", s.ComputeUnits)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "executionTimeout", s.ExecutionTimeout)
	populate(objectMap, "platform", s.Platform)
	populate(objectMap, "serverlessAccountLocation", s.ServerlessAccountLocation)
	populate(objectMap, "serverlessRuntimeConfig", s.ServerlessRuntimeConfig)
	populate(objectMap, "serverlessRuntimeNetworkProfile", s.ServerlessRuntimeNetworkProfile)
	populate(objectMap, "serverlessRuntimeTags", s.ServerlessRuntimeTags)
	populate(objectMap, "serverlessRuntimeUserContextProperties", s.ServerlessRuntimeUserContextProperties)
	populate(objectMap, "supplementaryFileLocation", s.SupplementaryFileLocation)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimePropertiesCustomUpdate.
func (s *ServerlessRuntimePropertiesCustomUpdate) 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 "advancedCustomProperties":
			err = unpopulate(val, "AdvancedCustomProperties", &s.AdvancedCustomProperties)
			delete(rawMsg, key)
		case "applicationType":
			err = unpopulate(val, "ApplicationType", &s.ApplicationType)
			delete(rawMsg, key)
		case "computeUnits":
			err = unpopulate(val, "ComputeUnits", &s.ComputeUnits)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "executionTimeout":
			err = unpopulate(val, "ExecutionTimeout", &s.ExecutionTimeout)
			delete(rawMsg, key)
		case "platform":
			err = unpopulate(val, "Platform", &s.Platform)
			delete(rawMsg, key)
		case "serverlessAccountLocation":
			err = unpopulate(val, "ServerlessAccountLocation", &s.ServerlessAccountLocation)
			delete(rawMsg, key)
		case "serverlessRuntimeConfig":
			err = unpopulate(val, "ServerlessRuntimeConfig", &s.ServerlessRuntimeConfig)
			delete(rawMsg, key)
		case "serverlessRuntimeNetworkProfile":
			err = unpopulate(val, "ServerlessRuntimeNetworkProfile", &s.ServerlessRuntimeNetworkProfile)
			delete(rawMsg, key)
		case "serverlessRuntimeTags":
			err = unpopulate(val, "ServerlessRuntimeTags", &s.ServerlessRuntimeTags)
			delete(rawMsg, key)
		case "serverlessRuntimeUserContextProperties":
			err = unpopulate(val, "ServerlessRuntimeUserContextProperties", &s.ServerlessRuntimeUserContextProperties)
			delete(rawMsg, key)
		case "supplementaryFileLocation":
			err = unpopulate(val, "SupplementaryFileLocation", &s.SupplementaryFileLocation)
			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 ServerlessRuntimeTag.
func (s ServerlessRuntimeTag) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "value", s.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeTag.
func (s *ServerlessRuntimeTag) 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 "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 ServerlessRuntimeUserContextProperties.
func (s ServerlessRuntimeUserContextProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "userContextToken", s.UserContextToken)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeUserContextProperties.
func (s *ServerlessRuntimeUserContextProperties) 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 "userContextToken":
			err = unpopulate(val, "UserContextToken", &s.UserContextToken)
			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 ServerlessRuntimeUserContextPropertiesUpdate.
func (s ServerlessRuntimeUserContextPropertiesUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "userContextToken", s.UserContextToken)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessRuntimeUserContextPropertiesUpdate.
func (s *ServerlessRuntimeUserContextPropertiesUpdate) 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 "userContextToken":
			err = unpopulate(val, "UserContextToken", &s.UserContextToken)
			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 UserDetails.
func (u UserDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "emailAddress", u.EmailAddress)
	populate(objectMap, "firstName", u.FirstName)
	populate(objectMap, "lastName", u.LastName)
	populate(objectMap, "phoneNumber", u.PhoneNumber)
	populate(objectMap, "upn", u.Upn)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UserDetails.
func (u *UserDetails) 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 "emailAddress":
			err = unpopulate(val, "EmailAddress", &u.EmailAddress)
			delete(rawMsg, key)
		case "firstName":
			err = unpopulate(val, "FirstName", &u.FirstName)
			delete(rawMsg, key)
		case "lastName":
			err = unpopulate(val, "LastName", &u.LastName)
			delete(rawMsg, key)
		case "phoneNumber":
			err = unpopulate(val, "PhoneNumber", &u.PhoneNumber)
			delete(rawMsg, key)
		case "upn":
			err = unpopulate(val, "Upn", &u.Upn)
			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 UserDetailsUpdate.
func (u UserDetailsUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "emailAddress", u.EmailAddress)
	populate(objectMap, "firstName", u.FirstName)
	populate(objectMap, "lastName", u.LastName)
	populate(objectMap, "phoneNumber", u.PhoneNumber)
	populate(objectMap, "upn", u.Upn)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UserDetailsUpdate.
func (u *UserDetailsUpdate) 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 "emailAddress":
			err = unpopulate(val, "EmailAddress", &u.EmailAddress)
			delete(rawMsg, key)
		case "firstName":
			err = unpopulate(val, "FirstName", &u.FirstName)
			delete(rawMsg, key)
		case "lastName":
			err = unpopulate(val, "LastName", &u.LastName)
			delete(rawMsg, key)
		case "phoneNumber":
			err = unpopulate(val, "PhoneNumber", &u.PhoneNumber)
			delete(rawMsg, key)
		case "upn":
			err = unpopulate(val, "Upn", &u.Upn)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", u, 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 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
}
