// 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) Go Code Generator. DO NOT EDIT.

package armdevcenter

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

// MarshalJSON implements the json.Marshaller interface for type ActiveHoursConfiguration.
func (a ActiveHoursConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "autoStartEnableStatus", a.AutoStartEnableStatus)
	populate(objectMap, "daysOfWeekLimit", a.DaysOfWeekLimit)
	populate(objectMap, "defaultDaysOfWeek", a.DefaultDaysOfWeek)
	populate(objectMap, "defaultEndTimeHour", a.DefaultEndTimeHour)
	populate(objectMap, "defaultStartTimeHour", a.DefaultStartTimeHour)
	populate(objectMap, "defaultTimeZone", a.DefaultTimeZone)
	populate(objectMap, "keepAwakeEnableStatus", a.KeepAwakeEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveHoursConfiguration.
func (a *ActiveHoursConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "autoStartEnableStatus":
			err = unpopulate(val, "AutoStartEnableStatus", &a.AutoStartEnableStatus)
			delete(rawMsg, key)
		case "daysOfWeekLimit":
			err = unpopulate(val, "DaysOfWeekLimit", &a.DaysOfWeekLimit)
			delete(rawMsg, key)
		case "defaultDaysOfWeek":
			err = unpopulate(val, "DefaultDaysOfWeek", &a.DefaultDaysOfWeek)
			delete(rawMsg, key)
		case "defaultEndTimeHour":
			err = unpopulate(val, "DefaultEndTimeHour", &a.DefaultEndTimeHour)
			delete(rawMsg, key)
		case "defaultStartTimeHour":
			err = unpopulate(val, "DefaultStartTimeHour", &a.DefaultStartTimeHour)
			delete(rawMsg, key)
		case "defaultTimeZone":
			err = unpopulate(val, "DefaultTimeZone", &a.DefaultTimeZone)
			delete(rawMsg, key)
		case "keepAwakeEnableStatus":
			err = unpopulate(val, "KeepAwakeEnableStatus", &a.KeepAwakeEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AllowedEnvironmentType.
func (a AllowedEnvironmentType) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", a.ID)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "properties", a.Properties)
	populate(objectMap, "systemData", a.SystemData)
	populate(objectMap, "type", a.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentType.
func (a *AllowedEnvironmentType) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	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 "properties":
			err = unpopulate(val, "Properties", &a.Properties)
			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: %s", a, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentTypeListResult.
func (a *AllowedEnvironmentTypeListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &a.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &a.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AllowedEnvironmentTypeProperties.
func (a AllowedEnvironmentTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "displayName", a.DisplayName)
	populate(objectMap, "provisioningState", a.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentTypeProperties.
func (a *AllowedEnvironmentTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "displayName":
			err = unpopulate(val, "DisplayName", &a.DisplayName)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AssignedGroup.
func (a AssignedGroup) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "objectId", a.ObjectID)
	populate(objectMap, "scope", a.Scope)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AssignedGroup.
func (a *AssignedGroup) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "objectId":
			err = unpopulate(val, "ObjectID", &a.ObjectID)
			delete(rawMsg, key)
		case "scope":
			err = unpopulate(val, "Scope", &a.Scope)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AttachedNetworkConnection.
func (a AttachedNetworkConnection) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", a.ID)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "properties", a.Properties)
	populate(objectMap, "systemData", a.SystemData)
	populate(objectMap, "type", a.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkConnection.
func (a *AttachedNetworkConnection) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	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 "properties":
			err = unpopulate(val, "Properties", &a.Properties)
			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: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AttachedNetworkConnectionProperties.
func (a AttachedNetworkConnectionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "domainJoinType", a.DomainJoinType)
	populate(objectMap, "healthCheckStatus", a.HealthCheckStatus)
	populate(objectMap, "networkConnectionId", a.NetworkConnectionID)
	populate(objectMap, "networkConnectionLocation", a.NetworkConnectionLocation)
	populate(objectMap, "provisioningState", a.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkConnectionProperties.
func (a *AttachedNetworkConnectionProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "domainJoinType":
			err = unpopulate(val, "DomainJoinType", &a.DomainJoinType)
			delete(rawMsg, key)
		case "healthCheckStatus":
			err = unpopulate(val, "HealthCheckStatus", &a.HealthCheckStatus)
			delete(rawMsg, key)
		case "networkConnectionId":
			err = unpopulate(val, "NetworkConnectionID", &a.NetworkConnectionID)
			delete(rawMsg, key)
		case "networkConnectionLocation":
			err = unpopulate(val, "NetworkConnectionLocation", &a.NetworkConnectionLocation)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkListResult.
func (a *AttachedNetworkListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &a.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &a.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureAiServicesSettings.
func (a *AzureAiServicesSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "azureAiServicesMode":
			err = unpopulate(val, "AzureAiServicesMode", &a.AzureAiServicesMode)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", a, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Capability.
func (c Capability) 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 Capability.
func (c *Capability) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	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: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Catalog.
func (c Catalog) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", c.ID)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "properties", c.Properties)
	populate(objectMap, "systemData", c.SystemData)
	populate(objectMap, "type", c.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Catalog.
func (c *Catalog) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &c.ID)
			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 "systemData":
			err = unpopulate(val, "SystemData", &c.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogConflictError.
func (c CatalogConflictError) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "path", c.Path)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogConflictError.
func (c *CatalogConflictError) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &c.Path)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogErrorDetails.
func (c CatalogErrorDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "code", c.Code)
	populate(objectMap, "message", c.Message)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogErrorDetails.
func (c *CatalogErrorDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "code":
			err = unpopulate(val, "Code", &c.Code)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &c.Message)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogListResult.
func (c CatalogListResult) 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 CatalogListResult.
func (c *CatalogListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	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: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogProperties.
func (c CatalogProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "adoGit", c.AdoGit)
	populate(objectMap, "autoImageBuildEnableStatus", c.AutoImageBuildEnableStatus)
	populate(objectMap, "connectionState", c.ConnectionState)
	populate(objectMap, "gitHub", c.GitHub)
	populateTime[datetime.RFC3339](objectMap, "lastConnectionTime", c.LastConnectionTime)
	populate(objectMap, "lastSyncStats", c.LastSyncStats)
	populateTime[datetime.RFC3339](objectMap, "lastSyncTime", c.LastSyncTime)
	populate(objectMap, "provisioningState", c.ProvisioningState)
	populate(objectMap, "syncState", c.SyncState)
	populate(objectMap, "syncType", c.SyncType)
	populate(objectMap, "tags", c.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogProperties.
func (c *CatalogProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "adoGit":
			err = unpopulate(val, "AdoGit", &c.AdoGit)
			delete(rawMsg, key)
		case "autoImageBuildEnableStatus":
			err = unpopulate(val, "AutoImageBuildEnableStatus", &c.AutoImageBuildEnableStatus)
			delete(rawMsg, key)
		case "connectionState":
			err = unpopulate(val, "ConnectionState", &c.ConnectionState)
			delete(rawMsg, key)
		case "gitHub":
			err = unpopulate(val, "GitHub", &c.GitHub)
			delete(rawMsg, key)
		case "lastConnectionTime":
			err = unpopulateTime[datetime.RFC3339](val, "LastConnectionTime", &c.LastConnectionTime)
			delete(rawMsg, key)
		case "lastSyncStats":
			err = unpopulate(val, "LastSyncStats", &c.LastSyncStats)
			delete(rawMsg, key)
		case "lastSyncTime":
			err = unpopulateTime[datetime.RFC3339](val, "LastSyncTime", &c.LastSyncTime)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
			delete(rawMsg, key)
		case "syncState":
			err = unpopulate(val, "SyncState", &c.SyncState)
			delete(rawMsg, key)
		case "syncType":
			err = unpopulate(val, "SyncType", &c.SyncType)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &c.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogResourceValidationErrorDetails.
func (c CatalogResourceValidationErrorDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "errors", c.Errors)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogResourceValidationErrorDetails.
func (c *CatalogResourceValidationErrorDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "errors":
			err = unpopulate(val, "Errors", &c.Errors)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogSyncError.
func (c CatalogSyncError) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "errorDetails", c.ErrorDetails)
	populate(objectMap, "path", c.Path)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogSyncError.
func (c *CatalogSyncError) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "errorDetails":
			err = unpopulate(val, "ErrorDetails", &c.ErrorDetails)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &c.Path)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogUpdate.
func (c CatalogUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", c.Properties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogUpdate.
func (c *CatalogUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "properties":
			err = unpopulate(val, "Properties", &c.Properties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CatalogUpdateProperties.
func (c CatalogUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "adoGit", c.AdoGit)
	populate(objectMap, "autoImageBuildEnableStatus", c.AutoImageBuildEnableStatus)
	populate(objectMap, "gitHub", c.GitHub)
	populate(objectMap, "syncType", c.SyncType)
	populate(objectMap, "tags", c.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CatalogUpdateProperties.
func (c *CatalogUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "adoGit":
			err = unpopulate(val, "AdoGit", &c.AdoGit)
			delete(rawMsg, key)
		case "autoImageBuildEnableStatus":
			err = unpopulate(val, "AutoImageBuildEnableStatus", &c.AutoImageBuildEnableStatus)
			delete(rawMsg, key)
		case "gitHub":
			err = unpopulate(val, "GitHub", &c.GitHub)
			delete(rawMsg, key)
		case "syncType":
			err = unpopulate(val, "SyncType", &c.SyncType)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &c.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest.
func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "type", c.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest.
func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch 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: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse.
func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "message", c.Message)
	populate(objectMap, "nameAvailable", c.NameAvailable)
	populate(objectMap, "reason", c.Reason)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse.
func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "message":
			err = unpopulate(val, "Message", &c.Message)
			delete(rawMsg, key)
		case "nameAvailable":
			err = unpopulate(val, "NameAvailable", &c.NameAvailable)
			delete(rawMsg, key)
		case "reason":
			err = unpopulate(val, "Reason", &c.Reason)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CheckScopedNameAvailabilityRequest.
func (c CheckScopedNameAvailabilityRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "scope", c.Scope)
	populate(objectMap, "type", c.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CheckScopedNameAvailabilityRequest.
func (c *CheckScopedNameAvailabilityRequest) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "scope":
			err = unpopulate(val, "Scope", &c.Scope)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ConfigurationPolicies.
func (c ConfigurationPolicies) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "azureAiServicesFeatureStatus", c.AzureAiServicesFeatureStatus)
	populate(objectMap, "devBoxLimitsFeatureStatus", c.DevBoxLimitsFeatureStatus)
	populate(objectMap, "devBoxScheduleDeleteFeatureStatus", c.DevBoxScheduleDeleteFeatureStatus)
	populate(objectMap, "devBoxTunnelFeatureStatus", c.DevBoxTunnelFeatureStatus)
	populate(objectMap, "displayNameFeatureStatus", c.DisplayNameFeatureStatus)
	populate(objectMap, "projectCatalogFeatureStatus", c.ProjectCatalogFeatureStatus)
	populate(objectMap, "serverlessGpuSessionsFeatureStatus", c.ServerlessGpuSessionsFeatureStatus)
	populate(objectMap, "userCustomizationsFeatureStatus", c.UserCustomizationsFeatureStatus)
	populate(objectMap, "workspaceStorageFeatureStatus", c.WorkspaceStorageFeatureStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationPolicies.
func (c *ConfigurationPolicies) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "azureAiServicesFeatureStatus":
			err = unpopulate(val, "AzureAiServicesFeatureStatus", &c.AzureAiServicesFeatureStatus)
			delete(rawMsg, key)
		case "devBoxLimitsFeatureStatus":
			err = unpopulate(val, "DevBoxLimitsFeatureStatus", &c.DevBoxLimitsFeatureStatus)
			delete(rawMsg, key)
		case "devBoxScheduleDeleteFeatureStatus":
			err = unpopulate(val, "DevBoxScheduleDeleteFeatureStatus", &c.DevBoxScheduleDeleteFeatureStatus)
			delete(rawMsg, key)
		case "devBoxTunnelFeatureStatus":
			err = unpopulate(val, "DevBoxTunnelFeatureStatus", &c.DevBoxTunnelFeatureStatus)
			delete(rawMsg, key)
		case "displayNameFeatureStatus":
			err = unpopulate(val, "DisplayNameFeatureStatus", &c.DisplayNameFeatureStatus)
			delete(rawMsg, key)
		case "projectCatalogFeatureStatus":
			err = unpopulate(val, "ProjectCatalogFeatureStatus", &c.ProjectCatalogFeatureStatus)
			delete(rawMsg, key)
		case "serverlessGpuSessionsFeatureStatus":
			err = unpopulate(val, "ServerlessGpuSessionsFeatureStatus", &c.ServerlessGpuSessionsFeatureStatus)
			delete(rawMsg, key)
		case "userCustomizationsFeatureStatus":
			err = unpopulate(val, "UserCustomizationsFeatureStatus", &c.UserCustomizationsFeatureStatus)
			delete(rawMsg, key)
		case "workspaceStorageFeatureStatus":
			err = unpopulate(val, "WorkspaceStorageFeatureStatus", &c.WorkspaceStorageFeatureStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryption.
func (c CustomerManagedKeyEncryption) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "keyEncryptionKeyIdentity", c.KeyEncryptionKeyIdentity)
	populate(objectMap, "keyEncryptionKeyUrl", c.KeyEncryptionKeyURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryption.
func (c *CustomerManagedKeyEncryption) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "keyEncryptionKeyIdentity":
			err = unpopulate(val, "KeyEncryptionKeyIdentity", &c.KeyEncryptionKeyIdentity)
			delete(rawMsg, key)
		case "keyEncryptionKeyUrl":
			err = unpopulate(val, "KeyEncryptionKeyURL", &c.KeyEncryptionKeyURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryptionKeyIdentity.
func (c CustomerManagedKeyEncryptionKeyIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "delegatedIdentityClientId", c.DelegatedIdentityClientID)
	populate(objectMap, "federatedClientId", c.FederatedClientID)
	populate(objectMap, "identityType", c.IdentityType)
	populate(objectMap, "userAssignedIdentityResourceId", c.UserAssignedIdentityResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryptionKeyIdentity.
func (c *CustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "delegatedIdentityClientId":
			err = unpopulate(val, "DelegatedIdentityClientID", &c.DelegatedIdentityClientID)
			delete(rawMsg, key)
		case "federatedClientId":
			err = unpopulate(val, "FederatedClientID", &c.FederatedClientID)
			delete(rawMsg, key)
		case "identityType":
			err = unpopulate(val, "IdentityType", &c.IdentityType)
			delete(rawMsg, key)
		case "userAssignedIdentityResourceId":
			err = unpopulate(val, "UserAssignedIdentityResourceID", &c.UserAssignedIdentityResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomizationTask.
func (c CustomizationTask) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", c.ID)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "properties", c.Properties)
	populate(objectMap, "systemData", c.SystemData)
	populate(objectMap, "type", c.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizationTask.
func (c *CustomizationTask) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &c.ID)
			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 "systemData":
			err = unpopulate(val, "SystemData", &c.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomizationTaskInput.
func (c CustomizationTaskInput) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "required", c.Required)
	populate(objectMap, "type", c.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizationTaskInput.
func (c *CustomizationTaskInput) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "required":
			err = unpopulate(val, "Required", &c.Required)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomizationTaskInstance.
func (c CustomizationTaskInstance) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "condition", c.Condition)
	populate(objectMap, "displayName", c.DisplayName)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "timeoutInSeconds", c.TimeoutInSeconds)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizationTaskInstance.
func (c *CustomizationTaskInstance) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "condition":
			err = unpopulate(val, "Condition", &c.Condition)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &c.DisplayName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "timeoutInSeconds":
			err = unpopulate(val, "TimeoutInSeconds", &c.TimeoutInSeconds)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomizationTaskListResult.
func (c CustomizationTaskListResult) 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 CustomizationTaskListResult.
func (c *CustomizationTaskListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	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: %s", c, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomizationTaskProperties.
func (c CustomizationTaskProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "inputs", c.Inputs)
	populate(objectMap, "timeout", c.Timeout)
	populate(objectMap, "validationStatus", c.ValidationStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizationTaskProperties.
func (c *CustomizationTaskProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "inputs":
			err = unpopulate(val, "Inputs", &c.Inputs)
			delete(rawMsg, key)
		case "timeout":
			err = unpopulate(val, "Timeout", &c.Timeout)
			delete(rawMsg, key)
		case "validationStatus":
			err = unpopulate(val, "ValidationStatus", &c.ValidationStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", c, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultValue.
func (d *DefaultValue) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &d.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type DefinitionParametersItem.
func (d *DefinitionParametersItem) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &d.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxDefinition.
func (d DevBoxDefinition) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", d.ID)
	populate(objectMap, "location", d.Location)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "properties", d.Properties)
	populate(objectMap, "systemData", d.SystemData)
	populate(objectMap, "tags", d.Tags)
	populate(objectMap, "type", d.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinition.
func (d *DevBoxDefinition) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &d.ID)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &d.Location)
			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 "systemData":
			err = unpopulate(val, "SystemData", &d.SystemData)
			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: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionListResult.
func (d DevBoxDefinitionListResult) 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 DevBoxDefinitionListResult.
func (d *DevBoxDefinitionListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	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: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionProperties.
func (d DevBoxDefinitionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "activeImageReference", d.ActiveImageReference)
	populate(objectMap, "hibernateSupport", d.HibernateSupport)
	populate(objectMap, "imageReference", d.ImageReference)
	populate(objectMap, "imageValidationErrorDetails", d.ImageValidationErrorDetails)
	populate(objectMap, "imageValidationStatus", d.ImageValidationStatus)
	populate(objectMap, "osStorageType", d.OSStorageType)
	populate(objectMap, "provisioningState", d.ProvisioningState)
	populate(objectMap, "sku", d.SKU)
	populate(objectMap, "validationStatus", d.ValidationStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionProperties.
func (d *DevBoxDefinitionProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activeImageReference":
			err = unpopulate(val, "ActiveImageReference", &d.ActiveImageReference)
			delete(rawMsg, key)
		case "hibernateSupport":
			err = unpopulate(val, "HibernateSupport", &d.HibernateSupport)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &d.ImageReference)
			delete(rawMsg, key)
		case "imageValidationErrorDetails":
			err = unpopulate(val, "ImageValidationErrorDetails", &d.ImageValidationErrorDetails)
			delete(rawMsg, key)
		case "imageValidationStatus":
			err = unpopulate(val, "ImageValidationStatus", &d.ImageValidationStatus)
			delete(rawMsg, key)
		case "osStorageType":
			err = unpopulate(val, "OSStorageType", &d.OSStorageType)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
			delete(rawMsg, key)
		case "sku":
			err = unpopulate(val, "SKU", &d.SKU)
			delete(rawMsg, key)
		case "validationStatus":
			err = unpopulate(val, "ValidationStatus", &d.ValidationStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionUpdate.
func (d DevBoxDefinitionUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "location", d.Location)
	populate(objectMap, "properties", d.Properties)
	populate(objectMap, "tags", d.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionUpdate.
func (d *DevBoxDefinitionUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "location":
			err = unpopulate(val, "Location", &d.Location)
			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)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionUpdateProperties.
func (d DevBoxDefinitionUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "hibernateSupport", d.HibernateSupport)
	populate(objectMap, "imageReference", d.ImageReference)
	populate(objectMap, "osStorageType", d.OSStorageType)
	populate(objectMap, "sku", d.SKU)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionUpdateProperties.
func (d *DevBoxDefinitionUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "hibernateSupport":
			err = unpopulate(val, "HibernateSupport", &d.HibernateSupport)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &d.ImageReference)
			delete(rawMsg, key)
		case "osStorageType":
			err = unpopulate(val, "OSStorageType", &d.OSStorageType)
			delete(rawMsg, key)
		case "sku":
			err = unpopulate(val, "SKU", &d.SKU)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxProvisioningSettings.
func (d DevBoxProvisioningSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "installAzureMonitorAgentEnableStatus", d.InstallAzureMonitorAgentEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxProvisioningSettings.
func (d *DevBoxProvisioningSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "installAzureMonitorAgentEnableStatus":
			err = unpopulate(val, "InstallAzureMonitorAgentEnableStatus", &d.InstallAzureMonitorAgentEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevBoxScheduleDeleteSettings.
func (d DevBoxScheduleDeleteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "cancelOnConnectEnableStatus", d.CancelOnConnectEnableStatus)
	populate(objectMap, "deleteMode", d.DeleteMode)
	populate(objectMap, "gracePeriod", d.GracePeriod)
	populate(objectMap, "inactiveThreshold", d.InactiveThreshold)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxScheduleDeleteSettings.
func (d *DevBoxScheduleDeleteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "cancelOnConnectEnableStatus":
			err = unpopulate(val, "CancelOnConnectEnableStatus", &d.CancelOnConnectEnableStatus)
			delete(rawMsg, key)
		case "deleteMode":
			err = unpopulate(val, "DeleteMode", &d.DeleteMode)
			delete(rawMsg, key)
		case "gracePeriod":
			err = unpopulate(val, "GracePeriod", &d.GracePeriod)
			delete(rawMsg, key)
		case "inactiveThreshold":
			err = unpopulate(val, "InactiveThreshold", &d.InactiveThreshold)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DevCenter.
func (d DevCenter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", d.ID)
	populate(objectMap, "identity", d.Identity)
	populate(objectMap, "location", d.Location)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "properties", d.Properties)
	populate(objectMap, "systemData", d.SystemData)
	populate(objectMap, "tags", d.Tags)
	populate(objectMap, "type", d.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DevCenter.
func (d *DevCenter) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", d, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &d.ID)
			delete(rawMsg, key)
		case "identity":
			err = unpopulate(val, "Identity", &d.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &d.Location)
			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 "systemData":
			err = unpopulate(val, "SystemData", &d.SystemData)
			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: %s", d, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Encryption.
func (e Encryption) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "customerManagedKeyEncryption", e.CustomerManagedKeyEncryption)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption.
func (e *Encryption) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "customerManagedKeyEncryption":
			err = unpopulate(val, "CustomerManagedKeyEncryption", &e.CustomerManagedKeyEncryption)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EncryptionSet.
func (e EncryptionSet) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", e.ID)
	populate(objectMap, "identity", e.Identity)
	populate(objectMap, "location", e.Location)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "properties", e.Properties)
	populate(objectMap, "systemData", e.SystemData)
	populate(objectMap, "tags", e.Tags)
	populate(objectMap, "type", e.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSet.
func (e *EncryptionSet) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &e.ID)
			delete(rawMsg, key)
		case "identity":
			err = unpopulate(val, "Identity", &e.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &e.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &e.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &e.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &e.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetListResult.
func (e *EncryptionSetListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &e.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &e.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EncryptionSetProperties.
func (e EncryptionSetProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "devboxDisksEncryptionEnableStatus", e.DevboxDisksEncryptionEnableStatus)
	populate(objectMap, "keyEncryptionKeyIdentity", e.KeyEncryptionKeyIdentity)
	populate(objectMap, "keyEncryptionKeyUrl", e.KeyEncryptionKeyURL)
	populate(objectMap, "provisioningState", e.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetProperties.
func (e *EncryptionSetProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "devboxDisksEncryptionEnableStatus":
			err = unpopulate(val, "DevboxDisksEncryptionEnableStatus", &e.DevboxDisksEncryptionEnableStatus)
			delete(rawMsg, key)
		case "keyEncryptionKeyIdentity":
			err = unpopulate(val, "KeyEncryptionKeyIdentity", &e.KeyEncryptionKeyIdentity)
			delete(rawMsg, key)
		case "keyEncryptionKeyUrl":
			err = unpopulate(val, "KeyEncryptionKeyURL", &e.KeyEncryptionKeyURL)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &e.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EncryptionSetUpdate.
func (e EncryptionSetUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identity", e.Identity)
	populate(objectMap, "location", e.Location)
	populate(objectMap, "properties", e.Properties)
	populate(objectMap, "tags", e.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetUpdate.
func (e *EncryptionSetUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identity":
			err = unpopulate(val, "Identity", &e.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &e.Location)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &e.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &e.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EncryptionSetUpdateProperties.
func (e EncryptionSetUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "devboxDisksEncryptionEnableStatus", e.DevboxDisksEncryptionEnableStatus)
	populate(objectMap, "keyEncryptionKeyIdentity", e.KeyEncryptionKeyIdentity)
	populate(objectMap, "keyEncryptionKeyUrl", e.KeyEncryptionKeyURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSetUpdateProperties.
func (e *EncryptionSetUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "devboxDisksEncryptionEnableStatus":
			err = unpopulate(val, "DevboxDisksEncryptionEnableStatus", &e.DevboxDisksEncryptionEnableStatus)
			delete(rawMsg, key)
		case "keyEncryptionKeyIdentity":
			err = unpopulate(val, "KeyEncryptionKeyIdentity", &e.KeyEncryptionKeyIdentity)
			delete(rawMsg, key)
		case "keyEncryptionKeyUrl":
			err = unpopulate(val, "KeyEncryptionKeyURL", &e.KeyEncryptionKeyURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EndpointDependency.
func (e EndpointDependency) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "domainName", e.DomainName)
	populate(objectMap, "endpointDetails", e.EndpointDetails)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency.
func (e *EndpointDependency) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "domainName":
			err = unpopulate(val, "DomainName", &e.DomainName)
			delete(rawMsg, key)
		case "endpointDetails":
			err = unpopulate(val, "EndpointDetails", &e.EndpointDetails)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EndpointDetail.
func (e EndpointDetail) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "port", e.Port)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail.
func (e *EndpointDetail) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "port":
			err = unpopulate(val, "Port", &e.Port)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinition.
func (e EnvironmentDefinition) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", e.ID)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "properties", e.Properties)
	populate(objectMap, "systemData", e.SystemData)
	populate(objectMap, "type", e.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinition.
func (e *EnvironmentDefinition) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &e.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &e.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &e.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionListResult.
func (e *EnvironmentDefinitionListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &e.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &e.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinitionParameter.
func (e EnvironmentDefinitionParameter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "id", e.ID)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "readOnly", e.ReadOnly)
	populate(objectMap, "required", e.Required)
	populate(objectMap, "type", e.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionParameter.
func (e *EnvironmentDefinitionParameter) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &e.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "readOnly":
			err = unpopulate(val, "ReadOnly", &e.ReadOnly)
			delete(rawMsg, key)
		case "required":
			err = unpopulate(val, "Required", &e.Required)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinitionProperties.
func (e EnvironmentDefinitionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "parameters", e.Parameters)
	populate(objectMap, "templatePath", e.TemplatePath)
	populate(objectMap, "validationStatus", e.ValidationStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionProperties.
func (e *EnvironmentDefinitionProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &e.Parameters)
			delete(rawMsg, key)
		case "templatePath":
			err = unpopulate(val, "TemplatePath", &e.TemplatePath)
			delete(rawMsg, key)
		case "validationStatus":
			err = unpopulate(val, "ValidationStatus", &e.ValidationStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentRole.
func (e EnvironmentRole) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "roleName", e.RoleName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentRole.
func (e *EnvironmentRole) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "roleName":
			err = unpopulate(val, "RoleName", &e.RoleName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentType.
func (e EnvironmentType) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", e.ID)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "properties", e.Properties)
	populate(objectMap, "systemData", e.SystemData)
	populate(objectMap, "tags", e.Tags)
	populate(objectMap, "type", e.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentType.
func (e *EnvironmentType) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &e.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &e.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &e.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &e.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeListResult.
func (e *EnvironmentTypeListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &e.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &e.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeProperties.
func (e EnvironmentTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "displayName", e.DisplayName)
	populate(objectMap, "provisioningState", e.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeProperties.
func (e *EnvironmentTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "displayName":
			err = unpopulate(val, "DisplayName", &e.DisplayName)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &e.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeUpdate.
func (e EnvironmentTypeUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", e.Properties)
	populate(objectMap, "tags", e.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeUpdate.
func (e *EnvironmentTypeUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "properties":
			err = unpopulate(val, "Properties", &e.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &e.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeUpdateProperties.
func (e EnvironmentTypeUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "displayName", e.DisplayName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeUpdateProperties.
func (e *EnvironmentTypeUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "displayName":
			err = unpopulate(val, "DisplayName", &e.DisplayName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", e, err.Error())
		}
	}
	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: %s", e, err.Error())
	}
	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: %s", e, err.Error())
		}
	}
	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: %s", e, err.Error())
	}
	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: %s", e, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FeatureState.
func (f FeatureState) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "defaultStatus", f.DefaultStatus)
	populate(objectMap, "defaultValues", f.DefaultValues)
	populate(objectMap, "statusModifiable", f.StatusModifiable)
	populate(objectMap, "valuesModifiable", f.ValuesModifiable)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureState.
func (f *FeatureState) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", f, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "defaultStatus":
			err = unpopulate(val, "DefaultStatus", &f.DefaultStatus)
			delete(rawMsg, key)
		case "defaultValues":
			err = unpopulate(val, "DefaultValues", &f.DefaultValues)
			delete(rawMsg, key)
		case "statusModifiable":
			err = unpopulate(val, "StatusModifiable", &f.StatusModifiable)
			delete(rawMsg, key)
		case "valuesModifiable":
			err = unpopulate(val, "ValuesModifiable", &f.ValuesModifiable)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", f, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Gallery.
func (g Gallery) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", g.ID)
	populate(objectMap, "name", g.Name)
	populate(objectMap, "properties", g.Properties)
	populate(objectMap, "systemData", g.SystemData)
	populate(objectMap, "type", g.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Gallery.
func (g *Gallery) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &g.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &g.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &g.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &g.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryListResult.
func (g *GalleryListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &g.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &g.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GalleryProperties.
func (g GalleryProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "galleryResourceId", g.GalleryResourceID)
	populate(objectMap, "provisioningState", g.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties.
func (g *GalleryProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "galleryResourceId":
			err = unpopulate(val, "GalleryResourceID", &g.GalleryResourceID)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &g.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GitCatalog.
func (g GitCatalog) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "branch", g.Branch)
	populate(objectMap, "path", g.Path)
	populate(objectMap, "secretIdentifier", g.SecretIdentifier)
	populate(objectMap, "uri", g.URI)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GitCatalog.
func (g *GitCatalog) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "branch":
			err = unpopulate(val, "Branch", &g.Branch)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &g.Path)
			delete(rawMsg, key)
		case "secretIdentifier":
			err = unpopulate(val, "SecretIdentifier", &g.SecretIdentifier)
			delete(rawMsg, key)
		case "uri":
			err = unpopulate(val, "URI", &g.URI)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", g, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HealthCheck.
func (h HealthCheck) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "additionalDetails", h.AdditionalDetails)
	populate(objectMap, "displayName", h.DisplayName)
	populateTime[datetime.RFC3339](objectMap, "endDateTime", h.EndDateTime)
	populate(objectMap, "errorType", h.ErrorType)
	populate(objectMap, "recommendedAction", h.RecommendedAction)
	populateTime[datetime.RFC3339](objectMap, "startDateTime", h.StartDateTime)
	populate(objectMap, "status", h.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheck.
func (h *HealthCheck) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalDetails":
			err = unpopulate(val, "AdditionalDetails", &h.AdditionalDetails)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &h.DisplayName)
			delete(rawMsg, key)
		case "endDateTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndDateTime", &h.EndDateTime)
			delete(rawMsg, key)
		case "errorType":
			err = unpopulate(val, "ErrorType", &h.ErrorType)
			delete(rawMsg, key)
		case "recommendedAction":
			err = unpopulate(val, "RecommendedAction", &h.RecommendedAction)
			delete(rawMsg, key)
		case "startDateTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartDateTime", &h.StartDateTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &h.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HealthCheckStatusDetails.
func (h HealthCheckStatusDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", h.ID)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "properties", h.Properties)
	populate(objectMap, "systemData", h.SystemData)
	populate(objectMap, "type", h.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetails.
func (h *HealthCheckStatusDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &h.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &h.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &h.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetailsListResult.
func (h *HealthCheckStatusDetailsListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &h.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &h.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HealthCheckStatusDetailsProperties.
func (h HealthCheckStatusDetailsProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endDateTime", h.EndDateTime)
	populate(objectMap, "healthChecks", h.HealthChecks)
	populateTime[datetime.RFC3339](objectMap, "startDateTime", h.StartDateTime)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetailsProperties.
func (h *HealthCheckStatusDetailsProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endDateTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndDateTime", &h.EndDateTime)
			delete(rawMsg, key)
		case "healthChecks":
			err = unpopulate(val, "HealthChecks", &h.HealthChecks)
			delete(rawMsg, key)
		case "startDateTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartDateTime", &h.StartDateTime)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HealthStatusDetail.
func (h HealthStatusDetail) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "code", h.Code)
	populate(objectMap, "message", h.Message)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HealthStatusDetail.
func (h *HealthStatusDetail) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "code":
			err = unpopulate(val, "Code", &h.Code)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &h.Message)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", h, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Image.
func (i Image) 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 Image.
func (i *Image) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageCreationErrorDetails.
func (i ImageCreationErrorDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "code", i.Code)
	populate(objectMap, "message", i.Message)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageCreationErrorDetails.
func (i *ImageCreationErrorDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "code":
			err = unpopulate(val, "Code", &i.Code)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &i.Message)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinition.
func (i ImageDefinition) 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 ImageDefinition.
func (i *ImageDefinition) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuild.
func (i ImageDefinitionBuild) 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 ImageDefinitionBuild.
func (i *ImageDefinitionBuild) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuildDetails.
func (i ImageDefinitionBuildDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", i.EndTime)
	populate(objectMap, "errorDetails", i.ErrorDetails)
	populate(objectMap, "id", i.ID)
	populate(objectMap, "imageReference", i.ImageReference)
	populate(objectMap, "name", i.Name)
	populateTime[datetime.RFC3339](objectMap, "startTime", i.StartTime)
	populate(objectMap, "status", i.Status)
	populate(objectMap, "systemData", i.SystemData)
	populate(objectMap, "taskGroups", i.TaskGroups)
	populate(objectMap, "type", i.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionBuildDetails.
func (i *ImageDefinitionBuildDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndTime", &i.EndTime)
			delete(rawMsg, key)
		case "errorDetails":
			err = unpopulate(val, "ErrorDetails", &i.ErrorDetails)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &i.ImageReference)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartTime", &i.StartTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &i.Status)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &i.SystemData)
			delete(rawMsg, key)
		case "taskGroups":
			err = unpopulate(val, "TaskGroups", &i.TaskGroups)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuildListResult.
func (i ImageDefinitionBuildListResult) 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 ImageDefinitionBuildListResult.
func (i *ImageDefinitionBuildListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuildProperties.
func (i ImageDefinitionBuildProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", i.EndTime)
	populate(objectMap, "errorDetails", i.ErrorDetails)
	populate(objectMap, "imageReference", i.ImageReference)
	populateTime[datetime.RFC3339](objectMap, "startTime", i.StartTime)
	populate(objectMap, "status", i.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionBuildProperties.
func (i *ImageDefinitionBuildProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndTime", &i.EndTime)
			delete(rawMsg, key)
		case "errorDetails":
			err = unpopulate(val, "ErrorDetails", &i.ErrorDetails)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &i.ImageReference)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartTime", &i.StartTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &i.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuildTask.
func (i ImageDefinitionBuildTask) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "displayName", i.DisplayName)
	populateTime[datetime.RFC3339](objectMap, "endTime", i.EndTime)
	populate(objectMap, "id", i.ID)
	populate(objectMap, "logUri", i.LogURI)
	populate(objectMap, "name", i.Name)
	populate(objectMap, "parameters", i.Parameters)
	populateTime[datetime.RFC3339](objectMap, "startTime", i.StartTime)
	populate(objectMap, "status", i.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionBuildTask.
func (i *ImageDefinitionBuildTask) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "displayName":
			err = unpopulate(val, "DisplayName", &i.DisplayName)
			delete(rawMsg, key)
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndTime", &i.EndTime)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		case "logUri":
			err = unpopulate(val, "LogURI", &i.LogURI)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartTime", &i.StartTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &i.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionBuildTaskGroup.
func (i ImageDefinitionBuildTaskGroup) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", i.EndTime)
	populate(objectMap, "name", i.Name)
	populateTime[datetime.RFC3339](objectMap, "startTime", i.StartTime)
	populate(objectMap, "status", i.Status)
	populate(objectMap, "tasks", i.Tasks)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionBuildTaskGroup.
func (i *ImageDefinitionBuildTaskGroup) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndTime", &i.EndTime)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartTime", &i.StartTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &i.Status)
			delete(rawMsg, key)
		case "tasks":
			err = unpopulate(val, "Tasks", &i.Tasks)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionBuildTaskParametersItem.
func (i *ImageDefinitionBuildTaskParametersItem) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "key":
			err = unpopulate(val, "Key", &i.Key)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &i.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionListResult.
func (i ImageDefinitionListResult) 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 ImageDefinitionListResult.
func (i *ImageDefinitionListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionProperties.
func (i ImageDefinitionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "activeImageReference", i.ActiveImageReference)
	populate(objectMap, "autoImageBuild", i.AutoImageBuild)
	populate(objectMap, "extends", i.Extends)
	populate(objectMap, "fileUrl", i.FileURL)
	populate(objectMap, "imageReference", i.ImageReference)
	populate(objectMap, "imageValidationErrorDetails", i.ImageValidationErrorDetails)
	populate(objectMap, "imageValidationStatus", i.ImageValidationStatus)
	populate(objectMap, "latestBuild", i.LatestBuild)
	populate(objectMap, "tasks", i.Tasks)
	populate(objectMap, "userTasks", i.UserTasks)
	populate(objectMap, "validationStatus", i.ValidationStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionProperties.
func (i *ImageDefinitionProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activeImageReference":
			err = unpopulate(val, "ActiveImageReference", &i.ActiveImageReference)
			delete(rawMsg, key)
		case "autoImageBuild":
			err = unpopulate(val, "AutoImageBuild", &i.AutoImageBuild)
			delete(rawMsg, key)
		case "extends":
			err = unpopulate(val, "Extends", &i.Extends)
			delete(rawMsg, key)
		case "fileUrl":
			err = unpopulate(val, "FileURL", &i.FileURL)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &i.ImageReference)
			delete(rawMsg, key)
		case "imageValidationErrorDetails":
			err = unpopulate(val, "ImageValidationErrorDetails", &i.ImageValidationErrorDetails)
			delete(rawMsg, key)
		case "imageValidationStatus":
			err = unpopulate(val, "ImageValidationStatus", &i.ImageValidationStatus)
			delete(rawMsg, key)
		case "latestBuild":
			err = unpopulate(val, "LatestBuild", &i.LatestBuild)
			delete(rawMsg, key)
		case "tasks":
			err = unpopulate(val, "Tasks", &i.Tasks)
			delete(rawMsg, key)
		case "userTasks":
			err = unpopulate(val, "UserTasks", &i.UserTasks)
			delete(rawMsg, key)
		case "validationStatus":
			err = unpopulate(val, "ValidationStatus", &i.ValidationStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageDefinitionReference.
func (i ImageDefinitionReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "imageDefinition", i.ImageDefinition)
	populate(objectMap, "parameters", i.Parameters)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDefinitionReference.
func (i *ImageDefinitionReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "imageDefinition":
			err = unpopulate(val, "ImageDefinition", &i.ImageDefinition)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageListResult.
func (i ImageListResult) 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 ImageListResult.
func (i *ImageListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageProperties.
func (i ImageProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "architecture", i.Architecture)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "hibernateSupport", i.HibernateSupport)
	populate(objectMap, "offer", i.Offer)
	populate(objectMap, "provisioningState", i.ProvisioningState)
	populate(objectMap, "publisher", i.Publisher)
	populate(objectMap, "recommendedMachineConfiguration", i.RecommendedMachineConfiguration)
	populate(objectMap, "sku", i.SKU)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties.
func (i *ImageProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "architecture":
			err = unpopulate(val, "Architecture", &i.Architecture)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "hibernateSupport":
			err = unpopulate(val, "HibernateSupport", &i.HibernateSupport)
			delete(rawMsg, key)
		case "offer":
			err = unpopulate(val, "Offer", &i.Offer)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &i.ProvisioningState)
			delete(rawMsg, key)
		case "publisher":
			err = unpopulate(val, "Publisher", &i.Publisher)
			delete(rawMsg, key)
		case "recommendedMachineConfiguration":
			err = unpopulate(val, "RecommendedMachineConfiguration", &i.RecommendedMachineConfiguration)
			delete(rawMsg, key)
		case "sku":
			err = unpopulate(val, "SKU", &i.SKU)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageReference.
func (i ImageReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "exactVersion", i.ExactVersion)
	populate(objectMap, "id", i.ID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference.
func (i *ImageReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "exactVersion":
			err = unpopulate(val, "ExactVersion", &i.ExactVersion)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &i.ID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageValidationErrorDetails.
func (i ImageValidationErrorDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "code", i.Code)
	populate(objectMap, "message", i.Message)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageValidationErrorDetails.
func (i *ImageValidationErrorDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "code":
			err = unpopulate(val, "Code", &i.Code)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &i.Message)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageVersion.
func (i ImageVersion) 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 ImageVersion.
func (i *ImageVersion) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageVersionListResult.
func (i ImageVersionListResult) 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 ImageVersionListResult.
func (i *ImageVersionListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	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: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImageVersionProperties.
func (i ImageVersionProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "excludeFromLatest", i.ExcludeFromLatest)
	populate(objectMap, "name", i.Name)
	populate(objectMap, "osDiskImageSizeInGb", i.OSDiskImageSizeInGb)
	populate(objectMap, "provisioningState", i.ProvisioningState)
	populateTime[datetime.RFC3339](objectMap, "publishedDate", i.PublishedDate)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionProperties.
func (i *ImageVersionProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "excludeFromLatest":
			err = unpopulate(val, "ExcludeFromLatest", &i.ExcludeFromLatest)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "osDiskImageSizeInGb":
			err = unpopulate(val, "OSDiskImageSizeInGb", &i.OSDiskImageSizeInGb)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &i.ProvisioningState)
			delete(rawMsg, key)
		case "publishedDate":
			err = unpopulateTime[datetime.RFC3339](val, "PublishedDate", &i.PublishedDate)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InheritedProjectCatalogSettings.
func (i InheritedProjectCatalogSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "catalogItemSyncEnableStatus", i.CatalogItemSyncEnableStatus)
	populate(objectMap, "defaultStatus", i.DefaultStatus)
	populate(objectMap, "defaultValues", i.DefaultValues)
	populate(objectMap, "statusModifiable", i.StatusModifiable)
	populate(objectMap, "valuesModifiable", i.ValuesModifiable)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InheritedProjectCatalogSettings.
func (i *InheritedProjectCatalogSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "catalogItemSyncEnableStatus":
			err = unpopulate(val, "CatalogItemSyncEnableStatus", &i.CatalogItemSyncEnableStatus)
			delete(rawMsg, key)
		case "defaultStatus":
			err = unpopulate(val, "DefaultStatus", &i.DefaultStatus)
			delete(rawMsg, key)
		case "defaultValues":
			err = unpopulate(val, "DefaultValues", &i.DefaultValues)
			delete(rawMsg, key)
		case "statusModifiable":
			err = unpopulate(val, "StatusModifiable", &i.StatusModifiable)
			delete(rawMsg, key)
		case "valuesModifiable":
			err = unpopulate(val, "ValuesModifiable", &i.ValuesModifiable)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InheritedSettingsForProject.
func (i InheritedSettingsForProject) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "azureAiServicesSettings", i.AzureAiServicesSettings)
	populate(objectMap, "devBoxLimitsSettings", i.DevBoxLimitsSettings)
	populate(objectMap, "devBoxScheduleDeleteSettings", i.DevBoxScheduleDeleteSettings)
	populate(objectMap, "devBoxTunnelSettings", i.DevBoxTunnelSettings)
	populate(objectMap, "displayNameSettings", i.DisplayNameSettings)
	populate(objectMap, "networkSettings", i.NetworkSettings)
	populate(objectMap, "projectCatalogSettings", i.ProjectCatalogSettings)
	populate(objectMap, "serverlessGpuSessionsSettings", i.ServerlessGpuSessionsSettings)
	populate(objectMap, "userCustomizationsSettings", i.UserCustomizationsSettings)
	populate(objectMap, "workspaceStorageSettings", i.WorkspaceStorageSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InheritedSettingsForProject.
func (i *InheritedSettingsForProject) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "azureAiServicesSettings":
			err = unpopulate(val, "AzureAiServicesSettings", &i.AzureAiServicesSettings)
			delete(rawMsg, key)
		case "devBoxLimitsSettings":
			err = unpopulate(val, "DevBoxLimitsSettings", &i.DevBoxLimitsSettings)
			delete(rawMsg, key)
		case "devBoxScheduleDeleteSettings":
			err = unpopulate(val, "DevBoxScheduleDeleteSettings", &i.DevBoxScheduleDeleteSettings)
			delete(rawMsg, key)
		case "devBoxTunnelSettings":
			err = unpopulate(val, "DevBoxTunnelSettings", &i.DevBoxTunnelSettings)
			delete(rawMsg, key)
		case "displayNameSettings":
			err = unpopulate(val, "DisplayNameSettings", &i.DisplayNameSettings)
			delete(rawMsg, key)
		case "networkSettings":
			err = unpopulate(val, "NetworkSettings", &i.NetworkSettings)
			delete(rawMsg, key)
		case "projectCatalogSettings":
			err = unpopulate(val, "ProjectCatalogSettings", &i.ProjectCatalogSettings)
			delete(rawMsg, key)
		case "serverlessGpuSessionsSettings":
			err = unpopulate(val, "ServerlessGpuSessionsSettings", &i.ServerlessGpuSessionsSettings)
			delete(rawMsg, key)
		case "userCustomizationsSettings":
			err = unpopulate(val, "UserCustomizationsSettings", &i.UserCustomizationsSettings)
			delete(rawMsg, key)
		case "workspaceStorageSettings":
			err = unpopulate(val, "WorkspaceStorageSettings", &i.WorkspaceStorageSettings)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", i, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type KeyEncryptionKeyIdentity.
func (k KeyEncryptionKeyIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "type", k.Type)
	populate(objectMap, "userAssignedIdentityResourceId", k.UserAssignedIdentityResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type KeyEncryptionKeyIdentity.
func (k *KeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", k, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "type":
			err = unpopulate(val, "Type", &k.Type)
			delete(rawMsg, key)
		case "userAssignedIdentityResourceId":
			err = unpopulate(val, "UserAssignedIdentityResourceID", &k.UserAssignedIdentityResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", k, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LatestImageBuild.
func (l LatestImageBuild) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", l.EndTime)
	populate(objectMap, "name", l.Name)
	populateTime[datetime.RFC3339](objectMap, "startTime", l.StartTime)
	populate(objectMap, "status", l.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LatestImageBuild.
func (l *LatestImageBuild) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", l, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](val, "EndTime", &l.EndTime)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &l.Name)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](val, "StartTime", &l.StartTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &l.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", l, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ListResult.
func (l ListResult) 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 ListResult.
func (l *ListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", l, err.Error())
	}
	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: %s", l, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult.
func (l ListUsagesResult) 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 ListUsagesResult.
func (l *ListUsagesResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", l, err.Error())
	}
	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: %s", l, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.
func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "principalId", m.PrincipalID)
	populate(objectMap, "tenantId", m.TenantID)
	populate(objectMap, "type", m.Type)
	populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.
func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", m, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "principalId":
			err = unpopulate(val, "PrincipalID", &m.PrincipalID)
			delete(rawMsg, key)
		case "tenantId":
			err = unpopulate(val, "TenantID", &m.TenantID)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "userAssignedIdentities":
			err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", m, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkConnection.
func (n NetworkConnection) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", n.ID)
	populate(objectMap, "location", n.Location)
	populate(objectMap, "name", n.Name)
	populate(objectMap, "properties", n.Properties)
	populate(objectMap, "systemData", n.SystemData)
	populate(objectMap, "tags", n.Tags)
	populate(objectMap, "type", n.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnection.
func (n *NetworkConnection) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &n.ID)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &n.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &n.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &n.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &n.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &n.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &n.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionListResult.
func (n *NetworkConnectionListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &n.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &n.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkConnectionUpdate.
func (n NetworkConnectionUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "location", n.Location)
	populate(objectMap, "properties", n.Properties)
	populate(objectMap, "tags", n.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionUpdate.
func (n *NetworkConnectionUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "location":
			err = unpopulate(val, "Location", &n.Location)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &n.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &n.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkConnectionUpdateProperties.
func (n NetworkConnectionUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "domainName", n.DomainName)
	populate(objectMap, "domainPassword", n.DomainPassword)
	populate(objectMap, "domainUsername", n.DomainUsername)
	populate(objectMap, "organizationUnit", n.OrganizationUnit)
	populate(objectMap, "subnetId", n.SubnetID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionUpdateProperties.
func (n *NetworkConnectionUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "domainName":
			err = unpopulate(val, "DomainName", &n.DomainName)
			delete(rawMsg, key)
		case "domainPassword":
			err = unpopulate(val, "DomainPassword", &n.DomainPassword)
			delete(rawMsg, key)
		case "domainUsername":
			err = unpopulate(val, "DomainUsername", &n.DomainUsername)
			delete(rawMsg, key)
		case "organizationUnit":
			err = unpopulate(val, "OrganizationUnit", &n.OrganizationUnit)
			delete(rawMsg, key)
		case "subnetId":
			err = unpopulate(val, "SubnetID", &n.SubnetID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkProperties.
func (n NetworkProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "domainJoinType", n.DomainJoinType)
	populate(objectMap, "domainName", n.DomainName)
	populate(objectMap, "domainPassword", n.DomainPassword)
	populate(objectMap, "domainUsername", n.DomainUsername)
	populate(objectMap, "healthCheckStatus", n.HealthCheckStatus)
	populate(objectMap, "networkingResourceGroupName", n.NetworkingResourceGroupName)
	populate(objectMap, "organizationUnit", n.OrganizationUnit)
	populate(objectMap, "provisioningState", n.ProvisioningState)
	populate(objectMap, "subnetId", n.SubnetID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProperties.
func (n *NetworkProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "domainJoinType":
			err = unpopulate(val, "DomainJoinType", &n.DomainJoinType)
			delete(rawMsg, key)
		case "domainName":
			err = unpopulate(val, "DomainName", &n.DomainName)
			delete(rawMsg, key)
		case "domainPassword":
			err = unpopulate(val, "DomainPassword", &n.DomainPassword)
			delete(rawMsg, key)
		case "domainUsername":
			err = unpopulate(val, "DomainUsername", &n.DomainUsername)
			delete(rawMsg, key)
		case "healthCheckStatus":
			err = unpopulate(val, "HealthCheckStatus", &n.HealthCheckStatus)
			delete(rawMsg, key)
		case "networkingResourceGroupName":
			err = unpopulate(val, "NetworkingResourceGroupName", &n.NetworkingResourceGroupName)
			delete(rawMsg, key)
		case "organizationUnit":
			err = unpopulate(val, "OrganizationUnit", &n.OrganizationUnit)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &n.ProvisioningState)
			delete(rawMsg, key)
		case "subnetId":
			err = unpopulate(val, "SubnetID", &n.SubnetID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetworkSettings.
func (n NetworkSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "microsoftHostedNetworkEnableStatus", n.MicrosoftHostedNetworkEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSettings.
func (n *NetworkSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "microsoftHostedNetworkEnableStatus":
			err = unpopulate(val, "MicrosoftHostedNetworkEnableStatus", &n.MicrosoftHostedNetworkEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", n, err.Error())
		}
	}
	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: %s", o, err.Error())
	}
	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: %s", o, err.Error())
		}
	}
	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: %s", o, err.Error())
	}
	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: %s", o, err.Error())
		}
	}
	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: %s", o, err.Error())
	}
	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: %s", o, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OperationStatus.
func (o OperationStatus) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", o.EndTime)
	populate(objectMap, "error", o.Error)
	populate(objectMap, "id", o.ID)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "operations", o.Operations)
	populate(objectMap, "percentComplete", o.PercentComplete)
	populate(objectMap, "properties", o.Properties)
	populate(objectMap, "resourceId", o.ResourceID)
	populateTime[datetime.RFC3339](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: %s", o, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](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 "operations":
			err = unpopulate(val, "Operations", &o.Operations)
			delete(rawMsg, key)
		case "percentComplete":
			err = unpopulate(val, "PercentComplete", &o.PercentComplete)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &o.Properties)
			delete(rawMsg, key)
		case "resourceId":
			err = unpopulate(val, "ResourceID", &o.ResourceID)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](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: %s", o, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OperationStatusResult.
func (o OperationStatusResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "endTime", o.EndTime)
	populate(objectMap, "error", o.Error)
	populate(objectMap, "id", o.ID)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "operations", o.Operations)
	populate(objectMap, "percentComplete", o.PercentComplete)
	populate(objectMap, "resourceId", o.ResourceID)
	populateTime[datetime.RFC3339](objectMap, "startTime", o.StartTime)
	populate(objectMap, "status", o.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult.
func (o *OperationStatusResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", o, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTime[datetime.RFC3339](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 "operations":
			err = unpopulate(val, "Operations", &o.Operations)
			delete(rawMsg, key)
		case "percentComplete":
			err = unpopulate(val, "PercentComplete", &o.PercentComplete)
			delete(rawMsg, key)
		case "resourceId":
			err = unpopulate(val, "ResourceID", &o.ResourceID)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTime[datetime.RFC3339](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: %s", o, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint.
func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "category", o.Category)
	populate(objectMap, "endpoints", o.Endpoints)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint.
func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", o, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "category":
			err = unpopulate(val, "Category", &o.Category)
			delete(rawMsg, key)
		case "endpoints":
			err = unpopulate(val, "Endpoints", &o.Endpoints)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", o, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection.
func (o OutboundEnvironmentEndpointCollection) 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 OutboundEnvironmentEndpointCollection.
func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", o, err.Error())
	}
	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: %s", o, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Pool.
func (p Pool) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", p.ID)
	populate(objectMap, "location", p.Location)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "systemData", p.SystemData)
	populate(objectMap, "tags", p.Tags)
	populate(objectMap, "type", p.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Pool.
func (p *Pool) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &p.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PoolDevBoxDefinition.
func (p PoolDevBoxDefinition) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "activeImageReference", p.ActiveImageReference)
	populate(objectMap, "imageReference", p.ImageReference)
	populate(objectMap, "sku", p.SKU)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PoolDevBoxDefinition.
func (p *PoolDevBoxDefinition) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activeImageReference":
			err = unpopulate(val, "ActiveImageReference", &p.ActiveImageReference)
			delete(rawMsg, key)
		case "imageReference":
			err = unpopulate(val, "ImageReference", &p.ImageReference)
			delete(rawMsg, key)
		case "sku":
			err = unpopulate(val, "SKU", &p.SKU)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type PoolListResult.
func (p *PoolListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &p.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &p.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PoolProperties.
func (p PoolProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "activeHoursConfiguration", p.ActiveHoursConfiguration)
	populate(objectMap, "devBoxCount", p.DevBoxCount)
	populate(objectMap, "devBoxDefinition", p.DevBoxDefinition)
	populate(objectMap, "devBoxDefinitionName", p.DevBoxDefinitionName)
	populate(objectMap, "devBoxDefinitionType", p.DevBoxDefinitionType)
	populate(objectMap, "devBoxTunnelEnableStatus", p.DevBoxTunnelEnableStatus)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "healthStatus", p.HealthStatus)
	populate(objectMap, "healthStatusDetails", p.HealthStatusDetails)
	populate(objectMap, "licenseType", p.LicenseType)
	populate(objectMap, "localAdministrator", p.LocalAdministrator)
	populate(objectMap, "managedVirtualNetworkRegions", p.ManagedVirtualNetworkRegions)
	populate(objectMap, "networkConnectionName", p.NetworkConnectionName)
	populate(objectMap, "provisioningState", p.ProvisioningState)
	populate(objectMap, "singleSignOnStatus", p.SingleSignOnStatus)
	populate(objectMap, "stopOnDisconnect", p.StopOnDisconnect)
	populate(objectMap, "stopOnNoConnect", p.StopOnNoConnect)
	populate(objectMap, "virtualNetworkType", p.VirtualNetworkType)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PoolProperties.
func (p *PoolProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activeHoursConfiguration":
			err = unpopulate(val, "ActiveHoursConfiguration", &p.ActiveHoursConfiguration)
			delete(rawMsg, key)
		case "devBoxCount":
			err = unpopulate(val, "DevBoxCount", &p.DevBoxCount)
			delete(rawMsg, key)
		case "devBoxDefinition":
			err = unpopulate(val, "DevBoxDefinition", &p.DevBoxDefinition)
			delete(rawMsg, key)
		case "devBoxDefinitionName":
			err = unpopulate(val, "DevBoxDefinitionName", &p.DevBoxDefinitionName)
			delete(rawMsg, key)
		case "devBoxDefinitionType":
			err = unpopulate(val, "DevBoxDefinitionType", &p.DevBoxDefinitionType)
			delete(rawMsg, key)
		case "devBoxTunnelEnableStatus":
			err = unpopulate(val, "DevBoxTunnelEnableStatus", &p.DevBoxTunnelEnableStatus)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "healthStatus":
			err = unpopulate(val, "HealthStatus", &p.HealthStatus)
			delete(rawMsg, key)
		case "healthStatusDetails":
			err = unpopulate(val, "HealthStatusDetails", &p.HealthStatusDetails)
			delete(rawMsg, key)
		case "licenseType":
			err = unpopulate(val, "LicenseType", &p.LicenseType)
			delete(rawMsg, key)
		case "localAdministrator":
			err = unpopulate(val, "LocalAdministrator", &p.LocalAdministrator)
			delete(rawMsg, key)
		case "managedVirtualNetworkRegions":
			err = unpopulate(val, "ManagedVirtualNetworkRegions", &p.ManagedVirtualNetworkRegions)
			delete(rawMsg, key)
		case "networkConnectionName":
			err = unpopulate(val, "NetworkConnectionName", &p.NetworkConnectionName)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
			delete(rawMsg, key)
		case "singleSignOnStatus":
			err = unpopulate(val, "SingleSignOnStatus", &p.SingleSignOnStatus)
			delete(rawMsg, key)
		case "stopOnDisconnect":
			err = unpopulate(val, "StopOnDisconnect", &p.StopOnDisconnect)
			delete(rawMsg, key)
		case "stopOnNoConnect":
			err = unpopulate(val, "StopOnNoConnect", &p.StopOnNoConnect)
			delete(rawMsg, key)
		case "virtualNetworkType":
			err = unpopulate(val, "VirtualNetworkType", &p.VirtualNetworkType)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PoolUpdate.
func (p PoolUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "location", p.Location)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "tags", p.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PoolUpdate.
func (p *PoolUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "location":
			err = unpopulate(val, "Location", &p.Location)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PoolUpdateProperties.
func (p PoolUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "activeHoursConfiguration", p.ActiveHoursConfiguration)
	populate(objectMap, "devBoxDefinition", p.DevBoxDefinition)
	populate(objectMap, "devBoxDefinitionName", p.DevBoxDefinitionName)
	populate(objectMap, "devBoxDefinitionType", p.DevBoxDefinitionType)
	populate(objectMap, "devBoxTunnelEnableStatus", p.DevBoxTunnelEnableStatus)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "licenseType", p.LicenseType)
	populate(objectMap, "localAdministrator", p.LocalAdministrator)
	populate(objectMap, "managedVirtualNetworkRegions", p.ManagedVirtualNetworkRegions)
	populate(objectMap, "networkConnectionName", p.NetworkConnectionName)
	populate(objectMap, "singleSignOnStatus", p.SingleSignOnStatus)
	populate(objectMap, "stopOnDisconnect", p.StopOnDisconnect)
	populate(objectMap, "stopOnNoConnect", p.StopOnNoConnect)
	populate(objectMap, "virtualNetworkType", p.VirtualNetworkType)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PoolUpdateProperties.
func (p *PoolUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activeHoursConfiguration":
			err = unpopulate(val, "ActiveHoursConfiguration", &p.ActiveHoursConfiguration)
			delete(rawMsg, key)
		case "devBoxDefinition":
			err = unpopulate(val, "DevBoxDefinition", &p.DevBoxDefinition)
			delete(rawMsg, key)
		case "devBoxDefinitionName":
			err = unpopulate(val, "DevBoxDefinitionName", &p.DevBoxDefinitionName)
			delete(rawMsg, key)
		case "devBoxDefinitionType":
			err = unpopulate(val, "DevBoxDefinitionType", &p.DevBoxDefinitionType)
			delete(rawMsg, key)
		case "devBoxTunnelEnableStatus":
			err = unpopulate(val, "DevBoxTunnelEnableStatus", &p.DevBoxTunnelEnableStatus)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "licenseType":
			err = unpopulate(val, "LicenseType", &p.LicenseType)
			delete(rawMsg, key)
		case "localAdministrator":
			err = unpopulate(val, "LocalAdministrator", &p.LocalAdministrator)
			delete(rawMsg, key)
		case "managedVirtualNetworkRegions":
			err = unpopulate(val, "ManagedVirtualNetworkRegions", &p.ManagedVirtualNetworkRegions)
			delete(rawMsg, key)
		case "networkConnectionName":
			err = unpopulate(val, "NetworkConnectionName", &p.NetworkConnectionName)
			delete(rawMsg, key)
		case "singleSignOnStatus":
			err = unpopulate(val, "SingleSignOnStatus", &p.SingleSignOnStatus)
			delete(rawMsg, key)
		case "stopOnDisconnect":
			err = unpopulate(val, "StopOnDisconnect", &p.StopOnDisconnect)
			delete(rawMsg, key)
		case "stopOnNoConnect":
			err = unpopulate(val, "StopOnNoConnect", &p.StopOnNoConnect)
			delete(rawMsg, key)
		case "virtualNetworkType":
			err = unpopulate(val, "VirtualNetworkType", &p.VirtualNetworkType)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Project.
func (p Project) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", p.ID)
	populate(objectMap, "identity", p.Identity)
	populate(objectMap, "location", p.Location)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "systemData", p.SystemData)
	populate(objectMap, "tags", p.Tags)
	populate(objectMap, "type", p.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Project.
func (p *Project) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "identity":
			err = unpopulate(val, "Identity", &p.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &p.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectCatalogSettings.
func (p ProjectCatalogSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "catalogItemSyncTypes", p.CatalogItemSyncTypes)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCatalogSettings.
func (p *ProjectCatalogSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "catalogItemSyncTypes":
			err = unpopulate(val, "CatalogItemSyncTypes", &p.CatalogItemSyncTypes)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectCatalogSettingsInfo.
func (p ProjectCatalogSettingsInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "catalogItemSyncEnableStatus", p.CatalogItemSyncEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCatalogSettingsInfo.
func (p *ProjectCatalogSettingsInfo) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "catalogItemSyncEnableStatus":
			err = unpopulate(val, "CatalogItemSyncEnableStatus", &p.CatalogItemSyncEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectCustomizationManagedIdentity.
func (p ProjectCustomizationManagedIdentity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identityResourceId", p.IdentityResourceID)
	populate(objectMap, "identityType", p.IdentityType)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCustomizationManagedIdentity.
func (p *ProjectCustomizationManagedIdentity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identityResourceId":
			err = unpopulate(val, "IdentityResourceID", &p.IdentityResourceID)
			delete(rawMsg, key)
		case "identityType":
			err = unpopulate(val, "IdentityType", &p.IdentityType)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectCustomizationSettings.
func (p ProjectCustomizationSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identities", p.Identities)
	populate(objectMap, "userCustomizationsEnableStatus", p.UserCustomizationsEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCustomizationSettings.
func (p *ProjectCustomizationSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identities":
			err = unpopulate(val, "Identities", &p.Identities)
			delete(rawMsg, key)
		case "userCustomizationsEnableStatus":
			err = unpopulate(val, "UserCustomizationsEnableStatus", &p.UserCustomizationsEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentType.
func (p ProjectEnvironmentType) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", p.ID)
	populate(objectMap, "identity", p.Identity)
	populate(objectMap, "location", p.Location)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "systemData", p.SystemData)
	populate(objectMap, "tags", p.Tags)
	populate(objectMap, "type", p.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentType.
func (p *ProjectEnvironmentType) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "identity":
			err = unpopulate(val, "Identity", &p.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &p.Location)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeListResult.
func (p *ProjectEnvironmentTypeListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &p.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &p.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeProperties.
func (p ProjectEnvironmentTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "creatorRoleAssignment", p.CreatorRoleAssignment)
	populate(objectMap, "deploymentTargetId", p.DeploymentTargetID)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "environmentCount", p.EnvironmentCount)
	populate(objectMap, "provisioningState", p.ProvisioningState)
	populate(objectMap, "status", p.Status)
	populate(objectMap, "userRoleAssignments", p.UserRoleAssignments)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeProperties.
func (p *ProjectEnvironmentTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "creatorRoleAssignment":
			err = unpopulate(val, "CreatorRoleAssignment", &p.CreatorRoleAssignment)
			delete(rawMsg, key)
		case "deploymentTargetId":
			err = unpopulate(val, "DeploymentTargetID", &p.DeploymentTargetID)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "environmentCount":
			err = unpopulate(val, "EnvironmentCount", &p.EnvironmentCount)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &p.Status)
			delete(rawMsg, key)
		case "userRoleAssignments":
			err = unpopulate(val, "UserRoleAssignments", &p.UserRoleAssignments)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdate.
func (p ProjectEnvironmentTypeUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identity", p.Identity)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "tags", p.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdate.
func (p *ProjectEnvironmentTypeUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identity":
			err = unpopulate(val, "Identity", &p.Identity)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdateProperties.
func (p ProjectEnvironmentTypeUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "creatorRoleAssignment", p.CreatorRoleAssignment)
	populate(objectMap, "deploymentTargetId", p.DeploymentTargetID)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "status", p.Status)
	populate(objectMap, "userRoleAssignments", p.UserRoleAssignments)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdateProperties.
func (p *ProjectEnvironmentTypeUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "creatorRoleAssignment":
			err = unpopulate(val, "CreatorRoleAssignment", &p.CreatorRoleAssignment)
			delete(rawMsg, key)
		case "deploymentTargetId":
			err = unpopulate(val, "DeploymentTargetID", &p.DeploymentTargetID)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &p.Status)
			delete(rawMsg, key)
		case "userRoleAssignments":
			err = unpopulate(val, "UserRoleAssignments", &p.UserRoleAssignments)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment.
func (p ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "roles", p.Roles)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment.
func (p *ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "roles":
			err = unpopulate(val, "Roles", &p.Roles)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectListResult.
func (p *ProjectListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &p.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &p.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectNetworkSettings.
func (p ProjectNetworkSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "microsoftHostedNetworkEnableStatus", p.MicrosoftHostedNetworkEnableStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectNetworkSettings.
func (p *ProjectNetworkSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "microsoftHostedNetworkEnableStatus":
			err = unpopulate(val, "MicrosoftHostedNetworkEnableStatus", &p.MicrosoftHostedNetworkEnableStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectPolicy.
func (p ProjectPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", p.ID)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "systemData", p.SystemData)
	populate(objectMap, "type", p.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectPolicy.
func (p *ProjectPolicy) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	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 "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "systemData":
			err = unpopulate(val, "SystemData", &p.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectPolicyListResult.
func (p *ProjectPolicyListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &p.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &p.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectPolicyProperties.
func (p ProjectPolicyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "configurationPolicies", p.ConfigurationPolicies)
	populate(objectMap, "provisioningState", p.ProvisioningState)
	populate(objectMap, "resourcePolicies", p.ResourcePolicies)
	populate(objectMap, "scopes", p.Scopes)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectPolicyProperties.
func (p *ProjectPolicyProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "configurationPolicies":
			err = unpopulate(val, "ConfigurationPolicies", &p.ConfigurationPolicies)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
			delete(rawMsg, key)
		case "resourcePolicies":
			err = unpopulate(val, "ResourcePolicies", &p.ResourcePolicies)
			delete(rawMsg, key)
		case "scopes":
			err = unpopulate(val, "Scopes", &p.Scopes)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectPolicyUpdate.
func (p ProjectPolicyUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", p.Properties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectPolicyUpdate.
func (p *ProjectPolicyUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectPolicyUpdateProperties.
func (p ProjectPolicyUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "configurationPolicies", p.ConfigurationPolicies)
	populate(objectMap, "resourcePolicies", p.ResourcePolicies)
	populate(objectMap, "scopes", p.Scopes)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectPolicyUpdateProperties.
func (p *ProjectPolicyUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "configurationPolicies":
			err = unpopulate(val, "ConfigurationPolicies", &p.ConfigurationPolicies)
			delete(rawMsg, key)
		case "resourcePolicies":
			err = unpopulate(val, "ResourcePolicies", &p.ResourcePolicies)
			delete(rawMsg, key)
		case "scopes":
			err = unpopulate(val, "Scopes", &p.Scopes)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectProperties.
func (p ProjectProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "assignedGroups", p.AssignedGroups)
	populate(objectMap, "azureAiServicesSettings", p.AzureAiServicesSettings)
	populate(objectMap, "catalogSettings", p.CatalogSettings)
	populate(objectMap, "customizationSettings", p.CustomizationSettings)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "devBoxScheduleDeleteSettings", p.DevBoxScheduleDeleteSettings)
	populate(objectMap, "devCenterId", p.DevCenterID)
	populate(objectMap, "devCenterUri", p.DevCenterURI)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "maxDevBoxesPerUser", p.MaxDevBoxesPerUser)
	populate(objectMap, "provisioningState", p.ProvisioningState)
	populate(objectMap, "serverlessGpuSessionsSettings", p.ServerlessGpuSessionsSettings)
	populate(objectMap, "workspaceStorageSettings", p.WorkspaceStorageSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectProperties.
func (p *ProjectProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "assignedGroups":
			err = unpopulate(val, "AssignedGroups", &p.AssignedGroups)
			delete(rawMsg, key)
		case "azureAiServicesSettings":
			err = unpopulate(val, "AzureAiServicesSettings", &p.AzureAiServicesSettings)
			delete(rawMsg, key)
		case "catalogSettings":
			err = unpopulate(val, "CatalogSettings", &p.CatalogSettings)
			delete(rawMsg, key)
		case "customizationSettings":
			err = unpopulate(val, "CustomizationSettings", &p.CustomizationSettings)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "devBoxScheduleDeleteSettings":
			err = unpopulate(val, "DevBoxScheduleDeleteSettings", &p.DevBoxScheduleDeleteSettings)
			delete(rawMsg, key)
		case "devCenterId":
			err = unpopulate(val, "DevCenterID", &p.DevCenterID)
			delete(rawMsg, key)
		case "devCenterUri":
			err = unpopulate(val, "DevCenterURI", &p.DevCenterURI)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "maxDevBoxesPerUser":
			err = unpopulate(val, "MaxDevBoxesPerUser", &p.MaxDevBoxesPerUser)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
			delete(rawMsg, key)
		case "serverlessGpuSessionsSettings":
			err = unpopulate(val, "ServerlessGpuSessionsSettings", &p.ServerlessGpuSessionsSettings)
			delete(rawMsg, key)
		case "workspaceStorageSettings":
			err = unpopulate(val, "WorkspaceStorageSettings", &p.WorkspaceStorageSettings)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectUpdate.
func (p ProjectUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identity", p.Identity)
	populate(objectMap, "location", p.Location)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "tags", p.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectUpdate.
func (p *ProjectUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identity":
			err = unpopulate(val, "Identity", &p.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &p.Location)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &p.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &p.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ProjectUpdateProperties.
func (p ProjectUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "assignedGroups", p.AssignedGroups)
	populate(objectMap, "azureAiServicesSettings", p.AzureAiServicesSettings)
	populate(objectMap, "catalogSettings", p.CatalogSettings)
	populate(objectMap, "customizationSettings", p.CustomizationSettings)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "devBoxScheduleDeleteSettings", p.DevBoxScheduleDeleteSettings)
	populate(objectMap, "devCenterId", p.DevCenterID)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "maxDevBoxesPerUser", p.MaxDevBoxesPerUser)
	populate(objectMap, "serverlessGpuSessionsSettings", p.ServerlessGpuSessionsSettings)
	populate(objectMap, "workspaceStorageSettings", p.WorkspaceStorageSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ProjectUpdateProperties.
func (p *ProjectUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "assignedGroups":
			err = unpopulate(val, "AssignedGroups", &p.AssignedGroups)
			delete(rawMsg, key)
		case "azureAiServicesSettings":
			err = unpopulate(val, "AzureAiServicesSettings", &p.AzureAiServicesSettings)
			delete(rawMsg, key)
		case "catalogSettings":
			err = unpopulate(val, "CatalogSettings", &p.CatalogSettings)
			delete(rawMsg, key)
		case "customizationSettings":
			err = unpopulate(val, "CustomizationSettings", &p.CustomizationSettings)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "devBoxScheduleDeleteSettings":
			err = unpopulate(val, "DevBoxScheduleDeleteSettings", &p.DevBoxScheduleDeleteSettings)
			delete(rawMsg, key)
		case "devCenterId":
			err = unpopulate(val, "DevCenterID", &p.DevCenterID)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "maxDevBoxesPerUser":
			err = unpopulate(val, "MaxDevBoxesPerUser", &p.MaxDevBoxesPerUser)
			delete(rawMsg, key)
		case "serverlessGpuSessionsSettings":
			err = unpopulate(val, "ServerlessGpuSessionsSettings", &p.ServerlessGpuSessionsSettings)
			delete(rawMsg, key)
		case "workspaceStorageSettings":
			err = unpopulate(val, "WorkspaceStorageSettings", &p.WorkspaceStorageSettings)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Properties.
func (p Properties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "devBoxProvisioningSettings", p.DevBoxProvisioningSettings)
	populate(objectMap, "devCenterUri", p.DevCenterURI)
	populate(objectMap, "displayName", p.DisplayName)
	populate(objectMap, "encryption", p.Encryption)
	populate(objectMap, "networkSettings", p.NetworkSettings)
	populate(objectMap, "projectCatalogSettings", p.ProjectCatalogSettings)
	populate(objectMap, "provisioningState", p.ProvisioningState)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Properties.
func (p *Properties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "devBoxProvisioningSettings":
			err = unpopulate(val, "DevBoxProvisioningSettings", &p.DevBoxProvisioningSettings)
			delete(rawMsg, key)
		case "devCenterUri":
			err = unpopulate(val, "DevCenterURI", &p.DevCenterURI)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &p.DisplayName)
			delete(rawMsg, key)
		case "encryption":
			err = unpopulate(val, "Encryption", &p.Encryption)
			delete(rawMsg, key)
		case "networkSettings":
			err = unpopulate(val, "NetworkSettings", &p.NetworkSettings)
			delete(rawMsg, key)
		case "projectCatalogSettings":
			err = unpopulate(val, "ProjectCatalogSettings", &p.ProjectCatalogSettings)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", p, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration.
func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "memory", r.Memory)
	populate(objectMap, "vCPUs", r.VCPUs)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration.
func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "memory":
			err = unpopulate(val, "Memory", &r.Memory)
			delete(rawMsg, key)
		case "vCPUs":
			err = unpopulate(val, "VCPUs", &r.VCPUs)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResourcePolicy.
func (r ResourcePolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "action", r.Action)
	populate(objectMap, "filter", r.Filter)
	populate(objectMap, "resourceType", r.ResourceType)
	populate(objectMap, "resources", r.Resources)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResourcePolicy.
func (r *ResourcePolicy) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "action":
			err = unpopulate(val, "Action", &r.Action)
			delete(rawMsg, key)
		case "filter":
			err = unpopulate(val, "Filter", &r.Filter)
			delete(rawMsg, key)
		case "resourceType":
			err = unpopulate(val, "ResourceType", &r.ResourceType)
			delete(rawMsg, key)
		case "resources":
			err = unpopulate(val, "Resources", &r.Resources)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResourceRange.
func (r ResourceRange) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "max", r.Max)
	populate(objectMap, "min", r.Min)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange.
func (r *ResourceRange) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "max":
			err = unpopulate(val, "Max", &r.Max)
			delete(rawMsg, key)
		case "min":
			err = unpopulate(val, "Min", &r.Min)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", r, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SKU.
func (s SKU) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "capacity", s.Capacity)
	populate(objectMap, "family", s.Family)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "size", s.Size)
	populate(objectMap, "tier", s.Tier)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
func (s *SKU) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "capacity":
			err = unpopulate(val, "Capacity", &s.Capacity)
			delete(rawMsg, key)
		case "family":
			err = unpopulate(val, "Family", &s.Family)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "size":
			err = unpopulate(val, "Size", &s.Size)
			delete(rawMsg, key)
		case "tier":
			err = unpopulate(val, "Tier", &s.Tier)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SKUInfo.
func (s SKUInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "capabilities", s.Capabilities)
	populate(objectMap, "capacity", s.Capacity)
	populate(objectMap, "family", s.Family)
	populate(objectMap, "locations", s.Locations)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "resourceType", s.ResourceType)
	populate(objectMap, "size", s.Size)
	populate(objectMap, "tier", s.Tier)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SKUInfo.
func (s *SKUInfo) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "capabilities":
			err = unpopulate(val, "Capabilities", &s.Capabilities)
			delete(rawMsg, key)
		case "capacity":
			err = unpopulate(val, "Capacity", &s.Capacity)
			delete(rawMsg, key)
		case "family":
			err = unpopulate(val, "Family", &s.Family)
			delete(rawMsg, key)
		case "locations":
			err = unpopulate(val, "Locations", &s.Locations)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "resourceType":
			err = unpopulate(val, "ResourceType", &s.ResourceType)
			delete(rawMsg, key)
		case "size":
			err = unpopulate(val, "Size", &s.Size)
			delete(rawMsg, key)
		case "tier":
			err = unpopulate(val, "Tier", &s.Tier)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type SKUListResult.
func (s *SKUListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &s.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &s.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Schedule.
func (s Schedule) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "properties", s.Properties)
	populate(objectMap, "systemData", s.SystemData)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Schedule.
func (s *Schedule) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch 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 "systemData":
			err = unpopulate(val, "SystemData", &s.SystemData)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleListResult.
func (s *ScheduleListResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "nextLink":
			err = unpopulate(val, "NextLink", &s.NextLink)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &s.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScheduleProperties.
func (s ScheduleProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "frequency", s.Frequency)
	populate(objectMap, "location", s.Location)
	populate(objectMap, "provisioningState", s.ProvisioningState)
	populate(objectMap, "state", s.State)
	populate(objectMap, "tags", s.Tags)
	populate(objectMap, "time", s.Time)
	populate(objectMap, "timeZone", s.TimeZone)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties.
func (s *ScheduleProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "frequency":
			err = unpopulate(val, "Frequency", &s.Frequency)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &s.Location)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &s.State)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &s.Tags)
			delete(rawMsg, key)
		case "time":
			err = unpopulate(val, "Time", &s.Time)
			delete(rawMsg, key)
		case "timeZone":
			err = unpopulate(val, "TimeZone", &s.TimeZone)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScheduleUpdate.
func (s ScheduleUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "properties", s.Properties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleUpdate.
func (s *ScheduleUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "properties":
			err = unpopulate(val, "Properties", &s.Properties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScheduleUpdateProperties.
func (s ScheduleUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "frequency", s.Frequency)
	populate(objectMap, "location", s.Location)
	populate(objectMap, "state", s.State)
	populate(objectMap, "tags", s.Tags)
	populate(objectMap, "time", s.Time)
	populate(objectMap, "timeZone", s.TimeZone)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleUpdateProperties.
func (s *ScheduleUpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "frequency":
			err = unpopulate(val, "Frequency", &s.Frequency)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &s.Location)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &s.State)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &s.Tags)
			delete(rawMsg, key)
		case "time":
			err = unpopulate(val, "Time", &s.Time)
			delete(rawMsg, key)
		case "timeZone":
			err = unpopulate(val, "TimeZone", &s.TimeZone)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ServerlessGpuSessionsSettings.
func (s ServerlessGpuSessionsSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "maxConcurrentSessionsPerProject", s.MaxConcurrentSessionsPerProject)
	populate(objectMap, "serverlessGpuSessionsMode", s.ServerlessGpuSessionsMode)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServerlessGpuSessionsSettings.
func (s *ServerlessGpuSessionsSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "maxConcurrentSessionsPerProject":
			err = unpopulate(val, "MaxConcurrentSessionsPerProject", &s.MaxConcurrentSessionsPerProject)
			delete(rawMsg, key)
		case "serverlessGpuSessionsMode":
			err = unpopulate(val, "ServerlessGpuSessionsMode", &s.ServerlessGpuSessionsMode)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type StopOnDisconnectConfiguration.
func (s StopOnDisconnectConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "gracePeriodMinutes", s.GracePeriodMinutes)
	populate(objectMap, "status", s.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type StopOnDisconnectConfiguration.
func (s *StopOnDisconnectConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "gracePeriodMinutes":
			err = unpopulate(val, "GracePeriodMinutes", &s.GracePeriodMinutes)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &s.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type StopOnNoConnectConfiguration.
func (s StopOnNoConnectConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "gracePeriodMinutes", s.GracePeriodMinutes)
	populate(objectMap, "status", s.Status)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type StopOnNoConnectConfiguration.
func (s *StopOnNoConnectConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "gracePeriodMinutes":
			err = unpopulate(val, "GracePeriodMinutes", &s.GracePeriodMinutes)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &s.Status)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SyncErrorDetails.
func (s SyncErrorDetails) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "conflicts", s.Conflicts)
	populate(objectMap, "errors", s.Errors)
	populate(objectMap, "operationError", s.OperationError)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SyncErrorDetails.
func (s *SyncErrorDetails) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "conflicts":
			err = unpopulate(val, "Conflicts", &s.Conflicts)
			delete(rawMsg, key)
		case "errors":
			err = unpopulate(val, "Errors", &s.Errors)
			delete(rawMsg, key)
		case "operationError":
			err = unpopulate(val, "OperationError", &s.OperationError)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SyncStats.
func (s SyncStats) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "added", s.Added)
	populate(objectMap, "removed", s.Removed)
	populate(objectMap, "syncedCatalogItemTypes", s.SyncedCatalogItemTypes)
	populate(objectMap, "synchronizationErrors", s.SynchronizationErrors)
	populate(objectMap, "unchanged", s.Unchanged)
	populate(objectMap, "updated", s.Updated)
	populate(objectMap, "validationErrors", s.ValidationErrors)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SyncStats.
func (s *SyncStats) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "added":
			err = unpopulate(val, "Added", &s.Added)
			delete(rawMsg, key)
		case "removed":
			err = unpopulate(val, "Removed", &s.Removed)
			delete(rawMsg, key)
		case "syncedCatalogItemTypes":
			err = unpopulate(val, "SyncedCatalogItemTypes", &s.SyncedCatalogItemTypes)
			delete(rawMsg, key)
		case "synchronizationErrors":
			err = unpopulate(val, "SynchronizationErrors", &s.SynchronizationErrors)
			delete(rawMsg, key)
		case "unchanged":
			err = unpopulate(val, "Unchanged", &s.Unchanged)
			delete(rawMsg, key)
		case "updated":
			err = unpopulate(val, "Updated", &s.Updated)
			delete(rawMsg, key)
		case "validationErrors":
			err = unpopulate(val, "ValidationErrors", &s.ValidationErrors)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SystemData.
func (s SystemData) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt)
	populate(objectMap, "createdBy", s.CreatedBy)
	populate(objectMap, "createdByType", s.CreatedByType)
	populateTime[datetime.RFC3339](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: %s", s, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "createdAt":
			err = unpopulateTime[datetime.RFC3339](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 = unpopulateTime[datetime.RFC3339](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: %s", s, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Update.
func (u Update) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "identity", u.Identity)
	populate(objectMap, "location", u.Location)
	populate(objectMap, "properties", u.Properties)
	populate(objectMap, "tags", u.Tags)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Update.
func (u *Update) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identity":
			err = unpopulate(val, "Identity", &u.Identity)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &u.Location)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &u.Properties)
			delete(rawMsg, key)
		case "tags":
			err = unpopulate(val, "Tags", &u.Tags)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type UpdateProperties.
func (u UpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "devBoxProvisioningSettings", u.DevBoxProvisioningSettings)
	populate(objectMap, "displayName", u.DisplayName)
	populate(objectMap, "encryption", u.Encryption)
	populate(objectMap, "networkSettings", u.NetworkSettings)
	populate(objectMap, "projectCatalogSettings", u.ProjectCatalogSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties.
func (u *UpdateProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "devBoxProvisioningSettings":
			err = unpopulate(val, "DevBoxProvisioningSettings", &u.DevBoxProvisioningSettings)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &u.DisplayName)
			delete(rawMsg, key)
		case "encryption":
			err = unpopulate(val, "Encryption", &u.Encryption)
			delete(rawMsg, key)
		case "networkSettings":
			err = unpopulate(val, "NetworkSettings", &u.NetworkSettings)
			delete(rawMsg, key)
		case "projectCatalogSettings":
			err = unpopulate(val, "ProjectCatalogSettings", &u.ProjectCatalogSettings)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Usage.
func (u Usage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "currentValue", u.CurrentValue)
	populate(objectMap, "id", u.ID)
	populate(objectMap, "limit", u.Limit)
	populate(objectMap, "name", u.Name)
	populate(objectMap, "unit", u.Unit)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Usage.
func (u *Usage) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "currentValue":
			err = unpopulate(val, "CurrentValue", &u.CurrentValue)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &u.ID)
			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 "unit":
			err = unpopulate(val, "Unit", &u.Unit)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
		}
	}
	return nil
}

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

// UnmarshalJSON implements the json.Unmarshaller interface for type UsageName.
func (u *UsageName) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "localizedValue":
			err = unpopulate(val, "LocalizedValue", &u.LocalizedValue)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &u.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
func (u UserAssignedIdentity) 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 UserAssignedIdentity.
func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	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: %s", u, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type UserRoleAssignmentValue.
func (u UserRoleAssignmentValue) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "roles", u.Roles)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UserRoleAssignmentValue.
func (u *UserRoleAssignmentValue) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "roles":
			err = unpopulate(val, "Roles", &u.Roles)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", u, err.Error())
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WorkspaceStorageSettings.
func (w WorkspaceStorageSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]any)
	populate(objectMap, "workspaceStorageMode", w.WorkspaceStorageMode)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceStorageSettings.
func (w *WorkspaceStorageSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %s", w, err.Error())
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "workspaceStorageMode":
			err = unpopulate(val, "WorkspaceStorageMode", &w.WorkspaceStorageMode)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %s", w, err.Error())
		}
	}
	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 populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) {
	if t == nil {
		return
	} else if azcore.IsNullValue(t) {
		m[k] = nil
	} else if !reflect.ValueOf(t).IsNil() {
		newTime := T(*t)
		m[k] = (*T)(&newTime)
	}
}

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
}

func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error {
	if data == nil || string(data) == "null" {
		return nil
	}
	var aux T
	if err := json.Unmarshal(data, &aux); err != nil {
		return fmt.Errorf("struct field %s: %v", fn, err)
	}
	newTime := time.Time(aux)
	*t = &newTime
	return nil
}

type dateTimeConstraints interface {
	datetime.PlainDate | datetime.PlainTime | datetime.RFC3339 | datetime.RFC7231 | datetime.Unix
}
