//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// DO NOT EDIT.

package armdatafactory

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

// MarshalJSON implements the json.Marshaller interface for type AccessPolicyResponse.
func (a AccessPolicyResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", a.AccessToken)
	populate(objectMap, "dataPlaneUrl", a.DataPlaneURL)
	populate(objectMap, "policy", a.Policy)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AccessPolicyResponse.
func (a *AccessPolicyResponse) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			err = unpopulate(val, "AccessToken", &a.AccessToken)
			delete(rawMsg, key)
		case "dataPlaneUrl":
			err = unpopulate(val, "DataPlaneURL", &a.DataPlaneURL)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Activity.
func (a Activity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "name", a.Name)
	objectMap["type"] = a.Type
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Activity.
func (a *Activity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ActivityDependency.
func (a ActivityDependency) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activity", a.Activity)
	populate(objectMap, "dependencyConditions", a.DependencyConditions)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityDependency.
func (a *ActivityDependency) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activity":
			err = unpopulate(val, "Activity", &a.Activity)
			delete(rawMsg, key)
		case "dependencyConditions":
			err = unpopulate(val, "DependencyConditions", &a.DependencyConditions)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ActivityPolicy.
func (a ActivityPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "retry", &a.Retry)
	populate(objectMap, "retryIntervalInSeconds", a.RetryIntervalInSeconds)
	populate(objectMap, "secureInput", a.SecureInput)
	populate(objectMap, "secureOutput", a.SecureOutput)
	populate(objectMap, "timeout", &a.Timeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityPolicy.
func (a *ActivityPolicy) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "retry":
			err = unpopulate(val, "Retry", &a.Retry)
			delete(rawMsg, key)
		case "retryIntervalInSeconds":
			err = unpopulate(val, "RetryIntervalInSeconds", &a.RetryIntervalInSeconds)
			delete(rawMsg, key)
		case "secureInput":
			err = unpopulate(val, "SecureInput", &a.SecureInput)
			delete(rawMsg, key)
		case "secureOutput":
			err = unpopulate(val, "SecureOutput", &a.SecureOutput)
			delete(rawMsg, key)
		case "timeout":
			err = unpopulate(val, "Timeout", &a.Timeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ActivityRun.
func (a ActivityRun) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activityName", a.ActivityName)
	populateTimeRFC3339(objectMap, "activityRunEnd", a.ActivityRunEnd)
	populate(objectMap, "activityRunId", a.ActivityRunID)
	populateTimeRFC3339(objectMap, "activityRunStart", a.ActivityRunStart)
	populate(objectMap, "activityType", a.ActivityType)
	populate(objectMap, "durationInMs", a.DurationInMs)
	populate(objectMap, "error", &a.Error)
	populate(objectMap, "input", &a.Input)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "output", &a.Output)
	populate(objectMap, "pipelineName", a.PipelineName)
	populate(objectMap, "pipelineRunId", a.PipelineRunID)
	populate(objectMap, "status", a.Status)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityRun.
func (a *ActivityRun) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activityName":
			err = unpopulate(val, "ActivityName", &a.ActivityName)
			delete(rawMsg, key)
		case "activityRunEnd":
			err = unpopulateTimeRFC3339(val, "ActivityRunEnd", &a.ActivityRunEnd)
			delete(rawMsg, key)
		case "activityRunId":
			err = unpopulate(val, "ActivityRunID", &a.ActivityRunID)
			delete(rawMsg, key)
		case "activityRunStart":
			err = unpopulateTimeRFC3339(val, "ActivityRunStart", &a.ActivityRunStart)
			delete(rawMsg, key)
		case "activityType":
			err = unpopulate(val, "ActivityType", &a.ActivityType)
			delete(rawMsg, key)
		case "durationInMs":
			err = unpopulate(val, "DurationInMs", &a.DurationInMs)
			delete(rawMsg, key)
		case "error":
			err = unpopulate(val, "Error", &a.Error)
			delete(rawMsg, key)
		case "input":
			err = unpopulate(val, "Input", &a.Input)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "output":
			err = unpopulate(val, "Output", &a.Output)
			delete(rawMsg, key)
		case "pipelineName":
			err = unpopulate(val, "PipelineName", &a.PipelineName)
			delete(rawMsg, key)
		case "pipelineRunId":
			err = unpopulate(val, "PipelineRunID", &a.PipelineRunID)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &a.Status)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type AmazonMWSLinkedService.
func (a AmazonMWSLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonMWS"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonMWSLinkedService.
func (a *AmazonMWSLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonMWSLinkedServiceTypeProperties.
func (a AmazonMWSLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKeyId", &a.AccessKeyID)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "endpoint", &a.Endpoint)
	populate(objectMap, "marketplaceID", &a.MarketplaceID)
	populate(objectMap, "mwsAuthToken", a.MwsAuthToken)
	populate(objectMap, "secretKey", a.SecretKey)
	populate(objectMap, "sellerID", &a.SellerID)
	populate(objectMap, "useEncryptedEndpoints", &a.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &a.UseHostVerification)
	populate(objectMap, "usePeerVerification", &a.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonMWSLinkedServiceTypeProperties.
func (a *AmazonMWSLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKeyId":
			err = unpopulate(val, "AccessKeyID", &a.AccessKeyID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &a.Endpoint)
			delete(rawMsg, key)
		case "marketplaceID":
			err = unpopulate(val, "MarketplaceID", &a.MarketplaceID)
			delete(rawMsg, key)
		case "mwsAuthToken":
			a.MwsAuthToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "secretKey":
			a.SecretKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "sellerID":
			err = unpopulate(val, "SellerID", &a.SellerID)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &a.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &a.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &a.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonMWSObjectDataset.
func (a AmazonMWSObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AmazonMWSObject"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonMWSObjectDataset.
func (a *AmazonMWSObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonMWSSource.
func (a AmazonMWSSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AmazonMWSSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonMWSSource.
func (a *AmazonMWSSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForLinkedServiceTypeProperties.
func (a AmazonRdsForLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForLinkedServiceTypeProperties.
func (a *AmazonRdsForLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			a.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForOracleLinkedService.
func (a AmazonRdsForOracleLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonRdsForOracle"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForOracleLinkedService.
func (a *AmazonRdsForOracleLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForOraclePartitionSettings.
func (a AmazonRdsForOraclePartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &a.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &a.PartitionLowerBound)
	populate(objectMap, "partitionNames", &a.PartitionNames)
	populate(objectMap, "partitionUpperBound", &a.PartitionUpperBound)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForOraclePartitionSettings.
func (a *AmazonRdsForOraclePartitionSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "partitionColumnName":
			err = unpopulate(val, "PartitionColumnName", &a.PartitionColumnName)
			delete(rawMsg, key)
		case "partitionLowerBound":
			err = unpopulate(val, "PartitionLowerBound", &a.PartitionLowerBound)
			delete(rawMsg, key)
		case "partitionNames":
			err = unpopulate(val, "PartitionNames", &a.PartitionNames)
			delete(rawMsg, key)
		case "partitionUpperBound":
			err = unpopulate(val, "PartitionUpperBound", &a.PartitionUpperBound)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForOracleSource.
func (a AmazonRdsForOracleSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "oracleReaderQuery", &a.OracleReaderQuery)
	populate(objectMap, "partitionOption", &a.PartitionOption)
	populate(objectMap, "partitionSettings", a.PartitionSettings)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AmazonRdsForOracleSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForOracleSource.
func (a *AmazonRdsForOracleSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "oracleReaderQuery":
			err = unpopulate(val, "OracleReaderQuery", &a.OracleReaderQuery)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &a.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &a.PartitionSettings)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForOracleTableDataset.
func (a AmazonRdsForOracleTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AmazonRdsForOracleTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForOracleTableDataset.
func (a *AmazonRdsForOracleTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForOracleTableDatasetTypeProperties.
func (a AmazonRdsForOracleTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForSQLServerLinkedService.
func (a AmazonRdsForSQLServerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonRdsForSqlServer"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForSQLServerLinkedService.
func (a *AmazonRdsForSQLServerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForSQLServerLinkedServiceTypeProperties.
func (a AmazonRdsForSQLServerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alwaysEncryptedSettings", a.AlwaysEncryptedSettings)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "userName", &a.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForSQLServerLinkedServiceTypeProperties.
func (a *AmazonRdsForSQLServerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alwaysEncryptedSettings":
			err = unpopulate(val, "AlwaysEncryptedSettings", &a.AlwaysEncryptedSettings)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			a.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &a.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForSQLServerSource.
func (a AmazonRdsForSQLServerSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &a.PartitionOption)
	populate(objectMap, "partitionSettings", a.PartitionSettings)
	populate(objectMap, "produceAdditionalTypes", &a.ProduceAdditionalTypes)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &a.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &a.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &a.StoredProcedureParameters)
	objectMap["type"] = "AmazonRdsForSqlServerSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForSQLServerSource.
func (a *AmazonRdsForSQLServerSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &a.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &a.PartitionSettings)
			delete(rawMsg, key)
		case "produceAdditionalTypes":
			err = unpopulate(val, "ProduceAdditionalTypes", &a.ProduceAdditionalTypes)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &a.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &a.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &a.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForSQLServerTableDataset.
func (a AmazonRdsForSQLServerTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AmazonRdsForSqlServerTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRdsForSQLServerTableDataset.
func (a *AmazonRdsForSQLServerTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRdsForSQLServerTableDatasetTypeProperties.
func (a AmazonRdsForSQLServerTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AmazonRedshiftLinkedService.
func (a AmazonRedshiftLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonRedshift"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRedshiftLinkedService.
func (a *AmazonRedshiftLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRedshiftLinkedServiceTypeProperties.
func (a AmazonRedshiftLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "database", &a.Database)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "port", &a.Port)
	populate(objectMap, "server", &a.Server)
	populate(objectMap, "username", &a.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRedshiftLinkedServiceTypeProperties.
func (a *AmazonRedshiftLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "database":
			err = unpopulate(val, "Database", &a.Database)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			a.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &a.Port)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &a.Server)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &a.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRedshiftSource.
func (a AmazonRedshiftSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "redshiftUnloadSettings", a.RedshiftUnloadSettings)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AmazonRedshiftSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRedshiftSource.
func (a *AmazonRedshiftSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "redshiftUnloadSettings":
			err = unpopulate(val, "RedshiftUnloadSettings", &a.RedshiftUnloadSettings)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRedshiftTableDataset.
func (a AmazonRedshiftTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AmazonRedshiftTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRedshiftTableDataset.
func (a *AmazonRedshiftTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonRedshiftTableDatasetTypeProperties.
func (a AmazonRedshiftTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonRedshiftTableDatasetTypeProperties.
func (a *AmazonRedshiftTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &a.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &a.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3CompatibleLinkedService.
func (a AmazonS3CompatibleLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonS3Compatible"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3CompatibleLinkedService.
func (a *AmazonS3CompatibleLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3CompatibleLinkedServiceTypeProperties.
func (a AmazonS3CompatibleLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKeyId", &a.AccessKeyID)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "forcePathStyle", &a.ForcePathStyle)
	populate(objectMap, "secretAccessKey", a.SecretAccessKey)
	populate(objectMap, "serviceUrl", &a.ServiceURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3CompatibleLinkedServiceTypeProperties.
func (a *AmazonS3CompatibleLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKeyId":
			err = unpopulate(val, "AccessKeyID", &a.AccessKeyID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "forcePathStyle":
			err = unpopulate(val, "ForcePathStyle", &a.ForcePathStyle)
			delete(rawMsg, key)
		case "secretAccessKey":
			a.SecretAccessKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "serviceUrl":
			err = unpopulate(val, "ServiceURL", &a.ServiceURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3CompatibleLocation.
func (a AmazonS3CompatibleLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &a.BucketName)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AmazonS3CompatibleLocation"
	populate(objectMap, "version", &a.Version)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3CompatibleLocation.
func (a *AmazonS3CompatibleLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "bucketName":
			err = unpopulate(val, "BucketName", &a.BucketName)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &a.Version)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3CompatibleReadSettings.
func (a AmazonS3CompatibleReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "prefix", &a.Prefix)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AmazonS3CompatibleReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3CompatibleReadSettings.
func (a *AmazonS3CompatibleReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &a.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3Dataset.
func (a AmazonS3Dataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AmazonS3Object"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3Dataset.
func (a *AmazonS3Dataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3DatasetTypeProperties.
func (a AmazonS3DatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &a.BucketName)
	populate(objectMap, "compression", a.Compression)
	populate(objectMap, "format", a.Format)
	populate(objectMap, "key", &a.Key)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "prefix", &a.Prefix)
	populate(objectMap, "version", &a.Version)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3DatasetTypeProperties.
func (a *AmazonS3DatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "bucketName":
			err = unpopulate(val, "BucketName", &a.BucketName)
			delete(rawMsg, key)
		case "compression":
			err = unpopulate(val, "Compression", &a.Compression)
			delete(rawMsg, key)
		case "format":
			a.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		case "key":
			err = unpopulate(val, "Key", &a.Key)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &a.Prefix)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &a.Version)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3LinkedService.
func (a AmazonS3LinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AmazonS3"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3LinkedService.
func (a *AmazonS3LinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3LinkedServiceTypeProperties.
func (a AmazonS3LinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKeyId", &a.AccessKeyID)
	populate(objectMap, "authenticationType", &a.AuthenticationType)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "secretAccessKey", a.SecretAccessKey)
	populate(objectMap, "serviceUrl", &a.ServiceURL)
	populate(objectMap, "sessionToken", a.SessionToken)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3LinkedServiceTypeProperties.
func (a *AmazonS3LinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKeyId":
			err = unpopulate(val, "AccessKeyID", &a.AccessKeyID)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &a.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "secretAccessKey":
			a.SecretAccessKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "serviceUrl":
			err = unpopulate(val, "ServiceURL", &a.ServiceURL)
			delete(rawMsg, key)
		case "sessionToken":
			a.SessionToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3Location.
func (a AmazonS3Location) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &a.BucketName)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AmazonS3Location"
	populate(objectMap, "version", &a.Version)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3Location.
func (a *AmazonS3Location) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "bucketName":
			err = unpopulate(val, "BucketName", &a.BucketName)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &a.Version)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AmazonS3ReadSettings.
func (a AmazonS3ReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "prefix", &a.Prefix)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AmazonS3ReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AmazonS3ReadSettings.
func (a *AmazonS3ReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &a.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AppFiguresLinkedService.
func (a AppFiguresLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AppFigures"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AppFiguresLinkedService.
func (a *AppFiguresLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AppFiguresLinkedServiceTypeProperties.
func (a AppFiguresLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientKey", a.ClientKey)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "userName", &a.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AppFiguresLinkedServiceTypeProperties.
func (a *AppFiguresLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientKey":
			a.ClientKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "password":
			a.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &a.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AppendVariableActivity.
func (a AppendVariableActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "name", a.Name)
	objectMap["type"] = "AppendVariable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AppendVariableActivity.
func (a *AppendVariableActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type AsanaLinkedService.
func (a AsanaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "Asana"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AsanaLinkedService.
func (a *AsanaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AsanaLinkedServiceTypeProperties.
func (a AsanaLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", a.APIToken)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AvroDataset.
func (a AvroDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "Avro"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroDataset.
func (a *AvroDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AvroDatasetTypeProperties.
func (a AvroDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "avroCompressionCodec", &a.AvroCompressionCodec)
	populate(objectMap, "avroCompressionLevel", a.AvroCompressionLevel)
	populate(objectMap, "location", a.Location)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroDatasetTypeProperties.
func (a *AvroDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "avroCompressionCodec":
			err = unpopulate(val, "AvroCompressionCodec", &a.AvroCompressionCodec)
			delete(rawMsg, key)
		case "avroCompressionLevel":
			err = unpopulate(val, "AvroCompressionLevel", &a.AvroCompressionLevel)
			delete(rawMsg, key)
		case "location":
			a.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AvroFormat.
func (a AvroFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deserializer", &a.Deserializer)
	populate(objectMap, "serializer", &a.Serializer)
	objectMap["type"] = "AvroFormat"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroFormat.
func (a *AvroFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deserializer":
			err = unpopulate(val, "Deserializer", &a.Deserializer)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &a.Serializer)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AvroSink.
func (a AvroSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "formatSettings", a.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	populate(objectMap, "storeSettings", a.StoreSettings)
	objectMap["type"] = "AvroSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroSink.
func (a *AvroSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &a.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			a.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AvroSource.
func (a AvroSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	populate(objectMap, "storeSettings", a.StoreSettings)
	objectMap["type"] = "AvroSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroSource.
func (a *AvroSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			a.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AvroWriteSettings.
func (a AvroWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileNamePrefix", &a.FileNamePrefix)
	populate(objectMap, "maxRowsPerFile", &a.MaxRowsPerFile)
	populate(objectMap, "recordName", a.RecordName)
	populate(objectMap, "recordNamespace", a.RecordNamespace)
	objectMap["type"] = "AvroWriteSettings"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AvroWriteSettings.
func (a *AvroWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileNamePrefix":
			err = unpopulate(val, "FileNamePrefix", &a.FileNamePrefix)
			delete(rawMsg, key)
		case "maxRowsPerFile":
			err = unpopulate(val, "MaxRowsPerFile", &a.MaxRowsPerFile)
			delete(rawMsg, key)
		case "recordName":
			err = unpopulate(val, "RecordName", &a.RecordName)
			delete(rawMsg, key)
		case "recordNamespace":
			err = unpopulate(val, "RecordNamespace", &a.RecordNamespace)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type AzureBatchLinkedService.
func (a AzureBatchLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureBatch"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBatchLinkedService.
func (a *AzureBatchLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBatchLinkedServiceTypeProperties.
func (a AzureBatchLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKey", a.AccessKey)
	populate(objectMap, "accountName", &a.AccountName)
	populate(objectMap, "batchUri", &a.BatchURI)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "poolName", &a.PoolName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBatchLinkedServiceTypeProperties.
func (a *AzureBatchLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKey":
			a.AccessKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "accountName":
			err = unpopulate(val, "AccountName", &a.AccountName)
			delete(rawMsg, key)
		case "batchUri":
			err = unpopulate(val, "BatchURI", &a.BatchURI)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "poolName":
			err = unpopulate(val, "PoolName", &a.PoolName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobDataset.
func (a AzureBlobDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureBlob"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDataset.
func (a *AzureBlobDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobDatasetTypeProperties.
func (a AzureBlobDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", a.Compression)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	populate(objectMap, "format", a.Format)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "tableRootLocation", &a.TableRootLocation)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDatasetTypeProperties.
func (a *AzureBlobDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &a.Compression)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "format":
			a.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "tableRootLocation":
			err = unpopulate(val, "TableRootLocation", &a.TableRootLocation)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSDataset.
func (a AzureBlobFSDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureBlobFSFile"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSDataset.
func (a *AzureBlobFSDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSDatasetTypeProperties.
func (a AzureBlobFSDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", a.Compression)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	populate(objectMap, "format", a.Format)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSDatasetTypeProperties.
func (a *AzureBlobFSDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &a.Compression)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "format":
			a.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSLinkedService.
func (a AzureBlobFSLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureBlobFS"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSLinkedService.
func (a *AzureBlobFSLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSLinkedServiceTypeProperties.
func (a AzureBlobFSLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountKey", &a.AccountKey)
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "servicePrincipalCredential", a.ServicePrincipalCredential)
	populate(objectMap, "servicePrincipalCredentialType", &a.ServicePrincipalCredentialType)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	populate(objectMap, "url", &a.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSLinkedServiceTypeProperties.
func (a *AzureBlobFSLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountKey":
			err = unpopulate(val, "AccountKey", &a.AccountKey)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "servicePrincipalCredential":
			a.ServicePrincipalCredential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalCredentialType":
			err = unpopulate(val, "ServicePrincipalCredentialType", &a.ServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &a.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSLocation.
func (a AzureBlobFSLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "fileSystem", &a.FileSystem)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AzureBlobFSLocation"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSLocation.
func (a *AzureBlobFSLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "fileSystem":
			err = unpopulate(val, "FileSystem", &a.FileSystem)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSReadSettings.
func (a AzureBlobFSReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AzureBlobFSReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSReadSettings.
func (a *AzureBlobFSReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSSink.
func (a AzureBlobFSSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "metadata", a.Metadata)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureBlobFSSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSSink.
func (a *AzureBlobFSSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "metadata":
			err = unpopulate(val, "Metadata", &a.Metadata)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSSource.
func (a AzureBlobFSSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "recursive", &a.Recursive)
	populate(objectMap, "skipHeaderLineCount", &a.SkipHeaderLineCount)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	populate(objectMap, "treatEmptyAsNull", &a.TreatEmptyAsNull)
	objectMap["type"] = "AzureBlobFSSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSSource.
func (a *AzureBlobFSSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "skipHeaderLineCount":
			err = unpopulate(val, "SkipHeaderLineCount", &a.SkipHeaderLineCount)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "treatEmptyAsNull":
			err = unpopulate(val, "TreatEmptyAsNull", &a.TreatEmptyAsNull)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobFSWriteSettings.
func (a AzureBlobFSWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blockSizeInMB", &a.BlockSizeInMB)
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	objectMap["type"] = "AzureBlobFSWriteSettings"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobFSWriteSettings.
func (a *AzureBlobFSWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "blockSizeInMB":
			err = unpopulate(val, "BlockSizeInMB", &a.BlockSizeInMB)
			delete(rawMsg, key)
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobStorageLinkedService.
func (a AzureBlobStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureBlobStorage"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobStorageLinkedService.
func (a *AzureBlobStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobStorageLinkedServiceTypeProperties.
func (a AzureBlobStorageLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountKey", a.AccountKey)
	populate(objectMap, "accountKind", a.AccountKind)
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", a.EncryptedCredential)
	populate(objectMap, "sasToken", a.SasToken)
	populate(objectMap, "sasUri", &a.SasURI)
	populate(objectMap, "serviceEndpoint", a.ServiceEndpoint)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobStorageLinkedServiceTypeProperties.
func (a *AzureBlobStorageLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountKey":
			err = unpopulate(val, "AccountKey", &a.AccountKey)
			delete(rawMsg, key)
		case "accountKind":
			err = unpopulate(val, "AccountKind", &a.AccountKind)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "sasToken":
			err = unpopulate(val, "SasToken", &a.SasToken)
			delete(rawMsg, key)
		case "sasUri":
			err = unpopulate(val, "SasURI", &a.SasURI)
			delete(rawMsg, key)
		case "serviceEndpoint":
			err = unpopulate(val, "ServiceEndpoint", &a.ServiceEndpoint)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobStorageLocation.
func (a AzureBlobStorageLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "container", &a.Container)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AzureBlobStorageLocation"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobStorageLocation.
func (a *AzureBlobStorageLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "container":
			err = unpopulate(val, "Container", &a.Container)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobStorageReadSettings.
func (a AzureBlobStorageReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "prefix", &a.Prefix)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AzureBlobStorageReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobStorageReadSettings.
func (a *AzureBlobStorageReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &a.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureBlobStorageWriteSettings.
func (a AzureBlobStorageWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blockSizeInMB", &a.BlockSizeInMB)
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	objectMap["type"] = "AzureBlobStorageWriteSettings"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobStorageWriteSettings.
func (a *AzureBlobStorageWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "blockSizeInMB":
			err = unpopulate(val, "BlockSizeInMB", &a.BlockSizeInMB)
			delete(rawMsg, key)
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerCommandActivity.
func (a AzureDataExplorerCommandActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "policy", a.Policy)
	objectMap["type"] = "AzureDataExplorerCommand"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerCommandActivity.
func (a *AzureDataExplorerCommandActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerCommandActivityTypeProperties.
func (a AzureDataExplorerCommandActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "command", &a.Command)
	populate(objectMap, "commandTimeout", &a.CommandTimeout)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerDatasetTypeProperties.
func (a AzureDataExplorerDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "table", &a.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerLinkedService.
func (a AzureDataExplorerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureDataExplorer"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerLinkedService.
func (a *AzureDataExplorerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerLinkedServiceTypeProperties.
func (a AzureDataExplorerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "database", &a.Database)
	populate(objectMap, "endpoint", &a.Endpoint)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerLinkedServiceTypeProperties.
func (a *AzureDataExplorerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "database":
			err = unpopulate(val, "Database", &a.Database)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &a.Endpoint)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerSink.
func (a AzureDataExplorerSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "flushImmediately", &a.FlushImmediately)
	populate(objectMap, "ingestionMappingAsJson", &a.IngestionMappingAsJSON)
	populate(objectMap, "ingestionMappingName", &a.IngestionMappingName)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureDataExplorerSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerSink.
func (a *AzureDataExplorerSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "flushImmediately":
			err = unpopulate(val, "FlushImmediately", &a.FlushImmediately)
			delete(rawMsg, key)
		case "ingestionMappingAsJson":
			err = unpopulate(val, "IngestionMappingAsJSON", &a.IngestionMappingAsJSON)
			delete(rawMsg, key)
		case "ingestionMappingName":
			err = unpopulate(val, "IngestionMappingName", &a.IngestionMappingName)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerSource.
func (a AzureDataExplorerSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "noTruncation", &a.NoTruncation)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureDataExplorerSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerSource.
func (a *AzureDataExplorerSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "noTruncation":
			err = unpopulate(val, "NoTruncation", &a.NoTruncation)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataExplorerTableDataset.
func (a AzureDataExplorerTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureDataExplorerTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataExplorerTableDataset.
func (a *AzureDataExplorerTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeAnalyticsLinkedService.
func (a AzureDataLakeAnalyticsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureDataLakeAnalytics"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeAnalyticsLinkedService.
func (a *AzureDataLakeAnalyticsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeAnalyticsLinkedServiceTypeProperties.
func (a AzureDataLakeAnalyticsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountName", &a.AccountName)
	populate(objectMap, "dataLakeAnalyticsUri", &a.DataLakeAnalyticsURI)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "resourceGroupName", &a.ResourceGroupName)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "subscriptionId", &a.SubscriptionID)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeAnalyticsLinkedServiceTypeProperties.
func (a *AzureDataLakeAnalyticsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountName":
			err = unpopulate(val, "AccountName", &a.AccountName)
			delete(rawMsg, key)
		case "dataLakeAnalyticsUri":
			err = unpopulate(val, "DataLakeAnalyticsURI", &a.DataLakeAnalyticsURI)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "resourceGroupName":
			err = unpopulate(val, "ResourceGroupName", &a.ResourceGroupName)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "subscriptionId":
			err = unpopulate(val, "SubscriptionID", &a.SubscriptionID)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreDataset.
func (a AzureDataLakeStoreDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureDataLakeStoreFile"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreDataset.
func (a *AzureDataLakeStoreDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreDatasetTypeProperties.
func (a AzureDataLakeStoreDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", a.Compression)
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	populate(objectMap, "format", a.Format)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreDatasetTypeProperties.
func (a *AzureDataLakeStoreDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &a.Compression)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "format":
			a.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreLinkedService.
func (a AzureDataLakeStoreLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureDataLakeStore"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreLinkedService.
func (a *AzureDataLakeStoreLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreLinkedServiceTypeProperties.
func (a AzureDataLakeStoreLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountName", &a.AccountName)
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "dataLakeStoreUri", &a.DataLakeStoreURI)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "resourceGroupName", &a.ResourceGroupName)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "subscriptionId", &a.SubscriptionID)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreLinkedServiceTypeProperties.
func (a *AzureDataLakeStoreLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountName":
			err = unpopulate(val, "AccountName", &a.AccountName)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "dataLakeStoreUri":
			err = unpopulate(val, "DataLakeStoreURI", &a.DataLakeStoreURI)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "resourceGroupName":
			err = unpopulate(val, "ResourceGroupName", &a.ResourceGroupName)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "subscriptionId":
			err = unpopulate(val, "SubscriptionID", &a.SubscriptionID)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreLocation.
func (a AzureDataLakeStoreLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AzureDataLakeStoreLocation"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreLocation.
func (a *AzureDataLakeStoreLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreReadSettings.
func (a AzureDataLakeStoreReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "listAfter", &a.ListAfter)
	populate(objectMap, "listBefore", &a.ListBefore)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AzureDataLakeStoreReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreReadSettings.
func (a *AzureDataLakeStoreReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "listAfter":
			err = unpopulate(val, "ListAfter", &a.ListAfter)
			delete(rawMsg, key)
		case "listBefore":
			err = unpopulate(val, "ListBefore", &a.ListBefore)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreSink.
func (a AzureDataLakeStoreSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enableAdlsSingleFileParallel", &a.EnableAdlsSingleFileParallel)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureDataLakeStoreSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreSink.
func (a *AzureDataLakeStoreSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enableAdlsSingleFileParallel":
			err = unpopulate(val, "EnableAdlsSingleFileParallel", &a.EnableAdlsSingleFileParallel)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreSource.
func (a AzureDataLakeStoreSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "recursive", &a.Recursive)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureDataLakeStoreSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreSource.
func (a *AzureDataLakeStoreSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDataLakeStoreWriteSettings.
func (a AzureDataLakeStoreWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "expiryDateTime", &a.ExpiryDateTime)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	objectMap["type"] = "AzureDataLakeStoreWriteSettings"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDataLakeStoreWriteSettings.
func (a *AzureDataLakeStoreWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "expiryDateTime":
			err = unpopulate(val, "ExpiryDateTime", &a.ExpiryDateTime)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeDataset.
func (a AzureDatabricksDeltaLakeDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureDatabricksDeltaLakeDataset"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeDataset.
func (a *AzureDatabricksDeltaLakeDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeDatasetTypeProperties.
func (a AzureDatabricksDeltaLakeDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "database", &a.Database)
	populate(objectMap, "table", &a.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeExportCommand.
func (a AzureDatabricksDeltaLakeExportCommand) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dateFormat", &a.DateFormat)
	populate(objectMap, "timestampFormat", &a.TimestampFormat)
	objectMap["type"] = "AzureDatabricksDeltaLakeExportCommand"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeExportCommand.
func (a *AzureDatabricksDeltaLakeExportCommand) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dateFormat":
			err = unpopulate(val, "DateFormat", &a.DateFormat)
			delete(rawMsg, key)
		case "timestampFormat":
			err = unpopulate(val, "TimestampFormat", &a.TimestampFormat)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeImportCommand.
func (a AzureDatabricksDeltaLakeImportCommand) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dateFormat", &a.DateFormat)
	populate(objectMap, "timestampFormat", &a.TimestampFormat)
	objectMap["type"] = "AzureDatabricksDeltaLakeImportCommand"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeImportCommand.
func (a *AzureDatabricksDeltaLakeImportCommand) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dateFormat":
			err = unpopulate(val, "DateFormat", &a.DateFormat)
			delete(rawMsg, key)
		case "timestampFormat":
			err = unpopulate(val, "TimestampFormat", &a.TimestampFormat)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeLinkedService.
func (a AzureDatabricksDeltaLakeLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureDatabricksDeltaLake"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeLinkedService.
func (a *AzureDatabricksDeltaLakeLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeSink.
func (a AzureDatabricksDeltaLakeSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "importSettings", a.ImportSettings)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &a.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureDatabricksDeltaLakeSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeSink.
func (a *AzureDatabricksDeltaLakeSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "importSettings":
			err = unpopulate(val, "ImportSettings", &a.ImportSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &a.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDeltaLakeSource.
func (a AzureDatabricksDeltaLakeSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "exportSettings", a.ExportSettings)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureDatabricksDeltaLakeSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDeltaLakeSource.
func (a *AzureDatabricksDeltaLakeSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "exportSettings":
			err = unpopulate(val, "ExportSettings", &a.ExportSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksDetltaLakeLinkedServiceTypeProperties.
func (a AzureDatabricksDetltaLakeLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", a.AccessToken)
	populate(objectMap, "clusterId", &a.ClusterID)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "domain", &a.Domain)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "workspaceResourceId", &a.WorkspaceResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksDetltaLakeLinkedServiceTypeProperties.
func (a *AzureDatabricksDetltaLakeLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			a.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "clusterId":
			err = unpopulate(val, "ClusterID", &a.ClusterID)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "domain":
			err = unpopulate(val, "Domain", &a.Domain)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "workspaceResourceId":
			err = unpopulate(val, "WorkspaceResourceID", &a.WorkspaceResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksLinkedService.
func (a AzureDatabricksLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureDatabricks"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksLinkedService.
func (a *AzureDatabricksLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureDatabricksLinkedServiceTypeProperties.
func (a AzureDatabricksLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", a.AccessToken)
	populate(objectMap, "authentication", &a.Authentication)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "domain", &a.Domain)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "existingClusterId", &a.ExistingClusterID)
	populate(objectMap, "instancePoolId", &a.InstancePoolID)
	populate(objectMap, "newClusterCustomTags", a.NewClusterCustomTags)
	populate(objectMap, "newClusterDriverNodeType", &a.NewClusterDriverNodeType)
	populate(objectMap, "newClusterEnableElasticDisk", &a.NewClusterEnableElasticDisk)
	populate(objectMap, "newClusterInitScripts", &a.NewClusterInitScripts)
	populate(objectMap, "newClusterLogDestination", &a.NewClusterLogDestination)
	populate(objectMap, "newClusterNodeType", &a.NewClusterNodeType)
	populate(objectMap, "newClusterNumOfWorker", &a.NewClusterNumOfWorker)
	populate(objectMap, "newClusterSparkConf", a.NewClusterSparkConf)
	populate(objectMap, "newClusterSparkEnvVars", a.NewClusterSparkEnvVars)
	populate(objectMap, "newClusterVersion", &a.NewClusterVersion)
	populate(objectMap, "policyId", &a.PolicyID)
	populate(objectMap, "workspaceResourceId", &a.WorkspaceResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDatabricksLinkedServiceTypeProperties.
func (a *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			a.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "authentication":
			err = unpopulate(val, "Authentication", &a.Authentication)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "domain":
			err = unpopulate(val, "Domain", &a.Domain)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "existingClusterId":
			err = unpopulate(val, "ExistingClusterID", &a.ExistingClusterID)
			delete(rawMsg, key)
		case "instancePoolId":
			err = unpopulate(val, "InstancePoolID", &a.InstancePoolID)
			delete(rawMsg, key)
		case "newClusterCustomTags":
			err = unpopulate(val, "NewClusterCustomTags", &a.NewClusterCustomTags)
			delete(rawMsg, key)
		case "newClusterDriverNodeType":
			err = unpopulate(val, "NewClusterDriverNodeType", &a.NewClusterDriverNodeType)
			delete(rawMsg, key)
		case "newClusterEnableElasticDisk":
			err = unpopulate(val, "NewClusterEnableElasticDisk", &a.NewClusterEnableElasticDisk)
			delete(rawMsg, key)
		case "newClusterInitScripts":
			err = unpopulate(val, "NewClusterInitScripts", &a.NewClusterInitScripts)
			delete(rawMsg, key)
		case "newClusterLogDestination":
			err = unpopulate(val, "NewClusterLogDestination", &a.NewClusterLogDestination)
			delete(rawMsg, key)
		case "newClusterNodeType":
			err = unpopulate(val, "NewClusterNodeType", &a.NewClusterNodeType)
			delete(rawMsg, key)
		case "newClusterNumOfWorker":
			err = unpopulate(val, "NewClusterNumOfWorker", &a.NewClusterNumOfWorker)
			delete(rawMsg, key)
		case "newClusterSparkConf":
			err = unpopulate(val, "NewClusterSparkConf", &a.NewClusterSparkConf)
			delete(rawMsg, key)
		case "newClusterSparkEnvVars":
			err = unpopulate(val, "NewClusterSparkEnvVars", &a.NewClusterSparkEnvVars)
			delete(rawMsg, key)
		case "newClusterVersion":
			err = unpopulate(val, "NewClusterVersion", &a.NewClusterVersion)
			delete(rawMsg, key)
		case "policyId":
			err = unpopulate(val, "PolicyID", &a.PolicyID)
			delete(rawMsg, key)
		case "workspaceResourceId":
			err = unpopulate(val, "WorkspaceResourceID", &a.WorkspaceResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFileStorageLinkedService.
func (a AzureFileStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureFileStorage"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileStorageLinkedService.
func (a *AzureFileStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFileStorageLinkedServiceTypeProperties.
func (a AzureFileStorageLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountKey", a.AccountKey)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "fileShare", &a.FileShare)
	populate(objectMap, "host", &a.Host)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "sasToken", a.SasToken)
	populate(objectMap, "sasUri", &a.SasURI)
	populate(objectMap, "snapshot", &a.Snapshot)
	populate(objectMap, "userId", &a.UserID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileStorageLinkedServiceTypeProperties.
func (a *AzureFileStorageLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountKey":
			err = unpopulate(val, "AccountKey", &a.AccountKey)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "fileShare":
			err = unpopulate(val, "FileShare", &a.FileShare)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &a.Host)
			delete(rawMsg, key)
		case "password":
			a.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "sasToken":
			err = unpopulate(val, "SasToken", &a.SasToken)
			delete(rawMsg, key)
		case "sasUri":
			err = unpopulate(val, "SasURI", &a.SasURI)
			delete(rawMsg, key)
		case "snapshot":
			err = unpopulate(val, "Snapshot", &a.Snapshot)
			delete(rawMsg, key)
		case "userId":
			err = unpopulate(val, "UserID", &a.UserID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFileStorageLocation.
func (a AzureFileStorageLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &a.FileName)
	populate(objectMap, "folderPath", &a.FolderPath)
	objectMap["type"] = "AzureFileStorageLocation"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileStorageLocation.
func (a *AzureFileStorageLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &a.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &a.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFileStorageReadSettings.
func (a AzureFileStorageReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", a.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &a.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &a.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &a.PartitionRootPath)
	populate(objectMap, "prefix", &a.Prefix)
	populate(objectMap, "recursive", &a.Recursive)
	objectMap["type"] = "AzureFileStorageReadSettings"
	populate(objectMap, "wildcardFileName", &a.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &a.WildcardFolderPath)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileStorageReadSettings.
func (a *AzureFileStorageReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &a.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &a.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &a.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &a.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &a.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &a.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &a.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &a.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &a.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &a.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFileStorageWriteSettings.
func (a AzureFileStorageWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &a.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	objectMap["type"] = "AzureFileStorageWriteSettings"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileStorageWriteSettings.
func (a *AzureFileStorageWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &a.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFunctionActivity.
func (a AzureFunctionActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "policy", a.Policy)
	objectMap["type"] = "AzureFunctionActivity"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionActivity.
func (a *AzureFunctionActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFunctionActivityTypeProperties.
func (a AzureFunctionActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "body", &a.Body)
	populate(objectMap, "functionName", &a.FunctionName)
	populate(objectMap, "headers", &a.Headers)
	populate(objectMap, "method", a.Method)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionActivityTypeProperties.
func (a *AzureFunctionActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "body":
			err = unpopulate(val, "Body", &a.Body)
			delete(rawMsg, key)
		case "functionName":
			err = unpopulate(val, "FunctionName", &a.FunctionName)
			delete(rawMsg, key)
		case "headers":
			err = unpopulate(val, "Headers", &a.Headers)
			delete(rawMsg, key)
		case "method":
			err = unpopulate(val, "Method", &a.Method)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFunctionLinkedService.
func (a AzureFunctionLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureFunction"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionLinkedService.
func (a *AzureFunctionLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureFunctionLinkedServiceTypeProperties.
func (a AzureFunctionLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authentication", &a.Authentication)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "functionAppUrl", &a.FunctionAppURL)
	populate(objectMap, "functionKey", a.FunctionKey)
	populate(objectMap, "resourceId", &a.ResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionLinkedServiceTypeProperties.
func (a *AzureFunctionLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authentication":
			err = unpopulate(val, "Authentication", &a.Authentication)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "functionAppUrl":
			err = unpopulate(val, "FunctionAppURL", &a.FunctionAppURL)
			delete(rawMsg, key)
		case "functionKey":
			a.FunctionKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "resourceId":
			err = unpopulate(val, "ResourceID", &a.ResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultLinkedService.
func (a AzureKeyVaultLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureKeyVault"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureKeyVaultLinkedService.
func (a *AzureKeyVaultLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultLinkedServiceTypeProperties.
func (a AzureKeyVaultLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "baseUrl", &a.BaseURL)
	populate(objectMap, "credential", a.Credential)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultSecretReference.
func (a AzureKeyVaultSecretReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "secretName", &a.SecretName)
	populate(objectMap, "secretVersion", &a.SecretVersion)
	populate(objectMap, "store", a.Store)
	objectMap["type"] = "AzureKeyVaultSecret"
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureKeyVaultSecretReference.
func (a *AzureKeyVaultSecretReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "secretName":
			err = unpopulate(val, "SecretName", &a.SecretName)
			delete(rawMsg, key)
		case "secretVersion":
			err = unpopulate(val, "SecretVersion", &a.SecretVersion)
			delete(rawMsg, key)
		case "store":
			err = unpopulate(val, "Store", &a.Store)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLBatchExecutionActivity.
func (a AzureMLBatchExecutionActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "policy", a.Policy)
	objectMap["type"] = "AzureMLBatchExecution"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLBatchExecutionActivity.
func (a *AzureMLBatchExecutionActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLBatchExecutionActivityTypeProperties.
func (a AzureMLBatchExecutionActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "globalParameters", a.GlobalParameters)
	populate(objectMap, "webServiceInputs", a.WebServiceInputs)
	populate(objectMap, "webServiceOutputs", a.WebServiceOutputs)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLBatchExecutionActivityTypeProperties.
func (a *AzureMLBatchExecutionActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "globalParameters":
			err = unpopulate(val, "GlobalParameters", &a.GlobalParameters)
			delete(rawMsg, key)
		case "webServiceInputs":
			err = unpopulate(val, "WebServiceInputs", &a.WebServiceInputs)
			delete(rawMsg, key)
		case "webServiceOutputs":
			err = unpopulate(val, "WebServiceOutputs", &a.WebServiceOutputs)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLExecutePipelineActivity.
func (a AzureMLExecutePipelineActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "policy", a.Policy)
	objectMap["type"] = "AzureMLExecutePipeline"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLExecutePipelineActivity.
func (a *AzureMLExecutePipelineActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLExecutePipelineActivityTypeProperties.
func (a AzureMLExecutePipelineActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "continueOnStepFailure", &a.ContinueOnStepFailure)
	populate(objectMap, "dataPathAssignments", &a.DataPathAssignments)
	populate(objectMap, "experimentName", &a.ExperimentName)
	populate(objectMap, "mlParentRunId", &a.MlParentRunID)
	populate(objectMap, "mlPipelineEndpointId", &a.MlPipelineEndpointID)
	populate(objectMap, "mlPipelineId", &a.MlPipelineID)
	populate(objectMap, "mlPipelineParameters", &a.MlPipelineParameters)
	populate(objectMap, "version", &a.Version)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLExecutePipelineActivityTypeProperties.
func (a *AzureMLExecutePipelineActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "continueOnStepFailure":
			err = unpopulate(val, "ContinueOnStepFailure", &a.ContinueOnStepFailure)
			delete(rawMsg, key)
		case "dataPathAssignments":
			err = unpopulate(val, "DataPathAssignments", &a.DataPathAssignments)
			delete(rawMsg, key)
		case "experimentName":
			err = unpopulate(val, "ExperimentName", &a.ExperimentName)
			delete(rawMsg, key)
		case "mlParentRunId":
			err = unpopulate(val, "MlParentRunID", &a.MlParentRunID)
			delete(rawMsg, key)
		case "mlPipelineEndpointId":
			err = unpopulate(val, "MlPipelineEndpointID", &a.MlPipelineEndpointID)
			delete(rawMsg, key)
		case "mlPipelineId":
			err = unpopulate(val, "MlPipelineID", &a.MlPipelineID)
			delete(rawMsg, key)
		case "mlPipelineParameters":
			err = unpopulate(val, "MlPipelineParameters", &a.MlPipelineParameters)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &a.Version)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLLinkedService.
func (a AzureMLLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureML"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLLinkedService.
func (a *AzureMLLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLLinkedServiceTypeProperties.
func (a AzureMLLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiKey", a.APIKey)
	populate(objectMap, "authentication", &a.Authentication)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "mlEndpoint", &a.MlEndpoint)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	populate(objectMap, "updateResourceEndpoint", &a.UpdateResourceEndpoint)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLLinkedServiceTypeProperties.
func (a *AzureMLLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiKey":
			a.APIKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "authentication":
			err = unpopulate(val, "Authentication", &a.Authentication)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "mlEndpoint":
			err = unpopulate(val, "MlEndpoint", &a.MlEndpoint)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		case "updateResourceEndpoint":
			err = unpopulate(val, "UpdateResourceEndpoint", &a.UpdateResourceEndpoint)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLServiceLinkedService.
func (a AzureMLServiceLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureMLService"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLServiceLinkedService.
func (a *AzureMLServiceLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLServiceLinkedServiceTypeProperties.
func (a AzureMLServiceLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "mlWorkspaceName", &a.MlWorkspaceName)
	populate(objectMap, "resourceGroupName", &a.ResourceGroupName)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "subscriptionId", &a.SubscriptionID)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLServiceLinkedServiceTypeProperties.
func (a *AzureMLServiceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "mlWorkspaceName":
			err = unpopulate(val, "MlWorkspaceName", &a.MlWorkspaceName)
			delete(rawMsg, key)
		case "resourceGroupName":
			err = unpopulate(val, "ResourceGroupName", &a.ResourceGroupName)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "subscriptionId":
			err = unpopulate(val, "SubscriptionID", &a.SubscriptionID)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLUpdateResourceActivity.
func (a AzureMLUpdateResourceActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", a.DependsOn)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "name", a.Name)
	populate(objectMap, "policy", a.Policy)
	objectMap["type"] = "AzureMLUpdateResource"
	populate(objectMap, "typeProperties", a.TypeProperties)
	populate(objectMap, "userProperties", a.UserProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLUpdateResourceActivity.
func (a *AzureMLUpdateResourceActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &a.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &a.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &a.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &a.UserProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLUpdateResourceActivityTypeProperties.
func (a AzureMLUpdateResourceActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "trainedModelFilePath", &a.TrainedModelFilePath)
	populate(objectMap, "trainedModelLinkedServiceName", a.TrainedModelLinkedServiceName)
	populate(objectMap, "trainedModelName", &a.TrainedModelName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMLUpdateResourceActivityTypeProperties.
func (a *AzureMLUpdateResourceActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "trainedModelFilePath":
			err = unpopulate(val, "TrainedModelFilePath", &a.TrainedModelFilePath)
			delete(rawMsg, key)
		case "trainedModelLinkedServiceName":
			err = unpopulate(val, "TrainedModelLinkedServiceName", &a.TrainedModelLinkedServiceName)
			delete(rawMsg, key)
		case "trainedModelName":
			err = unpopulate(val, "TrainedModelName", &a.TrainedModelName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMLWebServiceFile.
func (a AzureMLWebServiceFile) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "filePath", &a.FilePath)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureMariaDBLinkedService.
func (a AzureMariaDBLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureMariaDB"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMariaDBLinkedService.
func (a *AzureMariaDBLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMariaDBLinkedServiceTypeProperties.
func (a AzureMariaDBLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "pwd", a.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMariaDBLinkedServiceTypeProperties.
func (a *AzureMariaDBLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &a.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMariaDBSource.
func (a AzureMariaDBSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureMariaDBSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMariaDBSource.
func (a *AzureMariaDBSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMariaDBTableDataset.
func (a AzureMariaDBTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureMariaDBTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMariaDBTableDataset.
func (a *AzureMariaDBTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLLinkedService.
func (a AzureMySQLLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureMySql"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMySQLLinkedService.
func (a *AzureMySQLLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLLinkedServiceTypeProperties.
func (a AzureMySQLLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMySQLLinkedServiceTypeProperties.
func (a *AzureMySQLLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &a.Password)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLSink.
func (a AzureMySQLSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &a.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureMySqlSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMySQLSink.
func (a *AzureMySQLSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &a.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLSource.
func (a AzureMySQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureMySqlSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMySQLSource.
func (a *AzureMySQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLTableDataset.
func (a AzureMySQLTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureMySqlTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureMySQLTableDataset.
func (a *AzureMySQLTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureMySQLTableDatasetTypeProperties.
func (a AzureMySQLTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLLinkedService.
func (a AzurePostgreSQLLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzurePostgreSql"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLLinkedService.
func (a *AzurePostgreSQLLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLLinkedServiceTypeProperties.
func (a AzurePostgreSQLLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLLinkedServiceTypeProperties.
func (a *AzurePostgreSQLLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &a.Password)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLSink.
func (a AzurePostgreSQLSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &a.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzurePostgreSqlSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLSink.
func (a *AzurePostgreSQLSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &a.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLSource.
func (a AzurePostgreSQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "query", &a.Query)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzurePostgreSqlSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLSource.
func (a *AzurePostgreSQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &a.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLTableDataset.
func (a AzurePostgreSQLTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzurePostgreSqlTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLTableDataset.
func (a *AzurePostgreSQLTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzurePostgreSQLTableDatasetTypeProperties.
func (a AzurePostgreSQLTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzurePostgreSQLTableDatasetTypeProperties.
func (a *AzurePostgreSQLTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &a.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &a.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureQueueSink.
func (a AzureQueueSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureQueueSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureQueueSink.
func (a *AzureQueueSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDWLinkedService.
func (a AzureSQLDWLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureSqlDW"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDWLinkedService.
func (a *AzureSQLDWLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDWLinkedServiceTypeProperties.
func (a AzureSQLDWLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDWLinkedServiceTypeProperties.
func (a *AzureSQLDWLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &a.Password)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDWTableDataset.
func (a AzureSQLDWTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureSqlDWTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDWTableDataset.
func (a *AzureSQLDWTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDWTableDatasetTypeProperties.
func (a AzureSQLDWTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDWTableDatasetTypeProperties.
func (a *AzureSQLDWTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &a.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &a.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseLinkedService.
func (a AzureSQLDatabaseLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureSqlDatabase"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseLinkedService.
func (a *AzureSQLDatabaseLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLDatabaseLinkedServiceTypeProperties.
func (a AzureSQLDatabaseLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alwaysEncryptedSettings", a.AlwaysEncryptedSettings)
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLDatabaseLinkedServiceTypeProperties.
func (a *AzureSQLDatabaseLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alwaysEncryptedSettings":
			err = unpopulate(val, "AlwaysEncryptedSettings", &a.AlwaysEncryptedSettings)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &a.Password)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLMILinkedService.
func (a AzureSQLMILinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureSqlMI"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLMILinkedService.
func (a *AzureSQLMILinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLMILinkedServiceTypeProperties.
func (a AzureSQLMILinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alwaysEncryptedSettings", a.AlwaysEncryptedSettings)
	populate(objectMap, "azureCloudType", &a.AzureCloudType)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "credential", a.Credential)
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "password", a.Password)
	populate(objectMap, "servicePrincipalId", &a.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", a.ServicePrincipalKey)
	populate(objectMap, "tenant", &a.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLMILinkedServiceTypeProperties.
func (a *AzureSQLMILinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alwaysEncryptedSettings":
			err = unpopulate(val, "AlwaysEncryptedSettings", &a.AlwaysEncryptedSettings)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &a.AzureCloudType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &a.Credential)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &a.Password)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &a.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			a.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &a.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLMITableDataset.
func (a AzureSQLMITableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureSqlMITable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLMITableDataset.
func (a *AzureSQLMITableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLMITableDatasetTypeProperties.
func (a AzureSQLMITableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLMITableDatasetTypeProperties.
func (a *AzureSQLMITableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &a.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &a.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLSink.
func (a AzureSQLSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &a.PreCopyScript)
	populate(objectMap, "sqlWriterStoredProcedureName", &a.SQLWriterStoredProcedureName)
	populate(objectMap, "sqlWriterTableType", &a.SQLWriterTableType)
	populate(objectMap, "sqlWriterUseTableLock", &a.SQLWriterUseTableLock)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	populate(objectMap, "storedProcedureParameters", &a.StoredProcedureParameters)
	populate(objectMap, "storedProcedureTableTypeParameterName", &a.StoredProcedureTableTypeParameterName)
	populate(objectMap, "tableOption", &a.TableOption)
	objectMap["type"] = "AzureSqlSink"
	populate(objectMap, "upsertSettings", a.UpsertSettings)
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &a.WriteBehavior)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLSink.
func (a *AzureSQLSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &a.PreCopyScript)
			delete(rawMsg, key)
		case "sqlWriterStoredProcedureName":
			err = unpopulate(val, "SQLWriterStoredProcedureName", &a.SQLWriterStoredProcedureName)
			delete(rawMsg, key)
		case "sqlWriterTableType":
			err = unpopulate(val, "SQLWriterTableType", &a.SQLWriterTableType)
			delete(rawMsg, key)
		case "sqlWriterUseTableLock":
			err = unpopulate(val, "SQLWriterUseTableLock", &a.SQLWriterUseTableLock)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &a.StoredProcedureParameters)
			delete(rawMsg, key)
		case "storedProcedureTableTypeParameterName":
			err = unpopulate(val, "StoredProcedureTableTypeParameterName", &a.StoredProcedureTableTypeParameterName)
			delete(rawMsg, key)
		case "tableOption":
			err = unpopulate(val, "TableOption", &a.TableOption)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "upsertSettings":
			err = unpopulate(val, "UpsertSettings", &a.UpsertSettings)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &a.WriteBehavior)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLSource.
func (a AzureSQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &a.PartitionOption)
	populate(objectMap, "partitionSettings", a.PartitionSettings)
	populate(objectMap, "produceAdditionalTypes", &a.ProduceAdditionalTypes)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &a.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &a.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &a.StoredProcedureParameters)
	objectMap["type"] = "AzureSqlSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLSource.
func (a *AzureSQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &a.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &a.PartitionSettings)
			delete(rawMsg, key)
		case "produceAdditionalTypes":
			err = unpopulate(val, "ProduceAdditionalTypes", &a.ProduceAdditionalTypes)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &a.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &a.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &a.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLTableDataset.
func (a AzureSQLTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureSqlTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLTableDataset.
func (a *AzureSQLTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSQLTableDatasetTypeProperties.
func (a AzureSQLTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "table", &a.Table)
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSQLTableDatasetTypeProperties.
func (a *AzureSQLTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &a.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &a.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSearchIndexDataset.
func (a AzureSearchIndexDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureSearchIndex"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchIndexDataset.
func (a *AzureSearchIndexDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSearchIndexDatasetTypeProperties.
func (a AzureSearchIndexDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "indexName", &a.IndexName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureSearchIndexSink.
func (a AzureSearchIndexSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureSearchIndexSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", a.WriteBehavior)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchIndexSink.
func (a *AzureSearchIndexSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &a.WriteBehavior)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSearchLinkedService.
func (a AzureSearchLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureSearch"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchLinkedService.
func (a *AzureSearchLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSearchLinkedServiceTypeProperties.
func (a AzureSearchLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &a.EncryptedCredential)
	populate(objectMap, "key", a.Key)
	populate(objectMap, "url", &a.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSearchLinkedServiceTypeProperties.
func (a *AzureSearchLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "key":
			a.Key, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &a.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureStorageLinkedService.
func (a AzureStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureStorage"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageLinkedService.
func (a *AzureStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureStorageLinkedServiceTypeProperties.
func (a AzureStorageLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountKey", a.AccountKey)
	populate(objectMap, "connectionString", &a.ConnectionString)
	populate(objectMap, "encryptedCredential", a.EncryptedCredential)
	populate(objectMap, "sasToken", a.SasToken)
	populate(objectMap, "sasUri", &a.SasURI)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageLinkedServiceTypeProperties.
func (a *AzureStorageLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountKey":
			err = unpopulate(val, "AccountKey", &a.AccountKey)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &a.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &a.EncryptedCredential)
			delete(rawMsg, key)
		case "sasToken":
			err = unpopulate(val, "SasToken", &a.SasToken)
			delete(rawMsg, key)
		case "sasUri":
			err = unpopulate(val, "SasURI", &a.SasURI)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSynapseArtifactsLinkedService.
func (a AzureSynapseArtifactsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureSynapseArtifacts"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseArtifactsLinkedService.
func (a *AzureSynapseArtifactsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureSynapseArtifactsLinkedServiceTypeProperties.
func (a AzureSynapseArtifactsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authentication", &a.Authentication)
	populate(objectMap, "endpoint", &a.Endpoint)
	populate(objectMap, "workspaceResourceId", &a.WorkspaceResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureSynapseArtifactsLinkedServiceTypeProperties.
func (a *AzureSynapseArtifactsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authentication":
			err = unpopulate(val, "Authentication", &a.Authentication)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &a.Endpoint)
			delete(rawMsg, key)
		case "workspaceResourceId":
			err = unpopulate(val, "WorkspaceResourceID", &a.WorkspaceResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureTableDataset.
func (a AzureTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "folder", a.Folder)
	populate(objectMap, "linkedServiceName", a.LinkedServiceName)
	populate(objectMap, "parameters", a.Parameters)
	populate(objectMap, "schema", &a.Schema)
	populate(objectMap, "structure", &a.Structure)
	objectMap["type"] = "AzureTable"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableDataset.
func (a *AzureTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &a.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &a.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &a.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &a.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureTableDatasetTypeProperties.
func (a AzureTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &a.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type AzureTableSink.
func (a AzureTableSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "azureTableDefaultPartitionKeyValue", &a.AzureTableDefaultPartitionKeyValue)
	populate(objectMap, "azureTableInsertType", &a.AzureTableInsertType)
	populate(objectMap, "azureTablePartitionKeyName", &a.AzureTablePartitionKeyName)
	populate(objectMap, "azureTableRowKeyName", &a.AzureTableRowKeyName)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &a.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &a.SinkRetryWait)
	objectMap["type"] = "AzureTableSink"
	populate(objectMap, "writeBatchSize", &a.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &a.WriteBatchTimeout)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableSink.
func (a *AzureTableSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "azureTableDefaultPartitionKeyValue":
			err = unpopulate(val, "AzureTableDefaultPartitionKeyValue", &a.AzureTableDefaultPartitionKeyValue)
			delete(rawMsg, key)
		case "azureTableInsertType":
			err = unpopulate(val, "AzureTableInsertType", &a.AzureTableInsertType)
			delete(rawMsg, key)
		case "azureTablePartitionKeyName":
			err = unpopulate(val, "AzureTablePartitionKeyName", &a.AzureTablePartitionKeyName)
			delete(rawMsg, key)
		case "azureTableRowKeyName":
			err = unpopulate(val, "AzureTableRowKeyName", &a.AzureTableRowKeyName)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &a.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &a.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &a.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &a.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureTableSource.
func (a AzureTableSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &a.AdditionalColumns)
	populate(objectMap, "azureTableSourceIgnoreTableNotFound", &a.AzureTableSourceIgnoreTableNotFound)
	populate(objectMap, "azureTableSourceQuery", &a.AzureTableSourceQuery)
	populate(objectMap, "disableMetricsCollection", &a.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &a.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &a.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &a.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &a.SourceRetryWait)
	objectMap["type"] = "AzureTableSource"
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableSource.
func (a *AzureTableSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &a.AdditionalColumns)
			delete(rawMsg, key)
		case "azureTableSourceIgnoreTableNotFound":
			err = unpopulate(val, "AzureTableSourceIgnoreTableNotFound", &a.AzureTableSourceIgnoreTableNotFound)
			delete(rawMsg, key)
		case "azureTableSourceQuery":
			err = unpopulate(val, "AzureTableSourceQuery", &a.AzureTableSourceQuery)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &a.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &a.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &a.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &a.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &a.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type AzureTableStorageLinkedService.
func (a AzureTableStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", a.Annotations)
	populate(objectMap, "connectVia", a.ConnectVia)
	populate(objectMap, "description", a.Description)
	populate(objectMap, "parameters", a.Parameters)
	objectMap["type"] = "AzureTableStorage"
	populate(objectMap, "typeProperties", a.TypeProperties)
	if a.AdditionalProperties != nil {
		for key, val := range a.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTableStorageLinkedService.
func (a *AzureTableStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", a, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &a.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &a.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &a.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &a.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &a.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &a.TypeProperties)
			delete(rawMsg, key)
		default:
			if a.AdditionalProperties == nil {
				a.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				a.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", a, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BigDataPoolParametrizationReference.
func (b BigDataPoolParametrizationReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", &b.ReferenceName)
	populate(objectMap, "type", b.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type BinaryDataset.
func (b BinaryDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", b.Annotations)
	populate(objectMap, "description", b.Description)
	populate(objectMap, "folder", b.Folder)
	populate(objectMap, "linkedServiceName", b.LinkedServiceName)
	populate(objectMap, "parameters", b.Parameters)
	populate(objectMap, "schema", &b.Schema)
	populate(objectMap, "structure", &b.Structure)
	objectMap["type"] = "Binary"
	populate(objectMap, "typeProperties", b.TypeProperties)
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BinaryDataset.
func (b *BinaryDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &b.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &b.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &b.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &b.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &b.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &b.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &b.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &b.TypeProperties)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BinaryDatasetTypeProperties.
func (b BinaryDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", b.Compression)
	populate(objectMap, "location", b.Location)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BinaryDatasetTypeProperties.
func (b *BinaryDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &b.Compression)
			delete(rawMsg, key)
		case "location":
			b.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BinaryReadSettings.
func (b BinaryReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compressionProperties", b.CompressionProperties)
	objectMap["type"] = "BinaryReadSettings"
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BinaryReadSettings.
func (b *BinaryReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compressionProperties":
			b.CompressionProperties, err = unmarshalCompressionReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BinarySink.
func (b BinarySink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &b.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &b.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &b.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &b.SinkRetryWait)
	populate(objectMap, "storeSettings", b.StoreSettings)
	objectMap["type"] = "BinarySink"
	populate(objectMap, "writeBatchSize", &b.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &b.WriteBatchTimeout)
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BinarySink.
func (b *BinarySink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &b.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &b.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &b.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &b.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			b.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &b.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &b.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BinarySource.
func (b BinarySource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &b.DisableMetricsCollection)
	populate(objectMap, "formatSettings", b.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &b.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &b.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &b.SourceRetryWait)
	populate(objectMap, "storeSettings", b.StoreSettings)
	objectMap["type"] = "BinarySource"
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BinarySource.
func (b *BinarySource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &b.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &b.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &b.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &b.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &b.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			b.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobEventsTrigger.
func (b BlobEventsTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", b.Annotations)
	populate(objectMap, "description", b.Description)
	populate(objectMap, "pipelines", b.Pipelines)
	populate(objectMap, "runtimeState", b.RuntimeState)
	objectMap["type"] = "BlobEventsTrigger"
	populate(objectMap, "typeProperties", b.TypeProperties)
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobEventsTrigger.
func (b *BlobEventsTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &b.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &b.Description)
			delete(rawMsg, key)
		case "pipelines":
			err = unpopulate(val, "Pipelines", &b.Pipelines)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &b.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &b.TypeProperties)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobEventsTriggerTypeProperties.
func (b BlobEventsTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blobPathBeginsWith", b.BlobPathBeginsWith)
	populate(objectMap, "blobPathEndsWith", b.BlobPathEndsWith)
	populate(objectMap, "events", b.Events)
	populate(objectMap, "ignoreEmptyBlobs", b.IgnoreEmptyBlobs)
	populate(objectMap, "scope", b.Scope)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobEventsTriggerTypeProperties.
func (b *BlobEventsTriggerTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "blobPathBeginsWith":
			err = unpopulate(val, "BlobPathBeginsWith", &b.BlobPathBeginsWith)
			delete(rawMsg, key)
		case "blobPathEndsWith":
			err = unpopulate(val, "BlobPathEndsWith", &b.BlobPathEndsWith)
			delete(rawMsg, key)
		case "events":
			err = unpopulate(val, "Events", &b.Events)
			delete(rawMsg, key)
		case "ignoreEmptyBlobs":
			err = unpopulate(val, "IgnoreEmptyBlobs", &b.IgnoreEmptyBlobs)
			delete(rawMsg, key)
		case "scope":
			err = unpopulate(val, "Scope", &b.Scope)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobSink.
func (b BlobSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blobWriterAddHeader", &b.BlobWriterAddHeader)
	populate(objectMap, "blobWriterDateTimeFormat", &b.BlobWriterDateTimeFormat)
	populate(objectMap, "blobWriterOverwriteFiles", &b.BlobWriterOverwriteFiles)
	populate(objectMap, "copyBehavior", &b.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &b.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &b.MaxConcurrentConnections)
	populate(objectMap, "metadata", b.Metadata)
	populate(objectMap, "sinkRetryCount", &b.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &b.SinkRetryWait)
	objectMap["type"] = "BlobSink"
	populate(objectMap, "writeBatchSize", &b.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &b.WriteBatchTimeout)
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobSink.
func (b *BlobSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "blobWriterAddHeader":
			err = unpopulate(val, "BlobWriterAddHeader", &b.BlobWriterAddHeader)
			delete(rawMsg, key)
		case "blobWriterDateTimeFormat":
			err = unpopulate(val, "BlobWriterDateTimeFormat", &b.BlobWriterDateTimeFormat)
			delete(rawMsg, key)
		case "blobWriterOverwriteFiles":
			err = unpopulate(val, "BlobWriterOverwriteFiles", &b.BlobWriterOverwriteFiles)
			delete(rawMsg, key)
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &b.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &b.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &b.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "metadata":
			err = unpopulate(val, "Metadata", &b.Metadata)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &b.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &b.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &b.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &b.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobSource.
func (b BlobSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &b.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &b.MaxConcurrentConnections)
	populate(objectMap, "recursive", &b.Recursive)
	populate(objectMap, "skipHeaderLineCount", &b.SkipHeaderLineCount)
	populate(objectMap, "sourceRetryCount", &b.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &b.SourceRetryWait)
	populate(objectMap, "treatEmptyAsNull", &b.TreatEmptyAsNull)
	objectMap["type"] = "BlobSource"
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobSource.
func (b *BlobSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &b.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &b.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &b.Recursive)
			delete(rawMsg, key)
		case "skipHeaderLineCount":
			err = unpopulate(val, "SkipHeaderLineCount", &b.SkipHeaderLineCount)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &b.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &b.SourceRetryWait)
			delete(rawMsg, key)
		case "treatEmptyAsNull":
			err = unpopulate(val, "TreatEmptyAsNull", &b.TreatEmptyAsNull)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobTrigger.
func (b BlobTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", b.Annotations)
	populate(objectMap, "description", b.Description)
	populate(objectMap, "pipelines", b.Pipelines)
	populate(objectMap, "runtimeState", b.RuntimeState)
	objectMap["type"] = "BlobTrigger"
	populate(objectMap, "typeProperties", b.TypeProperties)
	if b.AdditionalProperties != nil {
		for key, val := range b.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobTrigger.
func (b *BlobTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &b.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &b.Description)
			delete(rawMsg, key)
		case "pipelines":
			err = unpopulate(val, "Pipelines", &b.Pipelines)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &b.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &b.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &b.TypeProperties)
			delete(rawMsg, key)
		default:
			if b.AdditionalProperties == nil {
				b.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				b.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type BlobTriggerTypeProperties.
func (b BlobTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "folderPath", b.FolderPath)
	populate(objectMap, "linkedService", b.LinkedService)
	populate(objectMap, "maxConcurrency", b.MaxConcurrency)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type BlobTriggerTypeProperties.
func (b *BlobTriggerTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", b, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "folderPath":
			err = unpopulate(val, "FolderPath", &b.FolderPath)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &b.LinkedService)
			delete(rawMsg, key)
		case "maxConcurrency":
			err = unpopulate(val, "MaxConcurrency", &b.MaxConcurrency)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", b, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type CassandraLinkedService.
func (c CassandraLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "Cassandra"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraLinkedService.
func (c *CassandraLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CassandraLinkedServiceTypeProperties.
func (c CassandraLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &c.AuthenticationType)
	populate(objectMap, "encryptedCredential", &c.EncryptedCredential)
	populate(objectMap, "host", &c.Host)
	populate(objectMap, "password", c.Password)
	populate(objectMap, "port", &c.Port)
	populate(objectMap, "username", &c.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraLinkedServiceTypeProperties.
func (c *CassandraLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &c.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &c.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &c.Host)
			delete(rawMsg, key)
		case "password":
			c.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &c.Port)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &c.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CassandraSource.
func (c CassandraSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "consistencyLevel", c.ConsistencyLevel)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "query", &c.Query)
	populate(objectMap, "queryTimeout", &c.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "CassandraSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraSource.
func (c *CassandraSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "consistencyLevel":
			err = unpopulate(val, "ConsistencyLevel", &c.ConsistencyLevel)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &c.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &c.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CassandraTableDataset.
func (c CassandraTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CassandraTable"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraTableDataset.
func (c *CassandraTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CassandraTableDatasetTypeProperties.
func (c CassandraTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "keyspace", &c.Keyspace)
	populate(objectMap, "tableName", &c.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ChainingTrigger.
func (c ChainingTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "pipeline", c.Pipeline)
	populate(objectMap, "runtimeState", c.RuntimeState)
	objectMap["type"] = "ChainingTrigger"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ChainingTrigger.
func (c *ChainingTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "pipeline":
			err = unpopulate(val, "Pipeline", &c.Pipeline)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &c.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ChainingTriggerTypeProperties.
func (c ChainingTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", c.DependsOn)
	populate(objectMap, "runDimension", c.RunDimension)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type CmdkeySetupTypeProperties.
func (c CmdkeySetupTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "password", c.Password)
	populate(objectMap, "targetName", &c.TargetName)
	populate(objectMap, "userName", &c.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CmdkeySetupTypeProperties.
func (c *CmdkeySetupTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "password":
			c.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "targetName":
			err = unpopulate(val, "TargetName", &c.TargetName)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &c.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsEntityDataset.
func (c CommonDataServiceForAppsEntityDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CommonDataServiceForAppsEntity"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDataServiceForAppsEntityDataset.
func (c *CommonDataServiceForAppsEntityDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsEntityDatasetTypeProperties.
func (c CommonDataServiceForAppsEntityDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "entityName", &c.EntityName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsLinkedService.
func (c CommonDataServiceForAppsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "CommonDataServiceForApps"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDataServiceForAppsLinkedService.
func (c *CommonDataServiceForAppsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsLinkedServiceTypeProperties.
func (c CommonDataServiceForAppsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &c.AuthenticationType)
	populate(objectMap, "deploymentType", &c.DeploymentType)
	populate(objectMap, "encryptedCredential", &c.EncryptedCredential)
	populate(objectMap, "hostName", &c.HostName)
	populate(objectMap, "organizationName", &c.OrganizationName)
	populate(objectMap, "password", c.Password)
	populate(objectMap, "port", &c.Port)
	populate(objectMap, "servicePrincipalCredential", c.ServicePrincipalCredential)
	populate(objectMap, "servicePrincipalCredentialType", &c.ServicePrincipalCredentialType)
	populate(objectMap, "servicePrincipalId", &c.ServicePrincipalID)
	populate(objectMap, "serviceUri", &c.ServiceURI)
	populate(objectMap, "username", &c.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDataServiceForAppsLinkedServiceTypeProperties.
func (c *CommonDataServiceForAppsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &c.AuthenticationType)
			delete(rawMsg, key)
		case "deploymentType":
			err = unpopulate(val, "DeploymentType", &c.DeploymentType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &c.EncryptedCredential)
			delete(rawMsg, key)
		case "hostName":
			err = unpopulate(val, "HostName", &c.HostName)
			delete(rawMsg, key)
		case "organizationName":
			err = unpopulate(val, "OrganizationName", &c.OrganizationName)
			delete(rawMsg, key)
		case "password":
			c.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &c.Port)
			delete(rawMsg, key)
		case "servicePrincipalCredential":
			c.ServicePrincipalCredential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalCredentialType":
			err = unpopulate(val, "ServicePrincipalCredentialType", &c.ServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &c.ServicePrincipalID)
			delete(rawMsg, key)
		case "serviceUri":
			err = unpopulate(val, "ServiceURI", &c.ServiceURI)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &c.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsSink.
func (c CommonDataServiceForAppsSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alternateKeyName", &c.AlternateKeyName)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "ignoreNullValues", &c.IgnoreNullValues)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &c.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &c.SinkRetryWait)
	objectMap["type"] = "CommonDataServiceForAppsSink"
	populate(objectMap, "writeBatchSize", &c.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &c.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", c.WriteBehavior)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDataServiceForAppsSink.
func (c *CommonDataServiceForAppsSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alternateKeyName":
			err = unpopulate(val, "AlternateKeyName", &c.AlternateKeyName)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "ignoreNullValues":
			err = unpopulate(val, "IgnoreNullValues", &c.IgnoreNullValues)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &c.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &c.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &c.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &c.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &c.WriteBehavior)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CommonDataServiceForAppsSource.
func (c CommonDataServiceForAppsSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "query", &c.Query)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "CommonDataServiceForAppsSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CommonDataServiceForAppsSource.
func (c *CommonDataServiceForAppsSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &c.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type CompressionReadSettings.
func (c CompressionReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["type"] = c.Type
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ConcurLinkedService.
func (c ConcurLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "Concur"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ConcurLinkedService.
func (c *ConcurLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ConcurLinkedServiceTypeProperties.
func (c ConcurLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &c.ClientID)
	populate(objectMap, "connectionProperties", &c.ConnectionProperties)
	populate(objectMap, "encryptedCredential", &c.EncryptedCredential)
	populate(objectMap, "password", c.Password)
	populate(objectMap, "useEncryptedEndpoints", &c.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &c.UseHostVerification)
	populate(objectMap, "usePeerVerification", &c.UsePeerVerification)
	populate(objectMap, "username", &c.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ConcurLinkedServiceTypeProperties.
func (c *ConcurLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &c.ClientID)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &c.ConnectionProperties)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &c.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			c.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &c.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &c.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &c.UsePeerVerification)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &c.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ConcurObjectDataset.
func (c ConcurObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "ConcurObject"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ConcurObjectDataset.
func (c *ConcurObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ConcurSource.
func (c ConcurSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "query", &c.Query)
	populate(objectMap, "queryTimeout", &c.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "ConcurSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ConcurSource.
func (c *ConcurSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &c.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &c.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ConnectionStateProperties.
func (c ConnectionStateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "actionsRequired", c.ActionsRequired)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "status", c.Status)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ControlActivity.
func (c ControlActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", c.DependsOn)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "name", c.Name)
	objectMap["type"] = "Container"
	populate(objectMap, "userProperties", c.UserProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ControlActivity.
func (c *ControlActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &c.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &c.UserProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CopyActivity.
func (c CopyActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", c.DependsOn)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "inputs", c.Inputs)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "outputs", c.Outputs)
	populate(objectMap, "policy", c.Policy)
	objectMap["type"] = "Copy"
	populate(objectMap, "typeProperties", c.TypeProperties)
	populate(objectMap, "userProperties", c.UserProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CopyActivity.
func (c *CopyActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &c.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "inputs":
			err = unpopulate(val, "Inputs", &c.Inputs)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "outputs":
			err = unpopulate(val, "Outputs", &c.Outputs)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &c.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &c.UserProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CopyActivityLogSettings.
func (c CopyActivityLogSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "enableReliableLogging", &c.EnableReliableLogging)
	populate(objectMap, "logLevel", &c.LogLevel)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CopyActivityTypeProperties.
func (c CopyActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataIntegrationUnits", &c.DataIntegrationUnits)
	populate(objectMap, "enableSkipIncompatibleRow", &c.EnableSkipIncompatibleRow)
	populate(objectMap, "enableStaging", &c.EnableStaging)
	populate(objectMap, "logSettings", c.LogSettings)
	populate(objectMap, "logStorageSettings", c.LogStorageSettings)
	populate(objectMap, "parallelCopies", &c.ParallelCopies)
	populate(objectMap, "preserve", c.Preserve)
	populate(objectMap, "preserveRules", c.PreserveRules)
	populate(objectMap, "redirectIncompatibleRowSettings", c.RedirectIncompatibleRowSettings)
	populate(objectMap, "sink", c.Sink)
	populate(objectMap, "skipErrorFile", c.SkipErrorFile)
	populate(objectMap, "source", c.Source)
	populate(objectMap, "stagingSettings", c.StagingSettings)
	populate(objectMap, "translator", &c.Translator)
	populate(objectMap, "validateDataConsistency", &c.ValidateDataConsistency)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CopyActivityTypeProperties.
func (c *CopyActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataIntegrationUnits":
			err = unpopulate(val, "DataIntegrationUnits", &c.DataIntegrationUnits)
			delete(rawMsg, key)
		case "enableSkipIncompatibleRow":
			err = unpopulate(val, "EnableSkipIncompatibleRow", &c.EnableSkipIncompatibleRow)
			delete(rawMsg, key)
		case "enableStaging":
			err = unpopulate(val, "EnableStaging", &c.EnableStaging)
			delete(rawMsg, key)
		case "logSettings":
			err = unpopulate(val, "LogSettings", &c.LogSettings)
			delete(rawMsg, key)
		case "logStorageSettings":
			err = unpopulate(val, "LogStorageSettings", &c.LogStorageSettings)
			delete(rawMsg, key)
		case "parallelCopies":
			err = unpopulate(val, "ParallelCopies", &c.ParallelCopies)
			delete(rawMsg, key)
		case "preserve":
			err = unpopulate(val, "Preserve", &c.Preserve)
			delete(rawMsg, key)
		case "preserveRules":
			err = unpopulate(val, "PreserveRules", &c.PreserveRules)
			delete(rawMsg, key)
		case "redirectIncompatibleRowSettings":
			err = unpopulate(val, "RedirectIncompatibleRowSettings", &c.RedirectIncompatibleRowSettings)
			delete(rawMsg, key)
		case "sink":
			c.Sink, err = unmarshalCopySinkClassification(val)
			delete(rawMsg, key)
		case "skipErrorFile":
			err = unpopulate(val, "SkipErrorFile", &c.SkipErrorFile)
			delete(rawMsg, key)
		case "source":
			c.Source, err = unmarshalCopySourceClassification(val)
			delete(rawMsg, key)
		case "stagingSettings":
			err = unpopulate(val, "StagingSettings", &c.StagingSettings)
			delete(rawMsg, key)
		case "translator":
			err = unpopulate(val, "Translator", &c.Translator)
			delete(rawMsg, key)
		case "validateDataConsistency":
			err = unpopulate(val, "ValidateDataConsistency", &c.ValidateDataConsistency)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CopySink.
func (c CopySink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &c.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &c.SinkRetryWait)
	objectMap["type"] = c.Type
	populate(objectMap, "writeBatchSize", &c.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &c.WriteBatchTimeout)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CopySink.
func (c *CopySink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &c.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &c.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &c.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &c.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CopySource.
func (c CopySource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = c.Type
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CopySource.
func (c *CopySource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbLinkedService.
func (c CosmosDbLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "CosmosDb"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbLinkedService.
func (c *CosmosDbLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbLinkedServiceTypeProperties.
func (c CosmosDbLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountEndpoint", &c.AccountEndpoint)
	populate(objectMap, "accountKey", c.AccountKey)
	populate(objectMap, "azureCloudType", &c.AzureCloudType)
	populate(objectMap, "connectionMode", c.ConnectionMode)
	populate(objectMap, "connectionString", &c.ConnectionString)
	populate(objectMap, "credential", c.Credential)
	populate(objectMap, "database", &c.Database)
	populate(objectMap, "encryptedCredential", &c.EncryptedCredential)
	populate(objectMap, "servicePrincipalCredential", c.ServicePrincipalCredential)
	populate(objectMap, "servicePrincipalCredentialType", c.ServicePrincipalCredentialType)
	populate(objectMap, "servicePrincipalId", &c.ServicePrincipalID)
	populate(objectMap, "tenant", &c.Tenant)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbLinkedServiceTypeProperties.
func (c *CosmosDbLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountEndpoint":
			err = unpopulate(val, "AccountEndpoint", &c.AccountEndpoint)
			delete(rawMsg, key)
		case "accountKey":
			c.AccountKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &c.AzureCloudType)
			delete(rawMsg, key)
		case "connectionMode":
			err = unpopulate(val, "ConnectionMode", &c.ConnectionMode)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &c.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &c.Credential)
			delete(rawMsg, key)
		case "database":
			err = unpopulate(val, "Database", &c.Database)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &c.EncryptedCredential)
			delete(rawMsg, key)
		case "servicePrincipalCredential":
			c.ServicePrincipalCredential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalCredentialType":
			err = unpopulate(val, "ServicePrincipalCredentialType", &c.ServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &c.ServicePrincipalID)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &c.Tenant)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPICollectionDataset.
func (c CosmosDbMongoDbAPICollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CosmosDbMongoDbApiCollection"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbMongoDbAPICollectionDataset.
func (c *CosmosDbMongoDbAPICollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPICollectionDatasetTypeProperties.
func (c CosmosDbMongoDbAPICollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collection", &c.Collection)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPILinkedService.
func (c CosmosDbMongoDbAPILinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "CosmosDbMongoDbApi"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbMongoDbAPILinkedService.
func (c *CosmosDbMongoDbAPILinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPILinkedServiceTypeProperties.
func (c CosmosDbMongoDbAPILinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &c.ConnectionString)
	populate(objectMap, "database", &c.Database)
	populate(objectMap, "isServerVersionAbove32", &c.IsServerVersionAbove32)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbMongoDbAPILinkedServiceTypeProperties.
func (c *CosmosDbMongoDbAPILinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &c.ConnectionString)
			delete(rawMsg, key)
		case "database":
			err = unpopulate(val, "Database", &c.Database)
			delete(rawMsg, key)
		case "isServerVersionAbove32":
			err = unpopulate(val, "IsServerVersionAbove32", &c.IsServerVersionAbove32)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPISink.
func (c CosmosDbMongoDbAPISink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &c.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &c.SinkRetryWait)
	objectMap["type"] = "CosmosDbMongoDbApiSink"
	populate(objectMap, "writeBatchSize", &c.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &c.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &c.WriteBehavior)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbMongoDbAPISink.
func (c *CosmosDbMongoDbAPISink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &c.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &c.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &c.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &c.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &c.WriteBehavior)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbMongoDbAPISource.
func (c CosmosDbMongoDbAPISource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "batchSize", &c.BatchSize)
	populate(objectMap, "cursorMethods", c.CursorMethods)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "filter", &c.Filter)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &c.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "CosmosDbMongoDbApiSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbMongoDbAPISource.
func (c *CosmosDbMongoDbAPISource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "batchSize":
			err = unpopulate(val, "BatchSize", &c.BatchSize)
			delete(rawMsg, key)
		case "cursorMethods":
			err = unpopulate(val, "CursorMethods", &c.CursorMethods)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "filter":
			err = unpopulate(val, "Filter", &c.Filter)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &c.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbSQLAPICollectionDataset.
func (c CosmosDbSQLAPICollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CosmosDbSqlApiCollection"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbSQLAPICollectionDataset.
func (c *CosmosDbSQLAPICollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbSQLAPICollectionDatasetTypeProperties.
func (c CosmosDbSQLAPICollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collectionName", &c.CollectionName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CosmosDbSQLAPISink.
func (c CosmosDbSQLAPISink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &c.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &c.SinkRetryWait)
	objectMap["type"] = "CosmosDbSqlApiSink"
	populate(objectMap, "writeBatchSize", &c.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &c.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &c.WriteBehavior)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbSQLAPISink.
func (c *CosmosDbSQLAPISink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &c.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &c.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &c.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &c.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &c.WriteBehavior)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CosmosDbSQLAPISource.
func (c CosmosDbSQLAPISource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "detectDatetime", &c.DetectDatetime)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "pageSize", &c.PageSize)
	populate(objectMap, "preferredRegions", &c.PreferredRegions)
	populate(objectMap, "query", &c.Query)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "CosmosDbSqlApiSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CosmosDbSQLAPISource.
func (c *CosmosDbSQLAPISource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "detectDatetime":
			err = unpopulate(val, "DetectDatetime", &c.DetectDatetime)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "pageSize":
			err = unpopulate(val, "PageSize", &c.PageSize)
			delete(rawMsg, key)
		case "preferredRegions":
			err = unpopulate(val, "PreferredRegions", &c.PreferredRegions)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &c.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CouchbaseLinkedService.
func (c CouchbaseLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "Couchbase"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CouchbaseLinkedService.
func (c *CouchbaseLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CouchbaseLinkedServiceTypeProperties.
func (c CouchbaseLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &c.ConnectionString)
	populate(objectMap, "credString", c.CredString)
	populate(objectMap, "encryptedCredential", &c.EncryptedCredential)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CouchbaseLinkedServiceTypeProperties.
func (c *CouchbaseLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &c.ConnectionString)
			delete(rawMsg, key)
		case "credString":
			err = unpopulate(val, "CredString", &c.CredString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &c.EncryptedCredential)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CouchbaseSource.
func (c CouchbaseSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &c.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &c.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &c.MaxConcurrentConnections)
	populate(objectMap, "query", &c.Query)
	populate(objectMap, "queryTimeout", &c.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &c.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &c.SourceRetryWait)
	objectMap["type"] = "CouchbaseSource"
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CouchbaseSource.
func (c *CouchbaseSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &c.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &c.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &c.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &c.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &c.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &c.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &c.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CouchbaseTableDataset.
func (c CouchbaseTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CouchbaseTable"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CouchbaseTableDataset.
func (c *CouchbaseTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CreateDataFlowDebugSessionRequest.
func (c CreateDataFlowDebugSessionRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "computeType", c.ComputeType)
	populate(objectMap, "coreCount", c.CoreCount)
	populate(objectMap, "integrationRuntime", c.IntegrationRuntime)
	populate(objectMap, "timeToLive", c.TimeToLive)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CreateDataFlowDebugSessionRequest.
func (c *CreateDataFlowDebugSessionRequest) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "computeType":
			err = unpopulate(val, "ComputeType", &c.ComputeType)
			delete(rawMsg, key)
		case "coreCount":
			err = unpopulate(val, "CoreCount", &c.CoreCount)
			delete(rawMsg, key)
		case "integrationRuntime":
			err = unpopulate(val, "IntegrationRuntime", &c.IntegrationRuntime)
			delete(rawMsg, key)
		case "timeToLive":
			err = unpopulate(val, "TimeToLive", &c.TimeToLive)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CreateDataFlowDebugSessionResponse.
func (c CreateDataFlowDebugSessionResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "sessionId", c.SessionID)
	populate(objectMap, "status", c.Status)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CreateLinkedIntegrationRuntimeRequest.
func (c CreateLinkedIntegrationRuntimeRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFactoryLocation", c.DataFactoryLocation)
	populate(objectMap, "dataFactoryName", c.DataFactoryName)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "subscriptionId", c.SubscriptionID)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type CredentialReference.
func (c CredentialReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", c.ReferenceName)
	populate(objectMap, "type", c.Type)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialReference.
func (c *CredentialReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "referenceName":
			err = unpopulate(val, "ReferenceName", &c.ReferenceName)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomActivity.
func (c CustomActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", c.DependsOn)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "name", c.Name)
	populate(objectMap, "policy", c.Policy)
	objectMap["type"] = "Custom"
	populate(objectMap, "typeProperties", c.TypeProperties)
	populate(objectMap, "userProperties", c.UserProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomActivity.
func (c *CustomActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &c.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &c.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &c.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &c.UserProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomActivityReferenceObject.
func (c CustomActivityReferenceObject) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "datasets", c.Datasets)
	populate(objectMap, "linkedServices", c.LinkedServices)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type CustomActivityTypeProperties.
func (c CustomActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "autoUserSpecification", &c.AutoUserSpecification)
	populate(objectMap, "command", &c.Command)
	populate(objectMap, "extendedProperties", c.ExtendedProperties)
	populate(objectMap, "folderPath", &c.FolderPath)
	populate(objectMap, "referenceObjects", c.ReferenceObjects)
	populate(objectMap, "resourceLinkedService", c.ResourceLinkedService)
	populate(objectMap, "retentionTimeInDays", &c.RetentionTimeInDays)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomActivityTypeProperties.
func (c *CustomActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "autoUserSpecification":
			err = unpopulate(val, "AutoUserSpecification", &c.AutoUserSpecification)
			delete(rawMsg, key)
		case "command":
			err = unpopulate(val, "Command", &c.Command)
			delete(rawMsg, key)
		case "extendedProperties":
			err = unpopulate(val, "ExtendedProperties", &c.ExtendedProperties)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &c.FolderPath)
			delete(rawMsg, key)
		case "referenceObjects":
			err = unpopulate(val, "ReferenceObjects", &c.ReferenceObjects)
			delete(rawMsg, key)
		case "resourceLinkedService":
			err = unpopulate(val, "ResourceLinkedService", &c.ResourceLinkedService)
			delete(rawMsg, key)
		case "retentionTimeInDays":
			err = unpopulate(val, "RetentionTimeInDays", &c.RetentionTimeInDays)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomDataSourceLinkedService.
func (c CustomDataSourceLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "connectVia", c.ConnectVia)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "parameters", c.Parameters)
	objectMap["type"] = "CustomDataSource"
	populate(objectMap, "typeProperties", &c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDataSourceLinkedService.
func (c *CustomDataSourceLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &c.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomDataset.
func (c CustomDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "folder", c.Folder)
	populate(objectMap, "linkedServiceName", c.LinkedServiceName)
	populate(objectMap, "parameters", c.Parameters)
	populate(objectMap, "schema", &c.Schema)
	populate(objectMap, "structure", &c.Structure)
	objectMap["type"] = "CustomDataset"
	populate(objectMap, "typeProperties", &c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDataset.
func (c *CustomDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &c.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &c.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &c.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &c.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &c.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomEventsTrigger.
func (c CustomEventsTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", c.Annotations)
	populate(objectMap, "description", c.Description)
	populate(objectMap, "pipelines", c.Pipelines)
	populate(objectMap, "runtimeState", c.RuntimeState)
	objectMap["type"] = "CustomEventsTrigger"
	populate(objectMap, "typeProperties", c.TypeProperties)
	if c.AdditionalProperties != nil {
		for key, val := range c.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEventsTrigger.
func (c *CustomEventsTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &c.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &c.Description)
			delete(rawMsg, key)
		case "pipelines":
			err = unpopulate(val, "Pipelines", &c.Pipelines)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &c.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &c.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &c.TypeProperties)
			delete(rawMsg, key)
		default:
			if c.AdditionalProperties == nil {
				c.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				c.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type CustomEventsTriggerTypeProperties.
func (c CustomEventsTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "events", c.Events)
	populate(objectMap, "scope", c.Scope)
	populate(objectMap, "subjectBeginsWith", c.SubjectBeginsWith)
	populate(objectMap, "subjectEndsWith", c.SubjectEndsWith)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEventsTriggerTypeProperties.
func (c *CustomEventsTriggerTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", c, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "events":
			err = unpopulate(val, "Events", &c.Events)
			delete(rawMsg, key)
		case "scope":
			err = unpopulate(val, "Scope", &c.Scope)
			delete(rawMsg, key)
		case "subjectBeginsWith":
			err = unpopulate(val, "SubjectBeginsWith", &c.SubjectBeginsWith)
			delete(rawMsg, key)
		case "subjectEndsWith":
			err = unpopulate(val, "SubjectEndsWith", &c.SubjectEndsWith)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", c, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type DWCopyCommandDefaultValue.
func (d DWCopyCommandDefaultValue) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "columnName", &d.ColumnName)
	populate(objectMap, "defaultValue", &d.DefaultValue)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DWCopyCommandSettings.
func (d DWCopyCommandSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalOptions", d.AdditionalOptions)
	populate(objectMap, "defaultValues", d.DefaultValues)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DataFlow.
func (d DataFlow) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	objectMap["type"] = d.Type
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugCommandPayload.
func (d DataFlowDebugCommandPayload) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "columns", d.Columns)
	populate(objectMap, "expression", d.Expression)
	populate(objectMap, "rowLimits", d.RowLimits)
	populate(objectMap, "streamName", d.StreamName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowDebugCommandPayload.
func (d *DataFlowDebugCommandPayload) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "columns":
			err = unpopulate(val, "Columns", &d.Columns)
			delete(rawMsg, key)
		case "expression":
			err = unpopulate(val, "Expression", &d.Expression)
			delete(rawMsg, key)
		case "rowLimits":
			err = unpopulate(val, "RowLimits", &d.RowLimits)
			delete(rawMsg, key)
		case "streamName":
			err = unpopulate(val, "StreamName", &d.StreamName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugCommandRequest.
func (d DataFlowDebugCommandRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "command", d.Command)
	populate(objectMap, "commandPayload", d.CommandPayload)
	populate(objectMap, "sessionId", d.SessionID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowDebugCommandRequest.
func (d *DataFlowDebugCommandRequest) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "command":
			err = unpopulate(val, "Command", &d.Command)
			delete(rawMsg, key)
		case "commandPayload":
			err = unpopulate(val, "CommandPayload", &d.CommandPayload)
			delete(rawMsg, key)
		case "sessionId":
			err = unpopulate(val, "SessionID", &d.SessionID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugCommandResponse.
func (d DataFlowDebugCommandResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "data", d.Data)
	populate(objectMap, "status", d.Status)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugPackage.
func (d DataFlowDebugPackage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFlow", d.DataFlow)
	populate(objectMap, "dataFlows", d.DataFlows)
	populate(objectMap, "datasets", d.Datasets)
	populate(objectMap, "debugSettings", d.DebugSettings)
	populate(objectMap, "linkedServices", d.LinkedServices)
	populate(objectMap, "sessionId", d.SessionID)
	populate(objectMap, "staging", d.Staging)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowDebugPackage.
func (d *DataFlowDebugPackage) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataFlow":
			err = unpopulate(val, "DataFlow", &d.DataFlow)
			delete(rawMsg, key)
		case "dataFlows":
			err = unpopulate(val, "DataFlows", &d.DataFlows)
			delete(rawMsg, key)
		case "datasets":
			err = unpopulate(val, "Datasets", &d.Datasets)
			delete(rawMsg, key)
		case "debugSettings":
			err = unpopulate(val, "DebugSettings", &d.DebugSettings)
			delete(rawMsg, key)
		case "linkedServices":
			err = unpopulate(val, "LinkedServices", &d.LinkedServices)
			delete(rawMsg, key)
		case "sessionId":
			err = unpopulate(val, "SessionID", &d.SessionID)
			delete(rawMsg, key)
		case "staging":
			err = unpopulate(val, "Staging", &d.Staging)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugPackageDebugSettings.
func (d DataFlowDebugPackageDebugSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "datasetParameters", &d.DatasetParameters)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "sourceSettings", d.SourceSettings)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type DataFlowDebugSessionInfo.
func (d DataFlowDebugSessionInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "computeType", d.ComputeType)
	populate(objectMap, "coreCount", d.CoreCount)
	populate(objectMap, "dataFlowName", d.DataFlowName)
	populate(objectMap, "integrationRuntimeName", d.IntegrationRuntimeName)
	populate(objectMap, "lastActivityTime", d.LastActivityTime)
	populate(objectMap, "nodeCount", d.NodeCount)
	populate(objectMap, "sessionId", d.SessionID)
	populate(objectMap, "startTime", d.StartTime)
	populate(objectMap, "timeToLiveInMinutes", d.TimeToLiveInMinutes)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowDebugSessionInfo.
func (d *DataFlowDebugSessionInfo) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "computeType":
			err = unpopulate(val, "ComputeType", &d.ComputeType)
			delete(rawMsg, key)
		case "coreCount":
			err = unpopulate(val, "CoreCount", &d.CoreCount)
			delete(rawMsg, key)
		case "dataFlowName":
			err = unpopulate(val, "DataFlowName", &d.DataFlowName)
			delete(rawMsg, key)
		case "integrationRuntimeName":
			err = unpopulate(val, "IntegrationRuntimeName", &d.IntegrationRuntimeName)
			delete(rawMsg, key)
		case "lastActivityTime":
			err = unpopulate(val, "LastActivityTime", &d.LastActivityTime)
			delete(rawMsg, key)
		case "nodeCount":
			err = unpopulate(val, "NodeCount", &d.NodeCount)
			delete(rawMsg, key)
		case "sessionId":
			err = unpopulate(val, "SessionID", &d.SessionID)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulate(val, "StartTime", &d.StartTime)
			delete(rawMsg, key)
		case "timeToLiveInMinutes":
			err = unpopulate(val, "TimeToLiveInMinutes", &d.TimeToLiveInMinutes)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type DataFlowReference.
func (d DataFlowReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "datasetParameters", &d.DatasetParameters)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "referenceName", d.ReferenceName)
	populate(objectMap, "type", d.Type)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowReference.
func (d *DataFlowReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "datasetParameters":
			err = unpopulate(val, "DatasetParameters", &d.DatasetParameters)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "referenceName":
			err = unpopulate(val, "ReferenceName", &d.ReferenceName)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type DataFlowSink.
func (d DataFlowSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", d.Dataset)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "flowlet", d.Flowlet)
	populate(objectMap, "linkedService", d.LinkedService)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "rejectedDataLinkedService", d.RejectedDataLinkedService)
	populate(objectMap, "schemaLinkedService", d.SchemaLinkedService)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowSink.
func (d *DataFlowSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &d.Dataset)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "flowlet":
			err = unpopulate(val, "Flowlet", &d.Flowlet)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &d.LinkedService)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "rejectedDataLinkedService":
			err = unpopulate(val, "RejectedDataLinkedService", &d.RejectedDataLinkedService)
			delete(rawMsg, key)
		case "schemaLinkedService":
			err = unpopulate(val, "SchemaLinkedService", &d.SchemaLinkedService)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowSource.
func (d DataFlowSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", d.Dataset)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "flowlet", d.Flowlet)
	populate(objectMap, "linkedService", d.LinkedService)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "schemaLinkedService", d.SchemaLinkedService)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowSource.
func (d *DataFlowSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &d.Dataset)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "flowlet":
			err = unpopulate(val, "Flowlet", &d.Flowlet)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &d.LinkedService)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "schemaLinkedService":
			err = unpopulate(val, "SchemaLinkedService", &d.SchemaLinkedService)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowSourceSetting.
func (d DataFlowSourceSetting) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "rowLimit", d.RowLimit)
	populate(objectMap, "sourceName", d.SourceName)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataFlowSourceSetting.
func (d *DataFlowSourceSetting) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "rowLimit":
			err = unpopulate(val, "RowLimit", &d.RowLimit)
			delete(rawMsg, key)
		case "sourceName":
			err = unpopulate(val, "SourceName", &d.SourceName)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataFlowStagingInfo.
func (d DataFlowStagingInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "folderPath", &d.FolderPath)
	populate(objectMap, "linkedService", d.LinkedService)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsUSQLActivity.
func (d DataLakeAnalyticsUSQLActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", d.DependsOn)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "policy", d.Policy)
	objectMap["type"] = "DataLakeAnalyticsU-SQL"
	populate(objectMap, "typeProperties", d.TypeProperties)
	populate(objectMap, "userProperties", d.UserProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsUSQLActivity.
func (d *DataLakeAnalyticsUSQLActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &d.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &d.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &d.UserProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataLakeAnalyticsUSQLActivityTypeProperties.
func (d DataLakeAnalyticsUSQLActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compilationMode", &d.CompilationMode)
	populate(objectMap, "degreeOfParallelism", &d.DegreeOfParallelism)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "priority", &d.Priority)
	populate(objectMap, "runtimeVersion", &d.RuntimeVersion)
	populate(objectMap, "scriptLinkedService", d.ScriptLinkedService)
	populate(objectMap, "scriptPath", &d.ScriptPath)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataLakeAnalyticsUSQLActivityTypeProperties.
func (d *DataLakeAnalyticsUSQLActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compilationMode":
			err = unpopulate(val, "CompilationMode", &d.CompilationMode)
			delete(rawMsg, key)
		case "degreeOfParallelism":
			err = unpopulate(val, "DegreeOfParallelism", &d.DegreeOfParallelism)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "priority":
			err = unpopulate(val, "Priority", &d.Priority)
			delete(rawMsg, key)
		case "runtimeVersion":
			err = unpopulate(val, "RuntimeVersion", &d.RuntimeVersion)
			delete(rawMsg, key)
		case "scriptLinkedService":
			err = unpopulate(val, "ScriptLinkedService", &d.ScriptLinkedService)
			delete(rawMsg, key)
		case "scriptPath":
			err = unpopulate(val, "ScriptPath", &d.ScriptPath)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatabricksNotebookActivity.
func (d DatabricksNotebookActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", d.DependsOn)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "policy", d.Policy)
	objectMap["type"] = "DatabricksNotebook"
	populate(objectMap, "typeProperties", d.TypeProperties)
	populate(objectMap, "userProperties", d.UserProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksNotebookActivity.
func (d *DatabricksNotebookActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &d.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &d.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &d.UserProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatabricksNotebookActivityTypeProperties.
func (d DatabricksNotebookActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "baseParameters", d.BaseParameters)
	populate(objectMap, "libraries", d.Libraries)
	populate(objectMap, "notebookPath", &d.NotebookPath)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksNotebookActivityTypeProperties.
func (d *DatabricksNotebookActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "baseParameters":
			err = unpopulate(val, "BaseParameters", &d.BaseParameters)
			delete(rawMsg, key)
		case "libraries":
			err = unpopulate(val, "Libraries", &d.Libraries)
			delete(rawMsg, key)
		case "notebookPath":
			err = unpopulate(val, "NotebookPath", &d.NotebookPath)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatabricksSparkJarActivity.
func (d DatabricksSparkJarActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", d.DependsOn)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "policy", d.Policy)
	objectMap["type"] = "DatabricksSparkJar"
	populate(objectMap, "typeProperties", d.TypeProperties)
	populate(objectMap, "userProperties", d.UserProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksSparkJarActivity.
func (d *DatabricksSparkJarActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &d.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &d.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &d.UserProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatabricksSparkJarActivityTypeProperties.
func (d DatabricksSparkJarActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "libraries", d.Libraries)
	populate(objectMap, "mainClassName", &d.MainClassName)
	populate(objectMap, "parameters", d.Parameters)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DatabricksSparkPythonActivity.
func (d DatabricksSparkPythonActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", d.DependsOn)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "policy", d.Policy)
	objectMap["type"] = "DatabricksSparkPython"
	populate(objectMap, "typeProperties", d.TypeProperties)
	populate(objectMap, "userProperties", d.UserProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatabricksSparkPythonActivity.
func (d *DatabricksSparkPythonActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &d.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &d.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &d.UserProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatabricksSparkPythonActivityTypeProperties.
func (d DatabricksSparkPythonActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "libraries", d.Libraries)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "pythonFile", &d.PythonFile)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type Dataset.
func (d Dataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = d.Type
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Dataset.
func (d *Dataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatasetCompression.
func (d DatasetCompression) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "level", &d.Level)
	populate(objectMap, "type", &d.Type)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatasetCompression.
func (d *DatasetCompression) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "level":
			err = unpopulate(val, "Level", &d.Level)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type DatasetLocation.
func (d DatasetLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &d.FileName)
	populate(objectMap, "folderPath", &d.FolderPath)
	objectMap["type"] = d.Type
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatasetLocation.
func (d *DatasetLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &d.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &d.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DatasetReference.
func (d DatasetReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "referenceName", d.ReferenceName)
	populate(objectMap, "type", d.Type)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type DatasetStorageFormat.
func (d DatasetStorageFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deserializer", &d.Deserializer)
	populate(objectMap, "serializer", &d.Serializer)
	objectMap["type"] = d.Type
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DatasetStorageFormat.
func (d *DatasetStorageFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deserializer":
			err = unpopulate(val, "Deserializer", &d.Deserializer)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &d.Serializer)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataworldLinkedService.
func (d DataworldLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "Dataworld"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DataworldLinkedService.
func (d *DataworldLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DataworldLinkedServiceTypeProperties.
func (d DataworldLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", d.APIToken)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type Db2LinkedService.
func (d Db2LinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "Db2"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Db2LinkedService.
func (d *Db2LinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Db2LinkedServiceTypeProperties.
func (d Db2LinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", d.AuthenticationType)
	populate(objectMap, "certificateCommonName", &d.CertificateCommonName)
	populate(objectMap, "connectionString", &d.ConnectionString)
	populate(objectMap, "database", &d.Database)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	populate(objectMap, "packageCollection", &d.PackageCollection)
	populate(objectMap, "password", d.Password)
	populate(objectMap, "server", &d.Server)
	populate(objectMap, "username", &d.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Db2LinkedServiceTypeProperties.
func (d *Db2LinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &d.AuthenticationType)
			delete(rawMsg, key)
		case "certificateCommonName":
			err = unpopulate(val, "CertificateCommonName", &d.CertificateCommonName)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &d.ConnectionString)
			delete(rawMsg, key)
		case "database":
			err = unpopulate(val, "Database", &d.Database)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &d.EncryptedCredential)
			delete(rawMsg, key)
		case "packageCollection":
			err = unpopulate(val, "PackageCollection", &d.PackageCollection)
			delete(rawMsg, key)
		case "password":
			d.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &d.Server)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &d.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Db2Source.
func (d Db2Source) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "queryTimeout", &d.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "Db2Source"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Db2Source.
func (d *Db2Source) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &d.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Db2TableDataset.
func (d Db2TableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "Db2Table"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Db2TableDataset.
func (d *Db2TableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Db2TableDatasetTypeProperties.
func (d Db2TableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "table", &d.Table)
	populate(objectMap, "tableName", &d.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Db2TableDatasetTypeProperties.
func (d *Db2TableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &d.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &d.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DeleteActivity.
func (d DeleteActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", d.DependsOn)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "name", d.Name)
	populate(objectMap, "policy", d.Policy)
	objectMap["type"] = "Delete"
	populate(objectMap, "typeProperties", d.TypeProperties)
	populate(objectMap, "userProperties", d.UserProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteActivity.
func (d *DeleteActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &d.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &d.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &d.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &d.UserProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DeleteActivityTypeProperties.
func (d DeleteActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", d.Dataset)
	populate(objectMap, "enableLogging", &d.EnableLogging)
	populate(objectMap, "logStorageSettings", d.LogStorageSettings)
	populate(objectMap, "maxConcurrentConnections", d.MaxConcurrentConnections)
	populate(objectMap, "recursive", &d.Recursive)
	populate(objectMap, "storeSettings", d.StoreSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DeleteActivityTypeProperties.
func (d *DeleteActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &d.Dataset)
			delete(rawMsg, key)
		case "enableLogging":
			err = unpopulate(val, "EnableLogging", &d.EnableLogging)
			delete(rawMsg, key)
		case "logStorageSettings":
			err = unpopulate(val, "LogStorageSettings", &d.LogStorageSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &d.Recursive)
			delete(rawMsg, key)
		case "storeSettings":
			d.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextDataset.
func (d DelimitedTextDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DelimitedText"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextDataset.
func (d *DelimitedTextDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextDatasetTypeProperties.
func (d DelimitedTextDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "columnDelimiter", &d.ColumnDelimiter)
	populate(objectMap, "compressionCodec", &d.CompressionCodec)
	populate(objectMap, "compressionLevel", &d.CompressionLevel)
	populate(objectMap, "encodingName", &d.EncodingName)
	populate(objectMap, "escapeChar", &d.EscapeChar)
	populate(objectMap, "firstRowAsHeader", &d.FirstRowAsHeader)
	populate(objectMap, "location", d.Location)
	populate(objectMap, "nullValue", &d.NullValue)
	populate(objectMap, "quoteChar", &d.QuoteChar)
	populate(objectMap, "rowDelimiter", &d.RowDelimiter)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextDatasetTypeProperties.
func (d *DelimitedTextDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "columnDelimiter":
			err = unpopulate(val, "ColumnDelimiter", &d.ColumnDelimiter)
			delete(rawMsg, key)
		case "compressionCodec":
			err = unpopulate(val, "CompressionCodec", &d.CompressionCodec)
			delete(rawMsg, key)
		case "compressionLevel":
			err = unpopulate(val, "CompressionLevel", &d.CompressionLevel)
			delete(rawMsg, key)
		case "encodingName":
			err = unpopulate(val, "EncodingName", &d.EncodingName)
			delete(rawMsg, key)
		case "escapeChar":
			err = unpopulate(val, "EscapeChar", &d.EscapeChar)
			delete(rawMsg, key)
		case "firstRowAsHeader":
			err = unpopulate(val, "FirstRowAsHeader", &d.FirstRowAsHeader)
			delete(rawMsg, key)
		case "location":
			d.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		case "nullValue":
			err = unpopulate(val, "NullValue", &d.NullValue)
			delete(rawMsg, key)
		case "quoteChar":
			err = unpopulate(val, "QuoteChar", &d.QuoteChar)
			delete(rawMsg, key)
		case "rowDelimiter":
			err = unpopulate(val, "RowDelimiter", &d.RowDelimiter)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextReadSettings.
func (d DelimitedTextReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compressionProperties", d.CompressionProperties)
	populate(objectMap, "skipLineCount", &d.SkipLineCount)
	objectMap["type"] = "DelimitedTextReadSettings"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextReadSettings.
func (d *DelimitedTextReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compressionProperties":
			d.CompressionProperties, err = unmarshalCompressionReadSettingsClassification(val)
			delete(rawMsg, key)
		case "skipLineCount":
			err = unpopulate(val, "SkipLineCount", &d.SkipLineCount)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextSink.
func (d DelimitedTextSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "formatSettings", d.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &d.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &d.SinkRetryWait)
	populate(objectMap, "storeSettings", d.StoreSettings)
	objectMap["type"] = "DelimitedTextSink"
	populate(objectMap, "writeBatchSize", &d.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &d.WriteBatchTimeout)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextSink.
func (d *DelimitedTextSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &d.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &d.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &d.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			d.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &d.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &d.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextSource.
func (d DelimitedTextSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "formatSettings", d.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	populate(objectMap, "storeSettings", d.StoreSettings)
	objectMap["type"] = "DelimitedTextSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextSource.
func (d *DelimitedTextSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &d.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			d.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DelimitedTextWriteSettings.
func (d DelimitedTextWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileExtension", &d.FileExtension)
	populate(objectMap, "fileNamePrefix", &d.FileNamePrefix)
	populate(objectMap, "maxRowsPerFile", &d.MaxRowsPerFile)
	populate(objectMap, "quoteAllText", &d.QuoteAllText)
	objectMap["type"] = "DelimitedTextWriteSettings"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DelimitedTextWriteSettings.
func (d *DelimitedTextWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileExtension":
			err = unpopulate(val, "FileExtension", &d.FileExtension)
			delete(rawMsg, key)
		case "fileNamePrefix":
			err = unpopulate(val, "FileNamePrefix", &d.FileNamePrefix)
			delete(rawMsg, key)
		case "maxRowsPerFile":
			err = unpopulate(val, "MaxRowsPerFile", &d.MaxRowsPerFile)
			delete(rawMsg, key)
		case "quoteAllText":
			err = unpopulate(val, "QuoteAllText", &d.QuoteAllText)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type DistcpSettings.
func (d DistcpSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "distcpOptions", &d.DistcpOptions)
	populate(objectMap, "resourceManagerEndpoint", &d.ResourceManagerEndpoint)
	populate(objectMap, "tempScriptPath", &d.TempScriptPath)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DistcpSettings.
func (d *DistcpSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "distcpOptions":
			err = unpopulate(val, "DistcpOptions", &d.DistcpOptions)
			delete(rawMsg, key)
		case "resourceManagerEndpoint":
			err = unpopulate(val, "ResourceManagerEndpoint", &d.ResourceManagerEndpoint)
			delete(rawMsg, key)
		case "tempScriptPath":
			err = unpopulate(val, "TempScriptPath", &d.TempScriptPath)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DocumentDbCollectionDataset.
func (d DocumentDbCollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DocumentDbCollection"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbCollectionDataset.
func (d *DocumentDbCollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DocumentDbCollectionDatasetTypeProperties.
func (d DocumentDbCollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collectionName", &d.CollectionName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DocumentDbCollectionSink.
func (d DocumentDbCollectionSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "nestingSeparator", &d.NestingSeparator)
	populate(objectMap, "sinkRetryCount", &d.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &d.SinkRetryWait)
	objectMap["type"] = "DocumentDbCollectionSink"
	populate(objectMap, "writeBatchSize", &d.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &d.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &d.WriteBehavior)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbCollectionSink.
func (d *DocumentDbCollectionSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "nestingSeparator":
			err = unpopulate(val, "NestingSeparator", &d.NestingSeparator)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &d.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &d.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &d.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &d.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &d.WriteBehavior)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DocumentDbCollectionSource.
func (d DocumentDbCollectionSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "nestingSeparator", &d.NestingSeparator)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "queryTimeout", &d.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "DocumentDbCollectionSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentDbCollectionSource.
func (d *DocumentDbCollectionSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "nestingSeparator":
			err = unpopulate(val, "NestingSeparator", &d.NestingSeparator)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &d.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DrillDatasetTypeProperties.
func (d DrillDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "table", &d.Table)
	populate(objectMap, "tableName", &d.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DrillDatasetTypeProperties.
func (d *DrillDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &d.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &d.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DrillLinkedService.
func (d DrillLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "Drill"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DrillLinkedService.
func (d *DrillLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DrillLinkedServiceTypeProperties.
func (d DrillLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &d.ConnectionString)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	populate(objectMap, "pwd", d.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DrillLinkedServiceTypeProperties.
func (d *DrillLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &d.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &d.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &d.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DrillSource.
func (d DrillSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "queryTimeout", &d.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "DrillSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DrillSource.
func (d *DrillSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &d.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DrillTableDataset.
func (d DrillTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DrillTable"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DrillTableDataset.
func (d *DrillTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsAXLinkedService.
func (d DynamicsAXLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "DynamicsAX"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsAXLinkedService.
func (d *DynamicsAXLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsAXLinkedServiceTypeProperties.
func (d DynamicsAXLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "aadResourceId", &d.AADResourceID)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	populate(objectMap, "servicePrincipalId", &d.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", d.ServicePrincipalKey)
	populate(objectMap, "tenant", &d.Tenant)
	populate(objectMap, "url", &d.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsAXLinkedServiceTypeProperties.
func (d *DynamicsAXLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "aadResourceId":
			err = unpopulate(val, "AADResourceID", &d.AADResourceID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &d.EncryptedCredential)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &d.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			d.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &d.Tenant)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &d.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsAXResourceDataset.
func (d DynamicsAXResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DynamicsAXResource"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsAXResourceDataset.
func (d *DynamicsAXResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type DynamicsAXSource.
func (d DynamicsAXSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &d.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "queryTimeout", &d.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "DynamicsAXSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsAXSource.
func (d *DynamicsAXSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &d.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &d.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmEntityDataset.
func (d DynamicsCrmEntityDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DynamicsCrmEntity"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsCrmEntityDataset.
func (d *DynamicsCrmEntityDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmEntityDatasetTypeProperties.
func (d DynamicsCrmEntityDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "entityName", &d.EntityName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmLinkedService.
func (d DynamicsCrmLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "DynamicsCrm"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsCrmLinkedService.
func (d *DynamicsCrmLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmLinkedServiceTypeProperties.
func (d DynamicsCrmLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &d.AuthenticationType)
	populate(objectMap, "deploymentType", &d.DeploymentType)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	populate(objectMap, "hostName", &d.HostName)
	populate(objectMap, "organizationName", &d.OrganizationName)
	populate(objectMap, "password", d.Password)
	populate(objectMap, "port", &d.Port)
	populate(objectMap, "servicePrincipalCredential", d.ServicePrincipalCredential)
	populate(objectMap, "servicePrincipalCredentialType", &d.ServicePrincipalCredentialType)
	populate(objectMap, "servicePrincipalId", &d.ServicePrincipalID)
	populate(objectMap, "serviceUri", &d.ServiceURI)
	populate(objectMap, "username", &d.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsCrmLinkedServiceTypeProperties.
func (d *DynamicsCrmLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &d.AuthenticationType)
			delete(rawMsg, key)
		case "deploymentType":
			err = unpopulate(val, "DeploymentType", &d.DeploymentType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &d.EncryptedCredential)
			delete(rawMsg, key)
		case "hostName":
			err = unpopulate(val, "HostName", &d.HostName)
			delete(rawMsg, key)
		case "organizationName":
			err = unpopulate(val, "OrganizationName", &d.OrganizationName)
			delete(rawMsg, key)
		case "password":
			d.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &d.Port)
			delete(rawMsg, key)
		case "servicePrincipalCredential":
			d.ServicePrincipalCredential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalCredentialType":
			err = unpopulate(val, "ServicePrincipalCredentialType", &d.ServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &d.ServicePrincipalID)
			delete(rawMsg, key)
		case "serviceUri":
			err = unpopulate(val, "ServiceURI", &d.ServiceURI)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &d.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmSink.
func (d DynamicsCrmSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alternateKeyName", &d.AlternateKeyName)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "ignoreNullValues", &d.IgnoreNullValues)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &d.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &d.SinkRetryWait)
	objectMap["type"] = "DynamicsCrmSink"
	populate(objectMap, "writeBatchSize", &d.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &d.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", d.WriteBehavior)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsCrmSink.
func (d *DynamicsCrmSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alternateKeyName":
			err = unpopulate(val, "AlternateKeyName", &d.AlternateKeyName)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "ignoreNullValues":
			err = unpopulate(val, "IgnoreNullValues", &d.IgnoreNullValues)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &d.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &d.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &d.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &d.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &d.WriteBehavior)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsCrmSource.
func (d DynamicsCrmSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "DynamicsCrmSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsCrmSource.
func (d *DynamicsCrmSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsEntityDataset.
func (d DynamicsEntityDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "folder", d.Folder)
	populate(objectMap, "linkedServiceName", d.LinkedServiceName)
	populate(objectMap, "parameters", d.Parameters)
	populate(objectMap, "schema", &d.Schema)
	populate(objectMap, "structure", &d.Structure)
	objectMap["type"] = "DynamicsEntity"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsEntityDataset.
func (d *DynamicsEntityDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &d.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &d.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &d.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &d.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsEntityDatasetTypeProperties.
func (d DynamicsEntityDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "entityName", &d.EntityName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type DynamicsLinkedService.
func (d DynamicsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", d.Annotations)
	populate(objectMap, "connectVia", d.ConnectVia)
	populate(objectMap, "description", d.Description)
	populate(objectMap, "parameters", d.Parameters)
	objectMap["type"] = "Dynamics"
	populate(objectMap, "typeProperties", d.TypeProperties)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsLinkedService.
func (d *DynamicsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &d.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &d.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &d.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &d.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &d.TypeProperties)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsLinkedServiceTypeProperties.
func (d DynamicsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &d.AuthenticationType)
	populate(objectMap, "credential", d.Credential)
	populate(objectMap, "deploymentType", &d.DeploymentType)
	populate(objectMap, "encryptedCredential", &d.EncryptedCredential)
	populate(objectMap, "hostName", &d.HostName)
	populate(objectMap, "organizationName", &d.OrganizationName)
	populate(objectMap, "password", d.Password)
	populate(objectMap, "port", &d.Port)
	populate(objectMap, "servicePrincipalCredential", d.ServicePrincipalCredential)
	populate(objectMap, "servicePrincipalCredentialType", &d.ServicePrincipalCredentialType)
	populate(objectMap, "servicePrincipalId", &d.ServicePrincipalID)
	populate(objectMap, "serviceUri", &d.ServiceURI)
	populate(objectMap, "username", &d.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsLinkedServiceTypeProperties.
func (d *DynamicsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &d.AuthenticationType)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &d.Credential)
			delete(rawMsg, key)
		case "deploymentType":
			err = unpopulate(val, "DeploymentType", &d.DeploymentType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &d.EncryptedCredential)
			delete(rawMsg, key)
		case "hostName":
			err = unpopulate(val, "HostName", &d.HostName)
			delete(rawMsg, key)
		case "organizationName":
			err = unpopulate(val, "OrganizationName", &d.OrganizationName)
			delete(rawMsg, key)
		case "password":
			d.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &d.Port)
			delete(rawMsg, key)
		case "servicePrincipalCredential":
			d.ServicePrincipalCredential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalCredentialType":
			err = unpopulate(val, "ServicePrincipalCredentialType", &d.ServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &d.ServicePrincipalID)
			delete(rawMsg, key)
		case "serviceUri":
			err = unpopulate(val, "ServiceURI", &d.ServiceURI)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &d.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsSink.
func (d DynamicsSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alternateKeyName", &d.AlternateKeyName)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "ignoreNullValues", &d.IgnoreNullValues)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &d.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &d.SinkRetryWait)
	objectMap["type"] = "DynamicsSink"
	populate(objectMap, "writeBatchSize", &d.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &d.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", d.WriteBehavior)
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsSink.
func (d *DynamicsSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alternateKeyName":
			err = unpopulate(val, "AlternateKeyName", &d.AlternateKeyName)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "ignoreNullValues":
			err = unpopulate(val, "IgnoreNullValues", &d.IgnoreNullValues)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &d.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &d.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &d.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &d.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &d.WriteBehavior)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type DynamicsSource.
func (d DynamicsSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &d.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &d.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &d.MaxConcurrentConnections)
	populate(objectMap, "query", &d.Query)
	populate(objectMap, "sourceRetryCount", &d.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &d.SourceRetryWait)
	objectMap["type"] = "DynamicsSource"
	if d.AdditionalProperties != nil {
		for key, val := range d.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicsSource.
func (d *DynamicsSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", d, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &d.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &d.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &d.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &d.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &d.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &d.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &d.Type)
			delete(rawMsg, key)
		default:
			if d.AdditionalProperties == nil {
				d.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				d.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", d, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EloquaLinkedService.
func (e EloquaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", e.Annotations)
	populate(objectMap, "connectVia", e.ConnectVia)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "parameters", e.Parameters)
	objectMap["type"] = "Eloqua"
	populate(objectMap, "typeProperties", e.TypeProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EloquaLinkedService.
func (e *EloquaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &e.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &e.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &e.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EloquaLinkedServiceTypeProperties.
func (e EloquaLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &e.EncryptedCredential)
	populate(objectMap, "endpoint", &e.Endpoint)
	populate(objectMap, "password", e.Password)
	populate(objectMap, "useEncryptedEndpoints", &e.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &e.UseHostVerification)
	populate(objectMap, "usePeerVerification", &e.UsePeerVerification)
	populate(objectMap, "username", &e.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EloquaLinkedServiceTypeProperties.
func (e *EloquaLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &e.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &e.Endpoint)
			delete(rawMsg, key)
		case "password":
			e.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &e.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &e.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &e.UsePeerVerification)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &e.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EloquaObjectDataset.
func (e EloquaObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", e.Annotations)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "folder", e.Folder)
	populate(objectMap, "linkedServiceName", e.LinkedServiceName)
	populate(objectMap, "parameters", e.Parameters)
	populate(objectMap, "schema", &e.Schema)
	populate(objectMap, "structure", &e.Structure)
	objectMap["type"] = "EloquaObject"
	populate(objectMap, "typeProperties", e.TypeProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EloquaObjectDataset.
func (e *EloquaObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &e.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &e.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &e.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &e.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &e.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &e.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EloquaSource.
func (e EloquaSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &e.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &e.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &e.MaxConcurrentConnections)
	populate(objectMap, "query", &e.Query)
	populate(objectMap, "queryTimeout", &e.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &e.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &e.SourceRetryWait)
	objectMap["type"] = "EloquaSource"
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EloquaSource.
func (e *EloquaSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &e.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &e.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &e.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &e.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &e.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &e.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &e.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EncryptionConfiguration.
func (e EncryptionConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "identity", e.Identity)
	populate(objectMap, "keyName", e.KeyName)
	populate(objectMap, "keyVersion", e.KeyVersion)
	populate(objectMap, "vaultBaseUrl", e.VaultBaseURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionConfiguration.
func (e *EncryptionConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "identity":
			err = unpopulate(val, "Identity", &e.Identity)
			delete(rawMsg, key)
		case "keyName":
			err = unpopulate(val, "KeyName", &e.KeyName)
			delete(rawMsg, key)
		case "keyVersion":
			err = unpopulate(val, "KeyVersion", &e.KeyVersion)
			delete(rawMsg, key)
		case "vaultBaseUrl":
			err = unpopulate(val, "VaultBaseURL", &e.VaultBaseURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type EntityReference.
func (e EntityReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", e.ReferenceName)
	populate(objectMap, "type", e.Type)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type EnvironmentVariableSetupTypeProperties.
func (e EnvironmentVariableSetupTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "variableName", e.VariableName)
	populate(objectMap, "variableValue", e.VariableValue)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ExcelDataset.
func (e ExcelDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", e.Annotations)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "folder", e.Folder)
	populate(objectMap, "linkedServiceName", e.LinkedServiceName)
	populate(objectMap, "parameters", e.Parameters)
	populate(objectMap, "schema", &e.Schema)
	populate(objectMap, "structure", &e.Structure)
	objectMap["type"] = "Excel"
	populate(objectMap, "typeProperties", e.TypeProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExcelDataset.
func (e *ExcelDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &e.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &e.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &e.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &e.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &e.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &e.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExcelDatasetTypeProperties.
func (e ExcelDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", e.Compression)
	populate(objectMap, "firstRowAsHeader", &e.FirstRowAsHeader)
	populate(objectMap, "location", e.Location)
	populate(objectMap, "nullValue", &e.NullValue)
	populate(objectMap, "range", &e.Range)
	populate(objectMap, "sheetIndex", &e.SheetIndex)
	populate(objectMap, "sheetName", &e.SheetName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExcelDatasetTypeProperties.
func (e *ExcelDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &e.Compression)
			delete(rawMsg, key)
		case "firstRowAsHeader":
			err = unpopulate(val, "FirstRowAsHeader", &e.FirstRowAsHeader)
			delete(rawMsg, key)
		case "location":
			e.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		case "nullValue":
			err = unpopulate(val, "NullValue", &e.NullValue)
			delete(rawMsg, key)
		case "range":
			err = unpopulate(val, "Range", &e.Range)
			delete(rawMsg, key)
		case "sheetIndex":
			err = unpopulate(val, "SheetIndex", &e.SheetIndex)
			delete(rawMsg, key)
		case "sheetName":
			err = unpopulate(val, "SheetName", &e.SheetName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExcelSource.
func (e ExcelSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &e.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &e.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &e.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &e.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &e.SourceRetryWait)
	populate(objectMap, "storeSettings", e.StoreSettings)
	objectMap["type"] = "ExcelSource"
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExcelSource.
func (e *ExcelSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &e.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &e.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &e.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &e.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &e.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			e.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteDataFlowActivity.
func (e ExecuteDataFlowActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", e.DependsOn)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "linkedServiceName", e.LinkedServiceName)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "policy", e.Policy)
	objectMap["type"] = "ExecuteDataFlow"
	populate(objectMap, "typeProperties", e.TypeProperties)
	populate(objectMap, "userProperties", e.UserProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteDataFlowActivity.
func (e *ExecuteDataFlowActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &e.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &e.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &e.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &e.UserProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteDataFlowActivityTypeProperties.
func (e ExecuteDataFlowActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compute", e.Compute)
	populate(objectMap, "continueOnError", &e.ContinueOnError)
	populate(objectMap, "dataFlow", e.DataFlow)
	populate(objectMap, "integrationRuntime", e.IntegrationRuntime)
	populate(objectMap, "runConcurrently", &e.RunConcurrently)
	populate(objectMap, "sourceStagingConcurrency", &e.SourceStagingConcurrency)
	populate(objectMap, "staging", e.Staging)
	populate(objectMap, "traceLevel", &e.TraceLevel)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteDataFlowActivityTypeProperties.
func (e *ExecuteDataFlowActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compute":
			err = unpopulate(val, "Compute", &e.Compute)
			delete(rawMsg, key)
		case "continueOnError":
			err = unpopulate(val, "ContinueOnError", &e.ContinueOnError)
			delete(rawMsg, key)
		case "dataFlow":
			err = unpopulate(val, "DataFlow", &e.DataFlow)
			delete(rawMsg, key)
		case "integrationRuntime":
			err = unpopulate(val, "IntegrationRuntime", &e.IntegrationRuntime)
			delete(rawMsg, key)
		case "runConcurrently":
			err = unpopulate(val, "RunConcurrently", &e.RunConcurrently)
			delete(rawMsg, key)
		case "sourceStagingConcurrency":
			err = unpopulate(val, "SourceStagingConcurrency", &e.SourceStagingConcurrency)
			delete(rawMsg, key)
		case "staging":
			err = unpopulate(val, "Staging", &e.Staging)
			delete(rawMsg, key)
		case "traceLevel":
			err = unpopulate(val, "TraceLevel", &e.TraceLevel)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteDataFlowActivityTypePropertiesCompute.
func (e ExecuteDataFlowActivityTypePropertiesCompute) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "computeType", &e.ComputeType)
	populate(objectMap, "coreCount", &e.CoreCount)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ExecutePipelineActivity.
func (e ExecutePipelineActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", e.DependsOn)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "policy", e.Policy)
	objectMap["type"] = "ExecutePipeline"
	populate(objectMap, "typeProperties", e.TypeProperties)
	populate(objectMap, "userProperties", e.UserProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutePipelineActivity.
func (e *ExecutePipelineActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &e.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &e.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &e.UserProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecutePipelineActivityPolicy.
func (e ExecutePipelineActivityPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "secureInput", e.SecureInput)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ExecutePipelineActivityTypeProperties.
func (e ExecutePipelineActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parameters", e.Parameters)
	populate(objectMap, "pipeline", e.Pipeline)
	populate(objectMap, "waitOnCompletion", e.WaitOnCompletion)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ExecutePowerQueryActivityTypeProperties.
func (e ExecutePowerQueryActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compute", e.Compute)
	populate(objectMap, "continueOnError", &e.ContinueOnError)
	populate(objectMap, "dataFlow", e.DataFlow)
	populate(objectMap, "integrationRuntime", e.IntegrationRuntime)
	populate(objectMap, "queries", e.Queries)
	populate(objectMap, "runConcurrently", &e.RunConcurrently)
	populate(objectMap, "sinks", e.Sinks)
	populate(objectMap, "sourceStagingConcurrency", &e.SourceStagingConcurrency)
	populate(objectMap, "staging", e.Staging)
	populate(objectMap, "traceLevel", &e.TraceLevel)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutePowerQueryActivityTypeProperties.
func (e *ExecutePowerQueryActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compute":
			err = unpopulate(val, "Compute", &e.Compute)
			delete(rawMsg, key)
		case "continueOnError":
			err = unpopulate(val, "ContinueOnError", &e.ContinueOnError)
			delete(rawMsg, key)
		case "dataFlow":
			err = unpopulate(val, "DataFlow", &e.DataFlow)
			delete(rawMsg, key)
		case "integrationRuntime":
			err = unpopulate(val, "IntegrationRuntime", &e.IntegrationRuntime)
			delete(rawMsg, key)
		case "queries":
			err = unpopulate(val, "Queries", &e.Queries)
			delete(rawMsg, key)
		case "runConcurrently":
			err = unpopulate(val, "RunConcurrently", &e.RunConcurrently)
			delete(rawMsg, key)
		case "sinks":
			err = unpopulate(val, "Sinks", &e.Sinks)
			delete(rawMsg, key)
		case "sourceStagingConcurrency":
			err = unpopulate(val, "SourceStagingConcurrency", &e.SourceStagingConcurrency)
			delete(rawMsg, key)
		case "staging":
			err = unpopulate(val, "Staging", &e.Staging)
			delete(rawMsg, key)
		case "traceLevel":
			err = unpopulate(val, "TraceLevel", &e.TraceLevel)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteSSISPackageActivity.
func (e ExecuteSSISPackageActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", e.DependsOn)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "linkedServiceName", e.LinkedServiceName)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "policy", e.Policy)
	objectMap["type"] = "ExecuteSSISPackage"
	populate(objectMap, "typeProperties", e.TypeProperties)
	populate(objectMap, "userProperties", e.UserProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteSSISPackageActivity.
func (e *ExecuteSSISPackageActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &e.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &e.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &e.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &e.UserProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteSSISPackageActivityTypeProperties.
func (e ExecuteSSISPackageActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectVia", e.ConnectVia)
	populate(objectMap, "environmentPath", &e.EnvironmentPath)
	populate(objectMap, "executionCredential", e.ExecutionCredential)
	populate(objectMap, "logLocation", e.LogLocation)
	populate(objectMap, "loggingLevel", &e.LoggingLevel)
	populate(objectMap, "packageConnectionManagers", e.PackageConnectionManagers)
	populate(objectMap, "packageLocation", e.PackageLocation)
	populate(objectMap, "packageParameters", e.PackageParameters)
	populate(objectMap, "projectConnectionManagers", e.ProjectConnectionManagers)
	populate(objectMap, "projectParameters", e.ProjectParameters)
	populate(objectMap, "propertyOverrides", e.PropertyOverrides)
	populate(objectMap, "runtime", &e.Runtime)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteSSISPackageActivityTypeProperties.
func (e *ExecuteSSISPackageActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &e.ConnectVia)
			delete(rawMsg, key)
		case "environmentPath":
			err = unpopulate(val, "EnvironmentPath", &e.EnvironmentPath)
			delete(rawMsg, key)
		case "executionCredential":
			err = unpopulate(val, "ExecutionCredential", &e.ExecutionCredential)
			delete(rawMsg, key)
		case "logLocation":
			err = unpopulate(val, "LogLocation", &e.LogLocation)
			delete(rawMsg, key)
		case "loggingLevel":
			err = unpopulate(val, "LoggingLevel", &e.LoggingLevel)
			delete(rawMsg, key)
		case "packageConnectionManagers":
			err = unpopulate(val, "PackageConnectionManagers", &e.PackageConnectionManagers)
			delete(rawMsg, key)
		case "packageLocation":
			err = unpopulate(val, "PackageLocation", &e.PackageLocation)
			delete(rawMsg, key)
		case "packageParameters":
			err = unpopulate(val, "PackageParameters", &e.PackageParameters)
			delete(rawMsg, key)
		case "projectConnectionManagers":
			err = unpopulate(val, "ProjectConnectionManagers", &e.ProjectConnectionManagers)
			delete(rawMsg, key)
		case "projectParameters":
			err = unpopulate(val, "ProjectParameters", &e.ProjectParameters)
			delete(rawMsg, key)
		case "propertyOverrides":
			err = unpopulate(val, "PropertyOverrides", &e.PropertyOverrides)
			delete(rawMsg, key)
		case "runtime":
			err = unpopulate(val, "Runtime", &e.Runtime)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecuteWranglingDataflowActivity.
func (e ExecuteWranglingDataflowActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", e.DependsOn)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "policy", e.Policy)
	objectMap["type"] = "ExecuteWranglingDataflow"
	populate(objectMap, "typeProperties", e.TypeProperties)
	populate(objectMap, "userProperties", e.UserProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteWranglingDataflowActivity.
func (e *ExecuteWranglingDataflowActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &e.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &e.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &e.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &e.UserProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExecutionActivity.
func (e ExecutionActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", e.DependsOn)
	populate(objectMap, "description", e.Description)
	populate(objectMap, "linkedServiceName", e.LinkedServiceName)
	populate(objectMap, "name", e.Name)
	populate(objectMap, "policy", e.Policy)
	objectMap["type"] = "Execution"
	populate(objectMap, "userProperties", e.UserProperties)
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionActivity.
func (e *ExecutionActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", e, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &e.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &e.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &e.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &e.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &e.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &e.Type)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &e.UserProperties)
			delete(rawMsg, key)
		default:
			if e.AdditionalProperties == nil {
				e.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				e.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", e, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ExportSettings.
func (e ExportSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["type"] = e.Type
	if e.AdditionalProperties != nil {
		for key, val := range e.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type ExposureControlRequest.
func (e ExposureControlRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "featureName", e.FeatureName)
	populate(objectMap, "featureType", e.FeatureType)
	return json.Marshal(objectMap)
}

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type Factory.
func (f Factory) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "eTag", f.ETag)
	populate(objectMap, "id", f.ID)
	populate(objectMap, "identity", f.Identity)
	populate(objectMap, "location", f.Location)
	populate(objectMap, "name", f.Name)
	populate(objectMap, "properties", f.Properties)
	populate(objectMap, "tags", f.Tags)
	populate(objectMap, "type", f.Type)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type FactoryGitHubConfiguration.
func (f FactoryGitHubConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountName", f.AccountName)
	populate(objectMap, "clientId", f.ClientID)
	populate(objectMap, "clientSecret", f.ClientSecret)
	populate(objectMap, "collaborationBranch", f.CollaborationBranch)
	populate(objectMap, "disablePublish", f.DisablePublish)
	populate(objectMap, "hostName", f.HostName)
	populate(objectMap, "lastCommitId", f.LastCommitID)
	populate(objectMap, "repositoryName", f.RepositoryName)
	populate(objectMap, "rootFolder", f.RootFolder)
	objectMap["type"] = "FactoryGitHubConfiguration"
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FactoryGitHubConfiguration.
func (f *FactoryGitHubConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountName":
			err = unpopulate(val, "AccountName", &f.AccountName)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &f.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			err = unpopulate(val, "ClientSecret", &f.ClientSecret)
			delete(rawMsg, key)
		case "collaborationBranch":
			err = unpopulate(val, "CollaborationBranch", &f.CollaborationBranch)
			delete(rawMsg, key)
		case "disablePublish":
			err = unpopulate(val, "DisablePublish", &f.DisablePublish)
			delete(rawMsg, key)
		case "hostName":
			err = unpopulate(val, "HostName", &f.HostName)
			delete(rawMsg, key)
		case "lastCommitId":
			err = unpopulate(val, "LastCommitID", &f.LastCommitID)
			delete(rawMsg, key)
		case "repositoryName":
			err = unpopulate(val, "RepositoryName", &f.RepositoryName)
			delete(rawMsg, key)
		case "rootFolder":
			err = unpopulate(val, "RootFolder", &f.RootFolder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type FactoryProperties.
func (f FactoryProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populateTimeRFC3339(objectMap, "createTime", f.CreateTime)
	populate(objectMap, "encryption", f.Encryption)
	populate(objectMap, "globalParameters", f.GlobalParameters)
	populate(objectMap, "provisioningState", f.ProvisioningState)
	populate(objectMap, "publicNetworkAccess", f.PublicNetworkAccess)
	populate(objectMap, "purviewConfiguration", f.PurviewConfiguration)
	populate(objectMap, "repoConfiguration", f.RepoConfiguration)
	populate(objectMap, "version", f.Version)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FactoryProperties.
func (f *FactoryProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "createTime":
			err = unpopulateTimeRFC3339(val, "CreateTime", &f.CreateTime)
			delete(rawMsg, key)
		case "encryption":
			err = unpopulate(val, "Encryption", &f.Encryption)
			delete(rawMsg, key)
		case "globalParameters":
			err = unpopulate(val, "GlobalParameters", &f.GlobalParameters)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &f.ProvisioningState)
			delete(rawMsg, key)
		case "publicNetworkAccess":
			err = unpopulate(val, "PublicNetworkAccess", &f.PublicNetworkAccess)
			delete(rawMsg, key)
		case "purviewConfiguration":
			err = unpopulate(val, "PurviewConfiguration", &f.PurviewConfiguration)
			delete(rawMsg, key)
		case "repoConfiguration":
			f.RepoConfiguration, err = unmarshalFactoryRepoConfigurationClassification(val)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &f.Version)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FactoryRepoConfiguration.
func (f FactoryRepoConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountName", f.AccountName)
	populate(objectMap, "collaborationBranch", f.CollaborationBranch)
	populate(objectMap, "disablePublish", f.DisablePublish)
	populate(objectMap, "lastCommitId", f.LastCommitID)
	populate(objectMap, "repositoryName", f.RepositoryName)
	populate(objectMap, "rootFolder", f.RootFolder)
	objectMap["type"] = f.Type
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FactoryRepoConfiguration.
func (f *FactoryRepoConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountName":
			err = unpopulate(val, "AccountName", &f.AccountName)
			delete(rawMsg, key)
		case "collaborationBranch":
			err = unpopulate(val, "CollaborationBranch", &f.CollaborationBranch)
			delete(rawMsg, key)
		case "disablePublish":
			err = unpopulate(val, "DisablePublish", &f.DisablePublish)
			delete(rawMsg, key)
		case "lastCommitId":
			err = unpopulate(val, "LastCommitID", &f.LastCommitID)
			delete(rawMsg, key)
		case "repositoryName":
			err = unpopulate(val, "RepositoryName", &f.RepositoryName)
			delete(rawMsg, key)
		case "rootFolder":
			err = unpopulate(val, "RootFolder", &f.RootFolder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FactoryRepoUpdate.
func (f FactoryRepoUpdate) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "factoryResourceId", f.FactoryResourceID)
	populate(objectMap, "repoConfiguration", f.RepoConfiguration)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FactoryRepoUpdate.
func (f *FactoryRepoUpdate) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "factoryResourceId":
			err = unpopulate(val, "FactoryResourceID", &f.FactoryResourceID)
			delete(rawMsg, key)
		case "repoConfiguration":
			f.RepoConfiguration, err = unmarshalFactoryRepoConfigurationClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type FactoryUpdateProperties.
func (f FactoryUpdateProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "publicNetworkAccess", f.PublicNetworkAccess)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type FactoryVSTSConfiguration.
func (f FactoryVSTSConfiguration) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accountName", f.AccountName)
	populate(objectMap, "collaborationBranch", f.CollaborationBranch)
	populate(objectMap, "disablePublish", f.DisablePublish)
	populate(objectMap, "lastCommitId", f.LastCommitID)
	populate(objectMap, "projectName", f.ProjectName)
	populate(objectMap, "repositoryName", f.RepositoryName)
	populate(objectMap, "rootFolder", f.RootFolder)
	populate(objectMap, "tenantId", f.TenantID)
	objectMap["type"] = "FactoryVSTSConfiguration"
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FactoryVSTSConfiguration.
func (f *FactoryVSTSConfiguration) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accountName":
			err = unpopulate(val, "AccountName", &f.AccountName)
			delete(rawMsg, key)
		case "collaborationBranch":
			err = unpopulate(val, "CollaborationBranch", &f.CollaborationBranch)
			delete(rawMsg, key)
		case "disablePublish":
			err = unpopulate(val, "DisablePublish", &f.DisablePublish)
			delete(rawMsg, key)
		case "lastCommitId":
			err = unpopulate(val, "LastCommitID", &f.LastCommitID)
			delete(rawMsg, key)
		case "projectName":
			err = unpopulate(val, "ProjectName", &f.ProjectName)
			delete(rawMsg, key)
		case "repositoryName":
			err = unpopulate(val, "RepositoryName", &f.RepositoryName)
			delete(rawMsg, key)
		case "rootFolder":
			err = unpopulate(val, "RootFolder", &f.RootFolder)
			delete(rawMsg, key)
		case "tenantId":
			err = unpopulate(val, "TenantID", &f.TenantID)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FailActivity.
func (f FailActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", f.DependsOn)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "name", f.Name)
	objectMap["type"] = "Fail"
	populate(objectMap, "typeProperties", f.TypeProperties)
	populate(objectMap, "userProperties", f.UserProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FailActivity.
func (f *FailActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &f.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &f.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &f.UserProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FailActivityTypeProperties.
func (f FailActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "errorCode", &f.ErrorCode)
	populate(objectMap, "message", &f.Message)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type FileServerLinkedService.
func (f FileServerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", f.Annotations)
	populate(objectMap, "connectVia", f.ConnectVia)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "parameters", f.Parameters)
	objectMap["type"] = "FileServer"
	populate(objectMap, "typeProperties", f.TypeProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileServerLinkedService.
func (f *FileServerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &f.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &f.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &f.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileServerLinkedServiceTypeProperties.
func (f FileServerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &f.EncryptedCredential)
	populate(objectMap, "host", &f.Host)
	populate(objectMap, "password", f.Password)
	populate(objectMap, "userId", &f.UserID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileServerLinkedServiceTypeProperties.
func (f *FileServerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &f.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &f.Host)
			delete(rawMsg, key)
		case "password":
			f.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userId":
			err = unpopulate(val, "UserID", &f.UserID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileServerLocation.
func (f FileServerLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &f.FileName)
	populate(objectMap, "folderPath", &f.FolderPath)
	objectMap["type"] = "FileServerLocation"
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileServerLocation.
func (f *FileServerLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &f.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &f.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileServerReadSettings.
func (f FileServerReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &f.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &f.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", f.EnablePartitionDiscovery)
	populate(objectMap, "fileFilter", &f.FileFilter)
	populate(objectMap, "fileListPath", &f.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &f.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &f.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &f.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &f.PartitionRootPath)
	populate(objectMap, "recursive", &f.Recursive)
	objectMap["type"] = "FileServerReadSettings"
	populate(objectMap, "wildcardFileName", &f.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &f.WildcardFolderPath)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileServerReadSettings.
func (f *FileServerReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &f.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &f.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &f.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileFilter":
			err = unpopulate(val, "FileFilter", &f.FileFilter)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &f.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &f.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &f.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &f.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &f.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &f.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &f.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &f.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileServerWriteSettings.
func (f FileServerWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &f.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &f.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &f.MaxConcurrentConnections)
	objectMap["type"] = "FileServerWriteSettings"
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileServerWriteSettings.
func (f *FileServerWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &f.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &f.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &f.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileShareDataset.
func (f FileShareDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", f.Annotations)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "folder", f.Folder)
	populate(objectMap, "linkedServiceName", f.LinkedServiceName)
	populate(objectMap, "parameters", f.Parameters)
	populate(objectMap, "schema", &f.Schema)
	populate(objectMap, "structure", &f.Structure)
	objectMap["type"] = "FileShare"
	populate(objectMap, "typeProperties", f.TypeProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareDataset.
func (f *FileShareDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &f.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &f.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &f.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &f.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &f.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &f.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileShareDatasetTypeProperties.
func (f FileShareDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", f.Compression)
	populate(objectMap, "fileFilter", &f.FileFilter)
	populate(objectMap, "fileName", &f.FileName)
	populate(objectMap, "folderPath", &f.FolderPath)
	populate(objectMap, "format", f.Format)
	populate(objectMap, "modifiedDatetimeEnd", &f.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &f.ModifiedDatetimeStart)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareDatasetTypeProperties.
func (f *FileShareDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &f.Compression)
			delete(rawMsg, key)
		case "fileFilter":
			err = unpopulate(val, "FileFilter", &f.FileFilter)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &f.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &f.FolderPath)
			delete(rawMsg, key)
		case "format":
			f.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &f.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &f.ModifiedDatetimeStart)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileSystemSink.
func (f FileSystemSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &f.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &f.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &f.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &f.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &f.SinkRetryWait)
	objectMap["type"] = "FileSystemSink"
	populate(objectMap, "writeBatchSize", &f.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &f.WriteBatchTimeout)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileSystemSink.
func (f *FileSystemSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &f.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &f.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &f.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &f.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &f.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &f.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &f.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FileSystemSource.
func (f FileSystemSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &f.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &f.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &f.MaxConcurrentConnections)
	populate(objectMap, "recursive", &f.Recursive)
	populate(objectMap, "sourceRetryCount", &f.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &f.SourceRetryWait)
	objectMap["type"] = "FileSystemSource"
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FileSystemSource.
func (f *FileSystemSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &f.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &f.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &f.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &f.Recursive)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &f.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &f.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FilterActivity.
func (f FilterActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", f.DependsOn)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "name", f.Name)
	objectMap["type"] = "Filter"
	populate(objectMap, "typeProperties", f.TypeProperties)
	populate(objectMap, "userProperties", f.UserProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FilterActivity.
func (f *FilterActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &f.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &f.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &f.UserProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FilterActivityTypeProperties.
func (f FilterActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "condition", f.Condition)
	populate(objectMap, "items", f.Items)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type Flowlet.
func (f Flowlet) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", f.Annotations)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "folder", f.Folder)
	objectMap["type"] = "Flowlet"
	populate(objectMap, "typeProperties", f.TypeProperties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Flowlet.
func (f *Flowlet) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &f.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &f.Folder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FlowletTypeProperties.
func (f FlowletTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "script", f.Script)
	populate(objectMap, "scriptLines", f.ScriptLines)
	populate(objectMap, "sinks", f.Sinks)
	populate(objectMap, "sources", f.Sources)
	populate(objectMap, "transformations", f.Transformations)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FlowletTypeProperties.
func (f *FlowletTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "script":
			err = unpopulate(val, "Script", &f.Script)
			delete(rawMsg, key)
		case "scriptLines":
			err = unpopulate(val, "ScriptLines", &f.ScriptLines)
			delete(rawMsg, key)
		case "sinks":
			err = unpopulate(val, "Sinks", &f.Sinks)
			delete(rawMsg, key)
		case "sources":
			err = unpopulate(val, "Sources", &f.Sources)
			delete(rawMsg, key)
		case "transformations":
			err = unpopulate(val, "Transformations", &f.Transformations)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ForEachActivity.
func (f ForEachActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", f.DependsOn)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "name", f.Name)
	objectMap["type"] = "ForEach"
	populate(objectMap, "typeProperties", f.TypeProperties)
	populate(objectMap, "userProperties", f.UserProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ForEachActivity.
func (f *ForEachActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &f.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &f.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &f.UserProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ForEachActivityTypeProperties.
func (f ForEachActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activities", f.Activities)
	populate(objectMap, "batchCount", f.BatchCount)
	populate(objectMap, "isSequential", f.IsSequential)
	populate(objectMap, "items", f.Items)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ForEachActivityTypeProperties.
func (f *ForEachActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activities":
			f.Activities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		case "batchCount":
			err = unpopulate(val, "BatchCount", &f.BatchCount)
			delete(rawMsg, key)
		case "isSequential":
			err = unpopulate(val, "IsSequential", &f.IsSequential)
			delete(rawMsg, key)
		case "items":
			err = unpopulate(val, "Items", &f.Items)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FormatReadSettings.
func (f FormatReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["type"] = f.Type
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type FormatWriteSettings.
func (f FormatWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["type"] = f.Type
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type FtpReadSettings.
func (f FtpReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &f.DeleteFilesAfterCompletion)
	populate(objectMap, "disableChunking", &f.DisableChunking)
	populate(objectMap, "disableMetricsCollection", &f.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", f.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &f.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &f.MaxConcurrentConnections)
	populate(objectMap, "partitionRootPath", &f.PartitionRootPath)
	populate(objectMap, "recursive", &f.Recursive)
	objectMap["type"] = "FtpReadSettings"
	populate(objectMap, "useBinaryTransfer", f.UseBinaryTransfer)
	populate(objectMap, "wildcardFileName", &f.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &f.WildcardFolderPath)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FtpReadSettings.
func (f *FtpReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &f.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableChunking":
			err = unpopulate(val, "DisableChunking", &f.DisableChunking)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &f.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &f.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &f.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &f.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &f.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &f.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "useBinaryTransfer":
			err = unpopulate(val, "UseBinaryTransfer", &f.UseBinaryTransfer)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &f.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &f.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FtpServerLinkedService.
func (f FtpServerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", f.Annotations)
	populate(objectMap, "connectVia", f.ConnectVia)
	populate(objectMap, "description", f.Description)
	populate(objectMap, "parameters", f.Parameters)
	objectMap["type"] = "FtpServer"
	populate(objectMap, "typeProperties", f.TypeProperties)
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FtpServerLinkedService.
func (f *FtpServerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &f.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &f.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &f.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &f.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &f.TypeProperties)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FtpServerLinkedServiceTypeProperties.
func (f FtpServerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", f.AuthenticationType)
	populate(objectMap, "enableSsl", &f.EnableSSL)
	populate(objectMap, "enableServerCertificateValidation", &f.EnableServerCertificateValidation)
	populate(objectMap, "encryptedCredential", &f.EncryptedCredential)
	populate(objectMap, "host", &f.Host)
	populate(objectMap, "password", f.Password)
	populate(objectMap, "port", &f.Port)
	populate(objectMap, "userName", &f.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FtpServerLinkedServiceTypeProperties.
func (f *FtpServerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &f.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &f.EnableSSL)
			delete(rawMsg, key)
		case "enableServerCertificateValidation":
			err = unpopulate(val, "EnableServerCertificateValidation", &f.EnableServerCertificateValidation)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &f.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &f.Host)
			delete(rawMsg, key)
		case "password":
			f.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &f.Port)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &f.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type FtpServerLocation.
func (f FtpServerLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &f.FileName)
	populate(objectMap, "folderPath", &f.FolderPath)
	objectMap["type"] = "FtpServerLocation"
	if f.AdditionalProperties != nil {
		for key, val := range f.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type FtpServerLocation.
func (f *FtpServerLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", f, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &f.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &f.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &f.Type)
			delete(rawMsg, key)
		default:
			if f.AdditionalProperties == nil {
				f.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				f.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", f, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GenericDatasetTypeProperties.
func (g GenericDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &g.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type GetMetadataActivity.
func (g GetMetadataActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", g.DependsOn)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "linkedServiceName", g.LinkedServiceName)
	populate(objectMap, "name", g.Name)
	populate(objectMap, "policy", g.Policy)
	objectMap["type"] = "GetMetadata"
	populate(objectMap, "typeProperties", g.TypeProperties)
	populate(objectMap, "userProperties", g.UserProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GetMetadataActivity.
func (g *GetMetadataActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &g.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &g.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &g.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &g.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &g.UserProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GetMetadataActivityTypeProperties.
func (g GetMetadataActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", g.Dataset)
	populate(objectMap, "fieldList", g.FieldList)
	populate(objectMap, "formatSettings", g.FormatSettings)
	populate(objectMap, "storeSettings", g.StoreSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GetMetadataActivityTypeProperties.
func (g *GetMetadataActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &g.Dataset)
			delete(rawMsg, key)
		case "fieldList":
			err = unpopulate(val, "FieldList", &g.FieldList)
			delete(rawMsg, key)
		case "formatSettings":
			g.FormatSettings, err = unmarshalFormatReadSettingsClassification(val)
			delete(rawMsg, key)
		case "storeSettings":
			g.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GetSsisObjectMetadataRequest.
func (g GetSsisObjectMetadataRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "metadataPath", g.MetadataPath)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type GitHubAccessTokenRequest.
func (g GitHubAccessTokenRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "gitHubAccessCode", g.GitHubAccessCode)
	populate(objectMap, "gitHubAccessTokenBaseUrl", g.GitHubAccessTokenBaseURL)
	populate(objectMap, "gitHubClientId", g.GitHubClientID)
	populate(objectMap, "gitHubClientSecret", g.GitHubClientSecret)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubAccessTokenRequest.
func (g *GitHubAccessTokenRequest) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "gitHubAccessCode":
			err = unpopulate(val, "GitHubAccessCode", &g.GitHubAccessCode)
			delete(rawMsg, key)
		case "gitHubAccessTokenBaseUrl":
			err = unpopulate(val, "GitHubAccessTokenBaseURL", &g.GitHubAccessTokenBaseURL)
			delete(rawMsg, key)
		case "gitHubClientId":
			err = unpopulate(val, "GitHubClientID", &g.GitHubClientID)
			delete(rawMsg, key)
		case "gitHubClientSecret":
			err = unpopulate(val, "GitHubClientSecret", &g.GitHubClientSecret)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GitHubAccessTokenResponse.
func (g GitHubAccessTokenResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "gitHubAccessToken", g.GitHubAccessToken)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type GitHubClientSecret.
func (g GitHubClientSecret) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "byoaSecretAkvUrl", g.ByoaSecretAkvURL)
	populate(objectMap, "byoaSecretName", g.ByoaSecretName)
	return json.Marshal(objectMap)
}

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

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type GoogleAdWordsLinkedService.
func (g GoogleAdWordsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "connectVia", g.ConnectVia)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "parameters", g.Parameters)
	objectMap["type"] = "GoogleAdWords"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleAdWordsLinkedService.
func (g *GoogleAdWordsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &g.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleAdWordsLinkedServiceTypeProperties.
func (g GoogleAdWordsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", g.AuthenticationType)
	populate(objectMap, "clientCustomerID", &g.ClientCustomerID)
	populate(objectMap, "clientId", &g.ClientID)
	populate(objectMap, "clientSecret", g.ClientSecret)
	populate(objectMap, "connectionProperties", &g.ConnectionProperties)
	populate(objectMap, "developerToken", g.DeveloperToken)
	populate(objectMap, "email", &g.Email)
	populate(objectMap, "encryptedCredential", &g.EncryptedCredential)
	populate(objectMap, "keyFilePath", &g.KeyFilePath)
	populate(objectMap, "refreshToken", g.RefreshToken)
	populate(objectMap, "trustedCertPath", &g.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &g.UseSystemTrustStore)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleAdWordsLinkedServiceTypeProperties.
func (g *GoogleAdWordsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &g.AuthenticationType)
			delete(rawMsg, key)
		case "clientCustomerID":
			err = unpopulate(val, "ClientCustomerID", &g.ClientCustomerID)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &g.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			g.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &g.ConnectionProperties)
			delete(rawMsg, key)
		case "developerToken":
			g.DeveloperToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "email":
			err = unpopulate(val, "Email", &g.Email)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &g.EncryptedCredential)
			delete(rawMsg, key)
		case "keyFilePath":
			err = unpopulate(val, "KeyFilePath", &g.KeyFilePath)
			delete(rawMsg, key)
		case "refreshToken":
			g.RefreshToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &g.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &g.UseSystemTrustStore)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleAdWordsObjectDataset.
func (g GoogleAdWordsObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "folder", g.Folder)
	populate(objectMap, "linkedServiceName", g.LinkedServiceName)
	populate(objectMap, "parameters", g.Parameters)
	populate(objectMap, "schema", &g.Schema)
	populate(objectMap, "structure", &g.Structure)
	objectMap["type"] = "GoogleAdWordsObject"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleAdWordsObjectDataset.
func (g *GoogleAdWordsObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &g.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &g.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &g.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &g.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleAdWordsSource.
func (g GoogleAdWordsSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &g.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &g.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &g.MaxConcurrentConnections)
	populate(objectMap, "query", &g.Query)
	populate(objectMap, "queryTimeout", &g.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &g.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &g.SourceRetryWait)
	objectMap["type"] = "GoogleAdWordsSource"
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleAdWordsSource.
func (g *GoogleAdWordsSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &g.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &g.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &g.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &g.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &g.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &g.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &g.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleBigQueryDatasetTypeProperties.
func (g GoogleBigQueryDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", &g.Dataset)
	populate(objectMap, "table", &g.Table)
	populate(objectMap, "tableName", &g.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleBigQueryDatasetTypeProperties.
func (g *GoogleBigQueryDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &g.Dataset)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &g.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &g.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleBigQueryLinkedService.
func (g GoogleBigQueryLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "connectVia", g.ConnectVia)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "parameters", g.Parameters)
	objectMap["type"] = "GoogleBigQuery"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleBigQueryLinkedService.
func (g *GoogleBigQueryLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &g.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleBigQueryLinkedServiceTypeProperties.
func (g GoogleBigQueryLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalProjects", &g.AdditionalProjects)
	populate(objectMap, "authenticationType", g.AuthenticationType)
	populate(objectMap, "clientId", &g.ClientID)
	populate(objectMap, "clientSecret", g.ClientSecret)
	populate(objectMap, "email", &g.Email)
	populate(objectMap, "encryptedCredential", &g.EncryptedCredential)
	populate(objectMap, "keyFilePath", &g.KeyFilePath)
	populate(objectMap, "project", &g.Project)
	populate(objectMap, "refreshToken", g.RefreshToken)
	populate(objectMap, "requestGoogleDriveScope", &g.RequestGoogleDriveScope)
	populate(objectMap, "trustedCertPath", &g.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &g.UseSystemTrustStore)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleBigQueryLinkedServiceTypeProperties.
func (g *GoogleBigQueryLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalProjects":
			err = unpopulate(val, "AdditionalProjects", &g.AdditionalProjects)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &g.AuthenticationType)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &g.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			g.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "email":
			err = unpopulate(val, "Email", &g.Email)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &g.EncryptedCredential)
			delete(rawMsg, key)
		case "keyFilePath":
			err = unpopulate(val, "KeyFilePath", &g.KeyFilePath)
			delete(rawMsg, key)
		case "project":
			err = unpopulate(val, "Project", &g.Project)
			delete(rawMsg, key)
		case "refreshToken":
			g.RefreshToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "requestGoogleDriveScope":
			err = unpopulate(val, "RequestGoogleDriveScope", &g.RequestGoogleDriveScope)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &g.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &g.UseSystemTrustStore)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleBigQueryObjectDataset.
func (g GoogleBigQueryObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "folder", g.Folder)
	populate(objectMap, "linkedServiceName", g.LinkedServiceName)
	populate(objectMap, "parameters", g.Parameters)
	populate(objectMap, "schema", &g.Schema)
	populate(objectMap, "structure", &g.Structure)
	objectMap["type"] = "GoogleBigQueryObject"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleBigQueryObjectDataset.
func (g *GoogleBigQueryObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &g.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &g.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &g.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &g.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleBigQuerySource.
func (g GoogleBigQuerySource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &g.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &g.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &g.MaxConcurrentConnections)
	populate(objectMap, "query", &g.Query)
	populate(objectMap, "queryTimeout", &g.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &g.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &g.SourceRetryWait)
	objectMap["type"] = "GoogleBigQuerySource"
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleBigQuerySource.
func (g *GoogleBigQuerySource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &g.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &g.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &g.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &g.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &g.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &g.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &g.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleCloudStorageLinkedService.
func (g GoogleCloudStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "connectVia", g.ConnectVia)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "parameters", g.Parameters)
	objectMap["type"] = "GoogleCloudStorage"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleCloudStorageLinkedService.
func (g *GoogleCloudStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &g.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleCloudStorageLinkedServiceTypeProperties.
func (g GoogleCloudStorageLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKeyId", &g.AccessKeyID)
	populate(objectMap, "encryptedCredential", &g.EncryptedCredential)
	populate(objectMap, "secretAccessKey", g.SecretAccessKey)
	populate(objectMap, "serviceUrl", &g.ServiceURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleCloudStorageLinkedServiceTypeProperties.
func (g *GoogleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKeyId":
			err = unpopulate(val, "AccessKeyID", &g.AccessKeyID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &g.EncryptedCredential)
			delete(rawMsg, key)
		case "secretAccessKey":
			g.SecretAccessKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "serviceUrl":
			err = unpopulate(val, "ServiceURL", &g.ServiceURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleCloudStorageLocation.
func (g GoogleCloudStorageLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &g.BucketName)
	populate(objectMap, "fileName", &g.FileName)
	populate(objectMap, "folderPath", &g.FolderPath)
	objectMap["type"] = "GoogleCloudStorageLocation"
	populate(objectMap, "version", &g.Version)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleCloudStorageLocation.
func (g *GoogleCloudStorageLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "bucketName":
			err = unpopulate(val, "BucketName", &g.BucketName)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &g.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &g.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &g.Version)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleCloudStorageReadSettings.
func (g GoogleCloudStorageReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &g.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &g.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", g.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &g.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &g.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &g.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &g.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &g.PartitionRootPath)
	populate(objectMap, "prefix", &g.Prefix)
	populate(objectMap, "recursive", &g.Recursive)
	objectMap["type"] = "GoogleCloudStorageReadSettings"
	populate(objectMap, "wildcardFileName", &g.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &g.WildcardFolderPath)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleCloudStorageReadSettings.
func (g *GoogleCloudStorageReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &g.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &g.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &g.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &g.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &g.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &g.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &g.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &g.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &g.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &g.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &g.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &g.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleSheetsLinkedService.
func (g GoogleSheetsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "connectVia", g.ConnectVia)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "parameters", g.Parameters)
	objectMap["type"] = "GoogleSheets"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleSheetsLinkedService.
func (g *GoogleSheetsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &g.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GoogleSheetsLinkedServiceTypeProperties.
func (g GoogleSheetsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", g.APIToken)
	populate(objectMap, "encryptedCredential", &g.EncryptedCredential)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GoogleSheetsLinkedServiceTypeProperties.
func (g *GoogleSheetsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiToken":
			g.APIToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &g.EncryptedCredential)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GreenplumDatasetTypeProperties.
func (g GreenplumDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &g.Schema)
	populate(objectMap, "table", &g.Table)
	populate(objectMap, "tableName", &g.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GreenplumDatasetTypeProperties.
func (g *GreenplumDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &g.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &g.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &g.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GreenplumLinkedService.
func (g GreenplumLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "connectVia", g.ConnectVia)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "parameters", g.Parameters)
	objectMap["type"] = "Greenplum"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GreenplumLinkedService.
func (g *GreenplumLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &g.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GreenplumLinkedServiceTypeProperties.
func (g GreenplumLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &g.ConnectionString)
	populate(objectMap, "encryptedCredential", &g.EncryptedCredential)
	populate(objectMap, "pwd", g.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GreenplumLinkedServiceTypeProperties.
func (g *GreenplumLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &g.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &g.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &g.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GreenplumSource.
func (g GreenplumSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &g.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &g.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &g.MaxConcurrentConnections)
	populate(objectMap, "query", &g.Query)
	populate(objectMap, "queryTimeout", &g.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &g.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &g.SourceRetryWait)
	objectMap["type"] = "GreenplumSource"
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GreenplumSource.
func (g *GreenplumSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &g.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &g.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &g.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &g.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &g.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &g.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &g.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type GreenplumTableDataset.
func (g GreenplumTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", g.Annotations)
	populate(objectMap, "description", g.Description)
	populate(objectMap, "folder", g.Folder)
	populate(objectMap, "linkedServiceName", g.LinkedServiceName)
	populate(objectMap, "parameters", g.Parameters)
	populate(objectMap, "schema", &g.Schema)
	populate(objectMap, "structure", &g.Structure)
	objectMap["type"] = "GreenplumTable"
	populate(objectMap, "typeProperties", g.TypeProperties)
	if g.AdditionalProperties != nil {
		for key, val := range g.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type GreenplumTableDataset.
func (g *GreenplumTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", g, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &g.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &g.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &g.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &g.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &g.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &g.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &g.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &g.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &g.TypeProperties)
			delete(rawMsg, key)
		default:
			if g.AdditionalProperties == nil {
				g.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				g.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", g, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HBaseLinkedService.
func (h HBaseLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "HBase"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HBaseLinkedService.
func (h *HBaseLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HBaseLinkedServiceTypeProperties.
func (h HBaseLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &h.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &h.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", h.AuthenticationType)
	populate(objectMap, "enableSsl", &h.EnableSSL)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "httpPath", &h.HTTPPath)
	populate(objectMap, "host", &h.Host)
	populate(objectMap, "password", h.Password)
	populate(objectMap, "port", &h.Port)
	populate(objectMap, "trustedCertPath", &h.TrustedCertPath)
	populate(objectMap, "username", &h.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HBaseLinkedServiceTypeProperties.
func (h *HBaseLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &h.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &h.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &h.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &h.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "httpPath":
			err = unpopulate(val, "HTTPPath", &h.HTTPPath)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &h.Host)
			delete(rawMsg, key)
		case "password":
			h.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &h.Port)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &h.TrustedCertPath)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &h.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HBaseObjectDataset.
func (h HBaseObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "folder", h.Folder)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "parameters", h.Parameters)
	populate(objectMap, "schema", &h.Schema)
	populate(objectMap, "structure", &h.Structure)
	objectMap["type"] = "HBaseObject"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HBaseObjectDataset.
func (h *HBaseObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &h.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &h.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &h.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HBaseSource.
func (h HBaseSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &h.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "query", &h.Query)
	populate(objectMap, "queryTimeout", &h.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &h.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &h.SourceRetryWait)
	objectMap["type"] = "HBaseSource"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HBaseSource.
func (h *HBaseSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &h.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &h.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &h.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &h.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &h.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightHiveActivity.
func (h HDInsightHiveActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", h.DependsOn)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "policy", h.Policy)
	objectMap["type"] = "HDInsightHive"
	populate(objectMap, "typeProperties", h.TypeProperties)
	populate(objectMap, "userProperties", h.UserProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightHiveActivity.
func (h *HDInsightHiveActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &h.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &h.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &h.UserProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightHiveActivityTypeProperties.
func (h HDInsightHiveActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "arguments", h.Arguments)
	populate(objectMap, "defines", h.Defines)
	populate(objectMap, "getDebugInfo", h.GetDebugInfo)
	populate(objectMap, "queryTimeout", h.QueryTimeout)
	populate(objectMap, "scriptLinkedService", h.ScriptLinkedService)
	populate(objectMap, "scriptPath", &h.ScriptPath)
	populate(objectMap, "storageLinkedServices", h.StorageLinkedServices)
	populate(objectMap, "variables", h.Variables)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightHiveActivityTypeProperties.
func (h *HDInsightHiveActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "arguments":
			err = unpopulate(val, "Arguments", &h.Arguments)
			delete(rawMsg, key)
		case "defines":
			err = unpopulate(val, "Defines", &h.Defines)
			delete(rawMsg, key)
		case "getDebugInfo":
			err = unpopulate(val, "GetDebugInfo", &h.GetDebugInfo)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &h.QueryTimeout)
			delete(rawMsg, key)
		case "scriptLinkedService":
			err = unpopulate(val, "ScriptLinkedService", &h.ScriptLinkedService)
			delete(rawMsg, key)
		case "scriptPath":
			err = unpopulate(val, "ScriptPath", &h.ScriptPath)
			delete(rawMsg, key)
		case "storageLinkedServices":
			err = unpopulate(val, "StorageLinkedServices", &h.StorageLinkedServices)
			delete(rawMsg, key)
		case "variables":
			err = unpopulate(val, "Variables", &h.Variables)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightLinkedService.
func (h HDInsightLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "HDInsight"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightLinkedService.
func (h *HDInsightLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightLinkedServiceTypeProperties.
func (h HDInsightLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clusterUri", &h.ClusterURI)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "fileSystem", &h.FileSystem)
	populate(objectMap, "hcatalogLinkedServiceName", h.HcatalogLinkedServiceName)
	populate(objectMap, "isEspEnabled", &h.IsEspEnabled)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "password", h.Password)
	populate(objectMap, "userName", &h.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightLinkedServiceTypeProperties.
func (h *HDInsightLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clusterUri":
			err = unpopulate(val, "ClusterURI", &h.ClusterURI)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "fileSystem":
			err = unpopulate(val, "FileSystem", &h.FileSystem)
			delete(rawMsg, key)
		case "hcatalogLinkedServiceName":
			err = unpopulate(val, "HcatalogLinkedServiceName", &h.HcatalogLinkedServiceName)
			delete(rawMsg, key)
		case "isEspEnabled":
			err = unpopulate(val, "IsEspEnabled", &h.IsEspEnabled)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "password":
			h.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &h.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightMapReduceActivity.
func (h HDInsightMapReduceActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", h.DependsOn)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "policy", h.Policy)
	objectMap["type"] = "HDInsightMapReduce"
	populate(objectMap, "typeProperties", h.TypeProperties)
	populate(objectMap, "userProperties", h.UserProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightMapReduceActivity.
func (h *HDInsightMapReduceActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &h.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &h.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &h.UserProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightMapReduceActivityTypeProperties.
func (h HDInsightMapReduceActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "arguments", h.Arguments)
	populate(objectMap, "className", &h.ClassName)
	populate(objectMap, "defines", h.Defines)
	populate(objectMap, "getDebugInfo", h.GetDebugInfo)
	populate(objectMap, "jarFilePath", &h.JarFilePath)
	populate(objectMap, "jarLibs", h.JarLibs)
	populate(objectMap, "jarLinkedService", h.JarLinkedService)
	populate(objectMap, "storageLinkedServices", h.StorageLinkedServices)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightMapReduceActivityTypeProperties.
func (h *HDInsightMapReduceActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "arguments":
			err = unpopulate(val, "Arguments", &h.Arguments)
			delete(rawMsg, key)
		case "className":
			err = unpopulate(val, "ClassName", &h.ClassName)
			delete(rawMsg, key)
		case "defines":
			err = unpopulate(val, "Defines", &h.Defines)
			delete(rawMsg, key)
		case "getDebugInfo":
			err = unpopulate(val, "GetDebugInfo", &h.GetDebugInfo)
			delete(rawMsg, key)
		case "jarFilePath":
			err = unpopulate(val, "JarFilePath", &h.JarFilePath)
			delete(rawMsg, key)
		case "jarLibs":
			err = unpopulate(val, "JarLibs", &h.JarLibs)
			delete(rawMsg, key)
		case "jarLinkedService":
			err = unpopulate(val, "JarLinkedService", &h.JarLinkedService)
			delete(rawMsg, key)
		case "storageLinkedServices":
			err = unpopulate(val, "StorageLinkedServices", &h.StorageLinkedServices)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightOnDemandLinkedService.
func (h HDInsightOnDemandLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "HDInsightOnDemand"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightOnDemandLinkedService.
func (h *HDInsightOnDemandLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightOnDemandLinkedServiceTypeProperties.
func (h HDInsightOnDemandLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalLinkedServiceNames", h.AdditionalLinkedServiceNames)
	populate(objectMap, "clusterNamePrefix", &h.ClusterNamePrefix)
	populate(objectMap, "clusterPassword", h.ClusterPassword)
	populate(objectMap, "clusterResourceGroup", &h.ClusterResourceGroup)
	populate(objectMap, "clusterSshPassword", h.ClusterSSHPassword)
	populate(objectMap, "clusterSshUserName", &h.ClusterSSHUserName)
	populate(objectMap, "clusterSize", &h.ClusterSize)
	populate(objectMap, "clusterType", &h.ClusterType)
	populate(objectMap, "clusterUserName", &h.ClusterUserName)
	populate(objectMap, "coreConfiguration", &h.CoreConfiguration)
	populate(objectMap, "credential", h.Credential)
	populate(objectMap, "dataNodeSize", &h.DataNodeSize)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "hBaseConfiguration", &h.HBaseConfiguration)
	populate(objectMap, "hcatalogLinkedServiceName", h.HcatalogLinkedServiceName)
	populate(objectMap, "hdfsConfiguration", &h.HdfsConfiguration)
	populate(objectMap, "headNodeSize", &h.HeadNodeSize)
	populate(objectMap, "hiveConfiguration", &h.HiveConfiguration)
	populate(objectMap, "hostSubscriptionId", &h.HostSubscriptionID)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "mapReduceConfiguration", &h.MapReduceConfiguration)
	populate(objectMap, "oozieConfiguration", &h.OozieConfiguration)
	populate(objectMap, "scriptActions", h.ScriptActions)
	populate(objectMap, "servicePrincipalId", &h.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", h.ServicePrincipalKey)
	populate(objectMap, "sparkVersion", &h.SparkVersion)
	populate(objectMap, "stormConfiguration", &h.StormConfiguration)
	populate(objectMap, "subnetName", &h.SubnetName)
	populate(objectMap, "tenant", &h.Tenant)
	populate(objectMap, "timeToLive", &h.TimeToLive)
	populate(objectMap, "version", &h.Version)
	populate(objectMap, "virtualNetworkId", &h.VirtualNetworkID)
	populate(objectMap, "yarnConfiguration", &h.YarnConfiguration)
	populate(objectMap, "zookeeperNodeSize", &h.ZookeeperNodeSize)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightOnDemandLinkedServiceTypeProperties.
func (h *HDInsightOnDemandLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalLinkedServiceNames":
			err = unpopulate(val, "AdditionalLinkedServiceNames", &h.AdditionalLinkedServiceNames)
			delete(rawMsg, key)
		case "clusterNamePrefix":
			err = unpopulate(val, "ClusterNamePrefix", &h.ClusterNamePrefix)
			delete(rawMsg, key)
		case "clusterPassword":
			h.ClusterPassword, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "clusterResourceGroup":
			err = unpopulate(val, "ClusterResourceGroup", &h.ClusterResourceGroup)
			delete(rawMsg, key)
		case "clusterSshPassword":
			h.ClusterSSHPassword, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "clusterSshUserName":
			err = unpopulate(val, "ClusterSSHUserName", &h.ClusterSSHUserName)
			delete(rawMsg, key)
		case "clusterSize":
			err = unpopulate(val, "ClusterSize", &h.ClusterSize)
			delete(rawMsg, key)
		case "clusterType":
			err = unpopulate(val, "ClusterType", &h.ClusterType)
			delete(rawMsg, key)
		case "clusterUserName":
			err = unpopulate(val, "ClusterUserName", &h.ClusterUserName)
			delete(rawMsg, key)
		case "coreConfiguration":
			err = unpopulate(val, "CoreConfiguration", &h.CoreConfiguration)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &h.Credential)
			delete(rawMsg, key)
		case "dataNodeSize":
			err = unpopulate(val, "DataNodeSize", &h.DataNodeSize)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "hBaseConfiguration":
			err = unpopulate(val, "HBaseConfiguration", &h.HBaseConfiguration)
			delete(rawMsg, key)
		case "hcatalogLinkedServiceName":
			err = unpopulate(val, "HcatalogLinkedServiceName", &h.HcatalogLinkedServiceName)
			delete(rawMsg, key)
		case "hdfsConfiguration":
			err = unpopulate(val, "HdfsConfiguration", &h.HdfsConfiguration)
			delete(rawMsg, key)
		case "headNodeSize":
			err = unpopulate(val, "HeadNodeSize", &h.HeadNodeSize)
			delete(rawMsg, key)
		case "hiveConfiguration":
			err = unpopulate(val, "HiveConfiguration", &h.HiveConfiguration)
			delete(rawMsg, key)
		case "hostSubscriptionId":
			err = unpopulate(val, "HostSubscriptionID", &h.HostSubscriptionID)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "mapReduceConfiguration":
			err = unpopulate(val, "MapReduceConfiguration", &h.MapReduceConfiguration)
			delete(rawMsg, key)
		case "oozieConfiguration":
			err = unpopulate(val, "OozieConfiguration", &h.OozieConfiguration)
			delete(rawMsg, key)
		case "scriptActions":
			err = unpopulate(val, "ScriptActions", &h.ScriptActions)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &h.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			h.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "sparkVersion":
			err = unpopulate(val, "SparkVersion", &h.SparkVersion)
			delete(rawMsg, key)
		case "stormConfiguration":
			err = unpopulate(val, "StormConfiguration", &h.StormConfiguration)
			delete(rawMsg, key)
		case "subnetName":
			err = unpopulate(val, "SubnetName", &h.SubnetName)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &h.Tenant)
			delete(rawMsg, key)
		case "timeToLive":
			err = unpopulate(val, "TimeToLive", &h.TimeToLive)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &h.Version)
			delete(rawMsg, key)
		case "virtualNetworkId":
			err = unpopulate(val, "VirtualNetworkID", &h.VirtualNetworkID)
			delete(rawMsg, key)
		case "yarnConfiguration":
			err = unpopulate(val, "YarnConfiguration", &h.YarnConfiguration)
			delete(rawMsg, key)
		case "zookeeperNodeSize":
			err = unpopulate(val, "ZookeeperNodeSize", &h.ZookeeperNodeSize)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightPigActivity.
func (h HDInsightPigActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", h.DependsOn)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "policy", h.Policy)
	objectMap["type"] = "HDInsightPig"
	populate(objectMap, "typeProperties", h.TypeProperties)
	populate(objectMap, "userProperties", h.UserProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightPigActivity.
func (h *HDInsightPigActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &h.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &h.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &h.UserProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightPigActivityTypeProperties.
func (h HDInsightPigActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "arguments", &h.Arguments)
	populate(objectMap, "defines", h.Defines)
	populate(objectMap, "getDebugInfo", h.GetDebugInfo)
	populate(objectMap, "scriptLinkedService", h.ScriptLinkedService)
	populate(objectMap, "scriptPath", &h.ScriptPath)
	populate(objectMap, "storageLinkedServices", h.StorageLinkedServices)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightPigActivityTypeProperties.
func (h *HDInsightPigActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "arguments":
			err = unpopulate(val, "Arguments", &h.Arguments)
			delete(rawMsg, key)
		case "defines":
			err = unpopulate(val, "Defines", &h.Defines)
			delete(rawMsg, key)
		case "getDebugInfo":
			err = unpopulate(val, "GetDebugInfo", &h.GetDebugInfo)
			delete(rawMsg, key)
		case "scriptLinkedService":
			err = unpopulate(val, "ScriptLinkedService", &h.ScriptLinkedService)
			delete(rawMsg, key)
		case "scriptPath":
			err = unpopulate(val, "ScriptPath", &h.ScriptPath)
			delete(rawMsg, key)
		case "storageLinkedServices":
			err = unpopulate(val, "StorageLinkedServices", &h.StorageLinkedServices)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightSparkActivity.
func (h HDInsightSparkActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", h.DependsOn)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "policy", h.Policy)
	objectMap["type"] = "HDInsightSpark"
	populate(objectMap, "typeProperties", h.TypeProperties)
	populate(objectMap, "userProperties", h.UserProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightSparkActivity.
func (h *HDInsightSparkActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &h.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &h.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &h.UserProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightSparkActivityTypeProperties.
func (h HDInsightSparkActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "arguments", h.Arguments)
	populate(objectMap, "className", h.ClassName)
	populate(objectMap, "entryFilePath", &h.EntryFilePath)
	populate(objectMap, "getDebugInfo", h.GetDebugInfo)
	populate(objectMap, "proxyUser", &h.ProxyUser)
	populate(objectMap, "rootPath", &h.RootPath)
	populate(objectMap, "sparkConfig", h.SparkConfig)
	populate(objectMap, "sparkJobLinkedService", h.SparkJobLinkedService)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightSparkActivityTypeProperties.
func (h *HDInsightSparkActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "arguments":
			err = unpopulate(val, "Arguments", &h.Arguments)
			delete(rawMsg, key)
		case "className":
			err = unpopulate(val, "ClassName", &h.ClassName)
			delete(rawMsg, key)
		case "entryFilePath":
			err = unpopulate(val, "EntryFilePath", &h.EntryFilePath)
			delete(rawMsg, key)
		case "getDebugInfo":
			err = unpopulate(val, "GetDebugInfo", &h.GetDebugInfo)
			delete(rawMsg, key)
		case "proxyUser":
			err = unpopulate(val, "ProxyUser", &h.ProxyUser)
			delete(rawMsg, key)
		case "rootPath":
			err = unpopulate(val, "RootPath", &h.RootPath)
			delete(rawMsg, key)
		case "sparkConfig":
			err = unpopulate(val, "SparkConfig", &h.SparkConfig)
			delete(rawMsg, key)
		case "sparkJobLinkedService":
			err = unpopulate(val, "SparkJobLinkedService", &h.SparkJobLinkedService)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightStreamingActivity.
func (h HDInsightStreamingActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", h.DependsOn)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "name", h.Name)
	populate(objectMap, "policy", h.Policy)
	objectMap["type"] = "HDInsightStreaming"
	populate(objectMap, "typeProperties", h.TypeProperties)
	populate(objectMap, "userProperties", h.UserProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightStreamingActivity.
func (h *HDInsightStreamingActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &h.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &h.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &h.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &h.UserProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HDInsightStreamingActivityTypeProperties.
func (h HDInsightStreamingActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "arguments", h.Arguments)
	populate(objectMap, "combiner", &h.Combiner)
	populate(objectMap, "commandEnvironment", h.CommandEnvironment)
	populate(objectMap, "defines", h.Defines)
	populate(objectMap, "fileLinkedService", h.FileLinkedService)
	populate(objectMap, "filePaths", h.FilePaths)
	populate(objectMap, "getDebugInfo", h.GetDebugInfo)
	populate(objectMap, "input", &h.Input)
	populate(objectMap, "mapper", &h.Mapper)
	populate(objectMap, "output", &h.Output)
	populate(objectMap, "reducer", &h.Reducer)
	populate(objectMap, "storageLinkedServices", h.StorageLinkedServices)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HDInsightStreamingActivityTypeProperties.
func (h *HDInsightStreamingActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "arguments":
			err = unpopulate(val, "Arguments", &h.Arguments)
			delete(rawMsg, key)
		case "combiner":
			err = unpopulate(val, "Combiner", &h.Combiner)
			delete(rawMsg, key)
		case "commandEnvironment":
			err = unpopulate(val, "CommandEnvironment", &h.CommandEnvironment)
			delete(rawMsg, key)
		case "defines":
			err = unpopulate(val, "Defines", &h.Defines)
			delete(rawMsg, key)
		case "fileLinkedService":
			err = unpopulate(val, "FileLinkedService", &h.FileLinkedService)
			delete(rawMsg, key)
		case "filePaths":
			err = unpopulate(val, "FilePaths", &h.FilePaths)
			delete(rawMsg, key)
		case "getDebugInfo":
			err = unpopulate(val, "GetDebugInfo", &h.GetDebugInfo)
			delete(rawMsg, key)
		case "input":
			err = unpopulate(val, "Input", &h.Input)
			delete(rawMsg, key)
		case "mapper":
			err = unpopulate(val, "Mapper", &h.Mapper)
			delete(rawMsg, key)
		case "output":
			err = unpopulate(val, "Output", &h.Output)
			delete(rawMsg, key)
		case "reducer":
			err = unpopulate(val, "Reducer", &h.Reducer)
			delete(rawMsg, key)
		case "storageLinkedServices":
			err = unpopulate(val, "StorageLinkedServices", &h.StorageLinkedServices)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPDataset.
func (h HTTPDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "folder", h.Folder)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "parameters", h.Parameters)
	populate(objectMap, "schema", &h.Schema)
	populate(objectMap, "structure", &h.Structure)
	objectMap["type"] = "HttpFile"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPDataset.
func (h *HTTPDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &h.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &h.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &h.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPDatasetTypeProperties.
func (h HTTPDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalHeaders", &h.AdditionalHeaders)
	populate(objectMap, "compression", h.Compression)
	populate(objectMap, "format", h.Format)
	populate(objectMap, "relativeUrl", &h.RelativeURL)
	populate(objectMap, "requestBody", &h.RequestBody)
	populate(objectMap, "requestMethod", &h.RequestMethod)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPDatasetTypeProperties.
func (h *HTTPDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalHeaders":
			err = unpopulate(val, "AdditionalHeaders", &h.AdditionalHeaders)
			delete(rawMsg, key)
		case "compression":
			err = unpopulate(val, "Compression", &h.Compression)
			delete(rawMsg, key)
		case "format":
			h.Format, err = unmarshalDatasetStorageFormatClassification(val)
			delete(rawMsg, key)
		case "relativeUrl":
			err = unpopulate(val, "RelativeURL", &h.RelativeURL)
			delete(rawMsg, key)
		case "requestBody":
			err = unpopulate(val, "RequestBody", &h.RequestBody)
			delete(rawMsg, key)
		case "requestMethod":
			err = unpopulate(val, "RequestMethod", &h.RequestMethod)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPLinkedService.
func (h HTTPLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "HttpServer"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPLinkedService.
func (h *HTTPLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPLinkedServiceTypeProperties.
func (h HTTPLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authHeaders", &h.AuthHeaders)
	populate(objectMap, "authenticationType", h.AuthenticationType)
	populate(objectMap, "certThumbprint", &h.CertThumbprint)
	populate(objectMap, "embeddedCertData", &h.EmbeddedCertData)
	populate(objectMap, "enableServerCertificateValidation", &h.EnableServerCertificateValidation)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "password", h.Password)
	populate(objectMap, "url", &h.URL)
	populate(objectMap, "userName", &h.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPLinkedServiceTypeProperties.
func (h *HTTPLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authHeaders":
			err = unpopulate(val, "AuthHeaders", &h.AuthHeaders)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &h.AuthenticationType)
			delete(rawMsg, key)
		case "certThumbprint":
			err = unpopulate(val, "CertThumbprint", &h.CertThumbprint)
			delete(rawMsg, key)
		case "embeddedCertData":
			err = unpopulate(val, "EmbeddedCertData", &h.EmbeddedCertData)
			delete(rawMsg, key)
		case "enableServerCertificateValidation":
			err = unpopulate(val, "EnableServerCertificateValidation", &h.EnableServerCertificateValidation)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			h.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &h.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &h.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPReadSettings.
func (h HTTPReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalHeaders", &h.AdditionalHeaders)
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", h.EnablePartitionDiscovery)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "partitionRootPath", &h.PartitionRootPath)
	populate(objectMap, "requestBody", &h.RequestBody)
	populate(objectMap, "requestMethod", &h.RequestMethod)
	populate(objectMap, "requestTimeout", &h.RequestTimeout)
	objectMap["type"] = "HttpReadSettings"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPReadSettings.
func (h *HTTPReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalHeaders":
			err = unpopulate(val, "AdditionalHeaders", &h.AdditionalHeaders)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &h.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &h.PartitionRootPath)
			delete(rawMsg, key)
		case "requestBody":
			err = unpopulate(val, "RequestBody", &h.RequestBody)
			delete(rawMsg, key)
		case "requestMethod":
			err = unpopulate(val, "RequestMethod", &h.RequestMethod)
			delete(rawMsg, key)
		case "requestTimeout":
			err = unpopulate(val, "RequestTimeout", &h.RequestTimeout)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPServerLocation.
func (h HTTPServerLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &h.FileName)
	populate(objectMap, "folderPath", &h.FolderPath)
	populate(objectMap, "relativeUrl", &h.RelativeURL)
	objectMap["type"] = "HttpServerLocation"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPServerLocation.
func (h *HTTPServerLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &h.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &h.FolderPath)
			delete(rawMsg, key)
		case "relativeUrl":
			err = unpopulate(val, "RelativeURL", &h.RelativeURL)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HTTPSource.
func (h HTTPSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &h.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &h.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &h.SourceRetryWait)
	objectMap["type"] = "HttpSource"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPSource.
func (h *HTTPSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &h.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &h.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &h.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HdfsLinkedService.
func (h HdfsLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "Hdfs"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsLinkedService.
func (h *HdfsLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HdfsLinkedServiceTypeProperties.
func (h HdfsLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &h.AuthenticationType)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "password", h.Password)
	populate(objectMap, "url", &h.URL)
	populate(objectMap, "userName", &h.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsLinkedServiceTypeProperties.
func (h *HdfsLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &h.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			h.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &h.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &h.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HdfsLocation.
func (h HdfsLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &h.FileName)
	populate(objectMap, "folderPath", &h.FolderPath)
	objectMap["type"] = "HdfsLocation"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsLocation.
func (h *HdfsLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &h.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &h.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HdfsReadSettings.
func (h HdfsReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &h.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "distcpSettings", h.DistcpSettings)
	populate(objectMap, "enablePartitionDiscovery", h.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &h.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &h.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &h.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &h.PartitionRootPath)
	populate(objectMap, "recursive", &h.Recursive)
	objectMap["type"] = "HdfsReadSettings"
	populate(objectMap, "wildcardFileName", &h.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &h.WildcardFolderPath)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsReadSettings.
func (h *HdfsReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &h.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "distcpSettings":
			err = unpopulate(val, "DistcpSettings", &h.DistcpSettings)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &h.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &h.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &h.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &h.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &h.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &h.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &h.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &h.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HdfsSource.
func (h HdfsSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "distcpSettings", h.DistcpSettings)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "recursive", &h.Recursive)
	populate(objectMap, "sourceRetryCount", &h.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &h.SourceRetryWait)
	objectMap["type"] = "HdfsSource"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HdfsSource.
func (h *HdfsSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "distcpSettings":
			err = unpopulate(val, "DistcpSettings", &h.DistcpSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &h.Recursive)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &h.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &h.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HiveDatasetTypeProperties.
func (h HiveDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &h.Schema)
	populate(objectMap, "table", &h.Table)
	populate(objectMap, "tableName", &h.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HiveDatasetTypeProperties.
func (h *HiveDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &h.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &h.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &h.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HiveLinkedService.
func (h HiveLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "Hive"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HiveLinkedService.
func (h *HiveLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HiveLinkedServiceTypeProperties.
func (h HiveLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &h.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &h.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", h.AuthenticationType)
	populate(objectMap, "enableSsl", &h.EnableSSL)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "httpPath", &h.HTTPPath)
	populate(objectMap, "host", &h.Host)
	populate(objectMap, "password", h.Password)
	populate(objectMap, "port", &h.Port)
	populate(objectMap, "serverType", h.ServerType)
	populate(objectMap, "serviceDiscoveryMode", &h.ServiceDiscoveryMode)
	populate(objectMap, "thriftTransportProtocol", h.ThriftTransportProtocol)
	populate(objectMap, "trustedCertPath", &h.TrustedCertPath)
	populate(objectMap, "useNativeQuery", &h.UseNativeQuery)
	populate(objectMap, "useSystemTrustStore", &h.UseSystemTrustStore)
	populate(objectMap, "username", &h.Username)
	populate(objectMap, "zooKeeperNameSpace", &h.ZooKeeperNameSpace)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HiveLinkedServiceTypeProperties.
func (h *HiveLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &h.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &h.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &h.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &h.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "httpPath":
			err = unpopulate(val, "HTTPPath", &h.HTTPPath)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &h.Host)
			delete(rawMsg, key)
		case "password":
			h.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &h.Port)
			delete(rawMsg, key)
		case "serverType":
			err = unpopulate(val, "ServerType", &h.ServerType)
			delete(rawMsg, key)
		case "serviceDiscoveryMode":
			err = unpopulate(val, "ServiceDiscoveryMode", &h.ServiceDiscoveryMode)
			delete(rawMsg, key)
		case "thriftTransportProtocol":
			err = unpopulate(val, "ThriftTransportProtocol", &h.ThriftTransportProtocol)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &h.TrustedCertPath)
			delete(rawMsg, key)
		case "useNativeQuery":
			err = unpopulate(val, "UseNativeQuery", &h.UseNativeQuery)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &h.UseSystemTrustStore)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &h.Username)
			delete(rawMsg, key)
		case "zooKeeperNameSpace":
			err = unpopulate(val, "ZooKeeperNameSpace", &h.ZooKeeperNameSpace)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HiveObjectDataset.
func (h HiveObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "folder", h.Folder)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "parameters", h.Parameters)
	populate(objectMap, "schema", &h.Schema)
	populate(objectMap, "structure", &h.Structure)
	objectMap["type"] = "HiveObject"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HiveObjectDataset.
func (h *HiveObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &h.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &h.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &h.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HiveSource.
func (h HiveSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &h.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "query", &h.Query)
	populate(objectMap, "queryTimeout", &h.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &h.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &h.SourceRetryWait)
	objectMap["type"] = "HiveSource"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HiveSource.
func (h *HiveSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &h.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &h.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &h.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &h.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &h.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HubspotLinkedService.
func (h HubspotLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "connectVia", h.ConnectVia)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "parameters", h.Parameters)
	objectMap["type"] = "Hubspot"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HubspotLinkedService.
func (h *HubspotLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &h.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HubspotLinkedServiceTypeProperties.
func (h HubspotLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", h.AccessToken)
	populate(objectMap, "clientId", &h.ClientID)
	populate(objectMap, "clientSecret", h.ClientSecret)
	populate(objectMap, "encryptedCredential", &h.EncryptedCredential)
	populate(objectMap, "refreshToken", h.RefreshToken)
	populate(objectMap, "useEncryptedEndpoints", &h.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &h.UseHostVerification)
	populate(objectMap, "usePeerVerification", &h.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HubspotLinkedServiceTypeProperties.
func (h *HubspotLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			h.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &h.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			h.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &h.EncryptedCredential)
			delete(rawMsg, key)
		case "refreshToken":
			h.RefreshToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &h.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &h.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &h.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HubspotObjectDataset.
func (h HubspotObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", h.Annotations)
	populate(objectMap, "description", h.Description)
	populate(objectMap, "folder", h.Folder)
	populate(objectMap, "linkedServiceName", h.LinkedServiceName)
	populate(objectMap, "parameters", h.Parameters)
	populate(objectMap, "schema", &h.Schema)
	populate(objectMap, "structure", &h.Structure)
	objectMap["type"] = "HubspotObject"
	populate(objectMap, "typeProperties", h.TypeProperties)
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HubspotObjectDataset.
func (h *HubspotObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &h.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &h.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &h.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &h.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &h.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &h.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &h.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &h.TypeProperties)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type HubspotSource.
func (h HubspotSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &h.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &h.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &h.MaxConcurrentConnections)
	populate(objectMap, "query", &h.Query)
	populate(objectMap, "queryTimeout", &h.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &h.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &h.SourceRetryWait)
	objectMap["type"] = "HubspotSource"
	if h.AdditionalProperties != nil {
		for key, val := range h.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type HubspotSource.
func (h *HubspotSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", h, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &h.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &h.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &h.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &h.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &h.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &h.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &h.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &h.Type)
			delete(rawMsg, key)
		default:
			if h.AdditionalProperties == nil {
				h.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				h.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", h, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IfConditionActivity.
func (i IfConditionActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", i.DependsOn)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "name", i.Name)
	objectMap["type"] = "IfCondition"
	populate(objectMap, "typeProperties", i.TypeProperties)
	populate(objectMap, "userProperties", i.UserProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IfConditionActivity.
func (i *IfConditionActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &i.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &i.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &i.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &i.UserProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IfConditionActivityTypeProperties.
func (i IfConditionActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "expression", i.Expression)
	populate(objectMap, "ifFalseActivities", i.IfFalseActivities)
	populate(objectMap, "ifTrueActivities", i.IfTrueActivities)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IfConditionActivityTypeProperties.
func (i *IfConditionActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "expression":
			err = unpopulate(val, "Expression", &i.Expression)
			delete(rawMsg, key)
		case "ifFalseActivities":
			i.IfFalseActivities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		case "ifTrueActivities":
			i.IfTrueActivities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImpalaDatasetTypeProperties.
func (i ImpalaDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &i.Schema)
	populate(objectMap, "table", &i.Table)
	populate(objectMap, "tableName", &i.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImpalaDatasetTypeProperties.
func (i *ImpalaDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &i.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &i.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &i.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImpalaLinkedService.
func (i ImpalaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", i.Annotations)
	populate(objectMap, "connectVia", i.ConnectVia)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "parameters", i.Parameters)
	objectMap["type"] = "Impala"
	populate(objectMap, "typeProperties", i.TypeProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImpalaLinkedService.
func (i *ImpalaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &i.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &i.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &i.TypeProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImpalaLinkedServiceTypeProperties.
func (i ImpalaLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &i.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &i.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", i.AuthenticationType)
	populate(objectMap, "enableSsl", &i.EnableSSL)
	populate(objectMap, "encryptedCredential", &i.EncryptedCredential)
	populate(objectMap, "host", &i.Host)
	populate(objectMap, "password", i.Password)
	populate(objectMap, "port", &i.Port)
	populate(objectMap, "trustedCertPath", &i.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &i.UseSystemTrustStore)
	populate(objectMap, "username", &i.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImpalaLinkedServiceTypeProperties.
func (i *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &i.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &i.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &i.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &i.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &i.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &i.Host)
			delete(rawMsg, key)
		case "password":
			i.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &i.Port)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &i.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &i.UseSystemTrustStore)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &i.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImpalaObjectDataset.
func (i ImpalaObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", i.Annotations)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "folder", i.Folder)
	populate(objectMap, "linkedServiceName", i.LinkedServiceName)
	populate(objectMap, "parameters", i.Parameters)
	populate(objectMap, "schema", &i.Schema)
	populate(objectMap, "structure", &i.Structure)
	objectMap["type"] = "ImpalaObject"
	populate(objectMap, "typeProperties", i.TypeProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImpalaObjectDataset.
func (i *ImpalaObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &i.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &i.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &i.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &i.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &i.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &i.TypeProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImpalaSource.
func (i ImpalaSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &i.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &i.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &i.MaxConcurrentConnections)
	populate(objectMap, "query", &i.Query)
	populate(objectMap, "queryTimeout", &i.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &i.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &i.SourceRetryWait)
	objectMap["type"] = "ImpalaSource"
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ImpalaSource.
func (i *ImpalaSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &i.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &i.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &i.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &i.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &i.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &i.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &i.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ImportSettings.
func (i ImportSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["type"] = i.Type
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type InformixLinkedService.
func (i InformixLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", i.Annotations)
	populate(objectMap, "connectVia", i.ConnectVia)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "parameters", i.Parameters)
	objectMap["type"] = "Informix"
	populate(objectMap, "typeProperties", i.TypeProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformixLinkedService.
func (i *InformixLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &i.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &i.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &i.TypeProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InformixLinkedServiceTypeProperties.
func (i InformixLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &i.AuthenticationType)
	populate(objectMap, "connectionString", &i.ConnectionString)
	populate(objectMap, "credential", i.Credential)
	populate(objectMap, "encryptedCredential", &i.EncryptedCredential)
	populate(objectMap, "password", i.Password)
	populate(objectMap, "userName", &i.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformixLinkedServiceTypeProperties.
func (i *InformixLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &i.AuthenticationType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &i.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			i.Credential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &i.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			i.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &i.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InformixSink.
func (i InformixSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &i.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &i.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &i.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &i.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &i.SinkRetryWait)
	objectMap["type"] = "InformixSink"
	populate(objectMap, "writeBatchSize", &i.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &i.WriteBatchTimeout)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformixSink.
func (i *InformixSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &i.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &i.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &i.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &i.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &i.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &i.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &i.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InformixSource.
func (i InformixSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &i.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &i.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &i.MaxConcurrentConnections)
	populate(objectMap, "query", &i.Query)
	populate(objectMap, "queryTimeout", &i.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &i.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &i.SourceRetryWait)
	objectMap["type"] = "InformixSource"
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformixSource.
func (i *InformixSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &i.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &i.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &i.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &i.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &i.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &i.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &i.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InformixTableDataset.
func (i InformixTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", i.Annotations)
	populate(objectMap, "description", i.Description)
	populate(objectMap, "folder", i.Folder)
	populate(objectMap, "linkedServiceName", i.LinkedServiceName)
	populate(objectMap, "parameters", i.Parameters)
	populate(objectMap, "schema", &i.Schema)
	populate(objectMap, "structure", &i.Structure)
	objectMap["type"] = "InformixTable"
	populate(objectMap, "typeProperties", i.TypeProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type InformixTableDataset.
func (i *InformixTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &i.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &i.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &i.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &i.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &i.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &i.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &i.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &i.TypeProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type InformixTableDatasetTypeProperties.
func (i InformixTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &i.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntime.
func (i IntegrationRuntime) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", i.Description)
	objectMap["type"] = i.Type
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeAuthKeys.
func (i IntegrationRuntimeAuthKeys) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authKey1", i.AuthKey1)
	populate(objectMap, "authKey2", i.AuthKey2)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeComputeProperties.
func (i IntegrationRuntimeComputeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFlowProperties", i.DataFlowProperties)
	populate(objectMap, "location", i.Location)
	populate(objectMap, "maxParallelExecutionsPerNode", i.MaxParallelExecutionsPerNode)
	populate(objectMap, "nodeSize", i.NodeSize)
	populate(objectMap, "numberOfNodes", i.NumberOfNodes)
	populate(objectMap, "vNetProperties", i.VNetProperties)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeComputeProperties.
func (i *IntegrationRuntimeComputeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataFlowProperties":
			err = unpopulate(val, "DataFlowProperties", &i.DataFlowProperties)
			delete(rawMsg, key)
		case "location":
			err = unpopulate(val, "Location", &i.Location)
			delete(rawMsg, key)
		case "maxParallelExecutionsPerNode":
			err = unpopulate(val, "MaxParallelExecutionsPerNode", &i.MaxParallelExecutionsPerNode)
			delete(rawMsg, key)
		case "nodeSize":
			err = unpopulate(val, "NodeSize", &i.NodeSize)
			delete(rawMsg, key)
		case "numberOfNodes":
			err = unpopulate(val, "NumberOfNodes", &i.NumberOfNodes)
			delete(rawMsg, key)
		case "vNetProperties":
			err = unpopulate(val, "VNetProperties", &i.VNetProperties)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeConnectionInfo.
func (i IntegrationRuntimeConnectionInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "hostServiceUri", i.HostServiceURI)
	populate(objectMap, "identityCertThumbprint", i.IdentityCertThumbprint)
	populate(objectMap, "isIdentityCertExprired", i.IsIdentityCertExprired)
	populate(objectMap, "publicKey", i.PublicKey)
	populate(objectMap, "serviceToken", i.ServiceToken)
	populate(objectMap, "version", i.Version)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeConnectionInfo.
func (i *IntegrationRuntimeConnectionInfo) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "hostServiceUri":
			err = unpopulate(val, "HostServiceURI", &i.HostServiceURI)
			delete(rawMsg, key)
		case "identityCertThumbprint":
			err = unpopulate(val, "IdentityCertThumbprint", &i.IdentityCertThumbprint)
			delete(rawMsg, key)
		case "isIdentityCertExprired":
			err = unpopulate(val, "IsIdentityCertExprired", &i.IsIdentityCertExprired)
			delete(rawMsg, key)
		case "publicKey":
			err = unpopulate(val, "PublicKey", &i.PublicKey)
			delete(rawMsg, key)
		case "serviceToken":
			err = unpopulate(val, "ServiceToken", &i.ServiceToken)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &i.Version)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeCustomSetupScriptProperties.
func (i IntegrationRuntimeCustomSetupScriptProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blobContainerUri", i.BlobContainerURI)
	populate(objectMap, "sasToken", i.SasToken)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeCustomerVirtualNetwork.
func (i IntegrationRuntimeCustomerVirtualNetwork) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "subnetId", i.SubnetID)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeDataFlowProperties.
func (i IntegrationRuntimeDataFlowProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "cleanup", i.Cleanup)
	populate(objectMap, "computeType", i.ComputeType)
	populate(objectMap, "coreCount", i.CoreCount)
	populate(objectMap, "timeToLive", i.TimeToLive)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeDataFlowProperties.
func (i *IntegrationRuntimeDataFlowProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "cleanup":
			err = unpopulate(val, "Cleanup", &i.Cleanup)
			delete(rawMsg, key)
		case "computeType":
			err = unpopulate(val, "ComputeType", &i.ComputeType)
			delete(rawMsg, key)
		case "coreCount":
			err = unpopulate(val, "CoreCount", &i.CoreCount)
			delete(rawMsg, key)
		case "timeToLive":
			err = unpopulate(val, "TimeToLive", &i.TimeToLive)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeDataProxyProperties.
func (i IntegrationRuntimeDataProxyProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectVia", i.ConnectVia)
	populate(objectMap, "path", i.Path)
	populate(objectMap, "stagingLinkedService", i.StagingLinkedService)
	return json.Marshal(objectMap)
}

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

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeNodeIPAddress.
func (i IntegrationRuntimeNodeIPAddress) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "ipAddress", i.IPAddress)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeNodeMonitoringData.
func (i IntegrationRuntimeNodeMonitoringData) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "availableMemoryInMB", i.AvailableMemoryInMB)
	populate(objectMap, "cpuUtilization", i.CPUUtilization)
	populate(objectMap, "concurrentJobsLimit", i.ConcurrentJobsLimit)
	populate(objectMap, "concurrentJobsRunning", i.ConcurrentJobsRunning)
	populate(objectMap, "maxConcurrentJobs", i.MaxConcurrentJobs)
	populate(objectMap, "nodeName", i.NodeName)
	populate(objectMap, "receivedBytes", i.ReceivedBytes)
	populate(objectMap, "sentBytes", i.SentBytes)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeNodeMonitoringData.
func (i *IntegrationRuntimeNodeMonitoringData) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "availableMemoryInMB":
			err = unpopulate(val, "AvailableMemoryInMB", &i.AvailableMemoryInMB)
			delete(rawMsg, key)
		case "cpuUtilization":
			err = unpopulate(val, "CPUUtilization", &i.CPUUtilization)
			delete(rawMsg, key)
		case "concurrentJobsLimit":
			err = unpopulate(val, "ConcurrentJobsLimit", &i.ConcurrentJobsLimit)
			delete(rawMsg, key)
		case "concurrentJobsRunning":
			err = unpopulate(val, "ConcurrentJobsRunning", &i.ConcurrentJobsRunning)
			delete(rawMsg, key)
		case "maxConcurrentJobs":
			err = unpopulate(val, "MaxConcurrentJobs", &i.MaxConcurrentJobs)
			delete(rawMsg, key)
		case "nodeName":
			err = unpopulate(val, "NodeName", &i.NodeName)
			delete(rawMsg, key)
		case "receivedBytes":
			err = unpopulate(val, "ReceivedBytes", &i.ReceivedBytes)
			delete(rawMsg, key)
		case "sentBytes":
			err = unpopulate(val, "SentBytes", &i.SentBytes)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

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

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

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

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

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeRegenerateKeyParameters.
func (i IntegrationRuntimeRegenerateKeyParameters) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "keyName", i.KeyName)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeSsisCatalogInfo.
func (i IntegrationRuntimeSsisCatalogInfo) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "catalogAdminPassword", i.CatalogAdminPassword)
	populate(objectMap, "catalogAdminUserName", i.CatalogAdminUserName)
	populate(objectMap, "catalogPricingTier", i.CatalogPricingTier)
	populate(objectMap, "catalogServerEndpoint", i.CatalogServerEndpoint)
	populate(objectMap, "dualStandbyPairName", i.DualStandbyPairName)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeSsisCatalogInfo.
func (i *IntegrationRuntimeSsisCatalogInfo) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "catalogAdminPassword":
			err = unpopulate(val, "CatalogAdminPassword", &i.CatalogAdminPassword)
			delete(rawMsg, key)
		case "catalogAdminUserName":
			err = unpopulate(val, "CatalogAdminUserName", &i.CatalogAdminUserName)
			delete(rawMsg, key)
		case "catalogPricingTier":
			err = unpopulate(val, "CatalogPricingTier", &i.CatalogPricingTier)
			delete(rawMsg, key)
		case "catalogServerEndpoint":
			err = unpopulate(val, "CatalogServerEndpoint", &i.CatalogServerEndpoint)
			delete(rawMsg, key)
		case "dualStandbyPairName":
			err = unpopulate(val, "DualStandbyPairName", &i.DualStandbyPairName)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeSsisProperties.
func (i IntegrationRuntimeSsisProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "catalogInfo", i.CatalogInfo)
	populate(objectMap, "credential", i.Credential)
	populate(objectMap, "customSetupScriptProperties", i.CustomSetupScriptProperties)
	populate(objectMap, "dataProxyProperties", i.DataProxyProperties)
	populate(objectMap, "edition", i.Edition)
	populate(objectMap, "expressCustomSetupProperties", i.ExpressCustomSetupProperties)
	populate(objectMap, "licenseType", i.LicenseType)
	populate(objectMap, "packageStores", i.PackageStores)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeSsisProperties.
func (i *IntegrationRuntimeSsisProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "catalogInfo":
			err = unpopulate(val, "CatalogInfo", &i.CatalogInfo)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &i.Credential)
			delete(rawMsg, key)
		case "customSetupScriptProperties":
			err = unpopulate(val, "CustomSetupScriptProperties", &i.CustomSetupScriptProperties)
			delete(rawMsg, key)
		case "dataProxyProperties":
			err = unpopulate(val, "DataProxyProperties", &i.DataProxyProperties)
			delete(rawMsg, key)
		case "edition":
			err = unpopulate(val, "Edition", &i.Edition)
			delete(rawMsg, key)
		case "expressCustomSetupProperties":
			i.ExpressCustomSetupProperties, err = unmarshalCustomSetupBaseClassificationArray(val)
			delete(rawMsg, key)
		case "licenseType":
			err = unpopulate(val, "LicenseType", &i.LicenseType)
			delete(rawMsg, key)
		case "packageStores":
			err = unpopulate(val, "PackageStores", &i.PackageStores)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeStatus.
func (i IntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFactoryName", i.DataFactoryName)
	populate(objectMap, "state", i.State)
	objectMap["type"] = i.Type
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeStatus.
func (i *IntegrationRuntimeStatus) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataFactoryName":
			err = unpopulate(val, "DataFactoryName", &i.DataFactoryName)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &i.State)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &i.Type)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type IntegrationRuntimeVNetProperties.
func (i IntegrationRuntimeVNetProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "publicIPs", i.PublicIPs)
	populate(objectMap, "subnet", i.Subnet)
	populate(objectMap, "subnetId", i.SubnetID)
	populate(objectMap, "vNetId", i.VNetID)
	if i.AdditionalProperties != nil {
		for key, val := range i.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type IntegrationRuntimeVNetProperties.
func (i *IntegrationRuntimeVNetProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", i, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "publicIPs":
			err = unpopulate(val, "PublicIPs", &i.PublicIPs)
			delete(rawMsg, key)
		case "subnet":
			err = unpopulate(val, "Subnet", &i.Subnet)
			delete(rawMsg, key)
		case "subnetId":
			err = unpopulate(val, "SubnetID", &i.SubnetID)
			delete(rawMsg, key)
		case "vNetId":
			err = unpopulate(val, "VNetID", &i.VNetID)
			delete(rawMsg, key)
		default:
			if i.AdditionalProperties == nil {
				i.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				i.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", i, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONDataset.
func (j JSONDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", j.Annotations)
	populate(objectMap, "description", j.Description)
	populate(objectMap, "folder", j.Folder)
	populate(objectMap, "linkedServiceName", j.LinkedServiceName)
	populate(objectMap, "parameters", j.Parameters)
	populate(objectMap, "schema", &j.Schema)
	populate(objectMap, "structure", &j.Structure)
	objectMap["type"] = "Json"
	populate(objectMap, "typeProperties", j.TypeProperties)
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONDataset.
func (j *JSONDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &j.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &j.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &j.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &j.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &j.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &j.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &j.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &j.TypeProperties)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONDatasetTypeProperties.
func (j JSONDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", j.Compression)
	populate(objectMap, "encodingName", &j.EncodingName)
	populate(objectMap, "location", j.Location)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONDatasetTypeProperties.
func (j *JSONDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &j.Compression)
			delete(rawMsg, key)
		case "encodingName":
			err = unpopulate(val, "EncodingName", &j.EncodingName)
			delete(rawMsg, key)
		case "location":
			j.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONFormat.
func (j JSONFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deserializer", &j.Deserializer)
	populate(objectMap, "encodingName", &j.EncodingName)
	populate(objectMap, "filePattern", &j.FilePattern)
	populate(objectMap, "jsonNodeReference", &j.JSONNodeReference)
	populate(objectMap, "jsonPathDefinition", &j.JSONPathDefinition)
	populate(objectMap, "nestingSeparator", &j.NestingSeparator)
	populate(objectMap, "serializer", &j.Serializer)
	objectMap["type"] = "JsonFormat"
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONFormat.
func (j *JSONFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deserializer":
			err = unpopulate(val, "Deserializer", &j.Deserializer)
			delete(rawMsg, key)
		case "encodingName":
			err = unpopulate(val, "EncodingName", &j.EncodingName)
			delete(rawMsg, key)
		case "filePattern":
			err = unpopulate(val, "FilePattern", &j.FilePattern)
			delete(rawMsg, key)
		case "jsonNodeReference":
			err = unpopulate(val, "JSONNodeReference", &j.JSONNodeReference)
			delete(rawMsg, key)
		case "jsonPathDefinition":
			err = unpopulate(val, "JSONPathDefinition", &j.JSONPathDefinition)
			delete(rawMsg, key)
		case "nestingSeparator":
			err = unpopulate(val, "NestingSeparator", &j.NestingSeparator)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &j.Serializer)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONReadSettings.
func (j JSONReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compressionProperties", j.CompressionProperties)
	objectMap["type"] = "JsonReadSettings"
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONReadSettings.
func (j *JSONReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compressionProperties":
			j.CompressionProperties, err = unmarshalCompressionReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONSink.
func (j JSONSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &j.DisableMetricsCollection)
	populate(objectMap, "formatSettings", j.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &j.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &j.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &j.SinkRetryWait)
	populate(objectMap, "storeSettings", j.StoreSettings)
	objectMap["type"] = "JsonSink"
	populate(objectMap, "writeBatchSize", &j.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &j.WriteBatchTimeout)
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONSink.
func (j *JSONSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &j.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &j.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &j.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &j.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &j.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			j.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &j.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &j.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONSource.
func (j JSONSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &j.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &j.DisableMetricsCollection)
	populate(objectMap, "formatSettings", j.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &j.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &j.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &j.SourceRetryWait)
	populate(objectMap, "storeSettings", j.StoreSettings)
	objectMap["type"] = "JsonSource"
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONSource.
func (j *JSONSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &j.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &j.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &j.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &j.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &j.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &j.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			j.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JSONWriteSettings.
func (j JSONWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "filePattern", &j.FilePattern)
	objectMap["type"] = "JsonWriteSettings"
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JSONWriteSettings.
func (j *JSONWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "filePattern":
			err = unpopulate(val, "FilePattern", &j.FilePattern)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JiraLinkedService.
func (j JiraLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", j.Annotations)
	populate(objectMap, "connectVia", j.ConnectVia)
	populate(objectMap, "description", j.Description)
	populate(objectMap, "parameters", j.Parameters)
	objectMap["type"] = "Jira"
	populate(objectMap, "typeProperties", j.TypeProperties)
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JiraLinkedService.
func (j *JiraLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &j.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &j.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &j.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &j.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &j.TypeProperties)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JiraLinkedServiceTypeProperties.
func (j JiraLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &j.EncryptedCredential)
	populate(objectMap, "host", &j.Host)
	populate(objectMap, "password", j.Password)
	populate(objectMap, "port", &j.Port)
	populate(objectMap, "useEncryptedEndpoints", &j.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &j.UseHostVerification)
	populate(objectMap, "usePeerVerification", &j.UsePeerVerification)
	populate(objectMap, "username", &j.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JiraLinkedServiceTypeProperties.
func (j *JiraLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &j.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &j.Host)
			delete(rawMsg, key)
		case "password":
			j.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &j.Port)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &j.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &j.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &j.UsePeerVerification)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &j.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JiraObjectDataset.
func (j JiraObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", j.Annotations)
	populate(objectMap, "description", j.Description)
	populate(objectMap, "folder", j.Folder)
	populate(objectMap, "linkedServiceName", j.LinkedServiceName)
	populate(objectMap, "parameters", j.Parameters)
	populate(objectMap, "schema", &j.Schema)
	populate(objectMap, "structure", &j.Structure)
	objectMap["type"] = "JiraObject"
	populate(objectMap, "typeProperties", j.TypeProperties)
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JiraObjectDataset.
func (j *JiraObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &j.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &j.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &j.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &j.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &j.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &j.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &j.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &j.TypeProperties)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type JiraSource.
func (j JiraSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &j.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &j.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &j.MaxConcurrentConnections)
	populate(objectMap, "query", &j.Query)
	populate(objectMap, "queryTimeout", &j.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &j.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &j.SourceRetryWait)
	objectMap["type"] = "JiraSource"
	if j.AdditionalProperties != nil {
		for key, val := range j.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type JiraSource.
func (j *JiraSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", j, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &j.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &j.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &j.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &j.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &j.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &j.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &j.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &j.Type)
			delete(rawMsg, key)
		default:
			if j.AdditionalProperties == nil {
				j.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				j.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", j, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LicensedComponentSetupTypeProperties.
func (l LicensedComponentSetupTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "componentName", l.ComponentName)
	populate(objectMap, "licenseKey", l.LicenseKey)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LicensedComponentSetupTypeProperties.
func (l *LicensedComponentSetupTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "componentName":
			err = unpopulate(val, "ComponentName", &l.ComponentName)
			delete(rawMsg, key)
		case "licenseKey":
			l.LicenseKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LinkedIntegrationRuntime.
func (l LinkedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populateTimeRFC3339(objectMap, "createTime", l.CreateTime)
	populate(objectMap, "dataFactoryLocation", l.DataFactoryLocation)
	populate(objectMap, "dataFactoryName", l.DataFactoryName)
	populate(objectMap, "name", l.Name)
	populate(objectMap, "subscriptionId", l.SubscriptionID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedIntegrationRuntime.
func (l *LinkedIntegrationRuntime) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "createTime":
			err = unpopulateTimeRFC3339(val, "CreateTime", &l.CreateTime)
			delete(rawMsg, key)
		case "dataFactoryLocation":
			err = unpopulate(val, "DataFactoryLocation", &l.DataFactoryLocation)
			delete(rawMsg, key)
		case "dataFactoryName":
			err = unpopulate(val, "DataFactoryName", &l.DataFactoryName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &l.Name)
			delete(rawMsg, key)
		case "subscriptionId":
			err = unpopulate(val, "SubscriptionID", &l.SubscriptionID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type LinkedIntegrationRuntimeRbacAuthorization.
func (l LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authorizationType"] = "RBAC"
	populate(objectMap, "credential", l.Credential)
	populate(objectMap, "resourceId", l.ResourceID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedIntegrationRuntimeRbacAuthorization.
func (l *LinkedIntegrationRuntimeRbacAuthorization) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authorizationType":
			err = unpopulate(val, "AuthorizationType", &l.AuthorizationType)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &l.Credential)
			delete(rawMsg, key)
		case "resourceId":
			err = unpopulate(val, "ResourceID", &l.ResourceID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LinkedIntegrationRuntimeRequest.
func (l LinkedIntegrationRuntimeRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "factoryName", l.LinkedFactoryName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type LinkedIntegrationRuntimeType.
func (l LinkedIntegrationRuntimeType) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authorizationType"] = l.AuthorizationType
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type LinkedService.
func (l LinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", l.Annotations)
	populate(objectMap, "connectVia", l.ConnectVia)
	populate(objectMap, "description", l.Description)
	populate(objectMap, "parameters", l.Parameters)
	objectMap["type"] = l.Type
	if l.AdditionalProperties != nil {
		for key, val := range l.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedService.
func (l *LinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &l.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &l.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &l.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &l.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &l.Type)
			delete(rawMsg, key)
		default:
			if l.AdditionalProperties == nil {
				l.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				l.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type LinkedServiceReference.
func (l LinkedServiceReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parameters", l.Parameters)
	populate(objectMap, "referenceName", l.ReferenceName)
	populate(objectMap, "type", l.Type)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type LogLocationSettings.
func (l LogLocationSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "linkedServiceName", l.LinkedServiceName)
	populate(objectMap, "path", &l.Path)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type LogSettings.
func (l LogSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyActivityLogSettings", l.CopyActivityLogSettings)
	populate(objectMap, "enableCopyActivityLog", &l.EnableCopyActivityLog)
	populate(objectMap, "logLocationSettings", l.LogLocationSettings)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LogSettings.
func (l *LogSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyActivityLogSettings":
			err = unpopulate(val, "CopyActivityLogSettings", &l.CopyActivityLogSettings)
			delete(rawMsg, key)
		case "enableCopyActivityLog":
			err = unpopulate(val, "EnableCopyActivityLog", &l.EnableCopyActivityLog)
			delete(rawMsg, key)
		case "logLocationSettings":
			err = unpopulate(val, "LogLocationSettings", &l.LogLocationSettings)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LogStorageSettings.
func (l LogStorageSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "enableReliableLogging", &l.EnableReliableLogging)
	populate(objectMap, "linkedServiceName", l.LinkedServiceName)
	populate(objectMap, "logLevel", &l.LogLevel)
	populate(objectMap, "path", &l.Path)
	if l.AdditionalProperties != nil {
		for key, val := range l.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LogStorageSettings.
func (l *LogStorageSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "enableReliableLogging":
			err = unpopulate(val, "EnableReliableLogging", &l.EnableReliableLogging)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &l.LinkedServiceName)
			delete(rawMsg, key)
		case "logLevel":
			err = unpopulate(val, "LogLevel", &l.LogLevel)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &l.Path)
			delete(rawMsg, key)
		default:
			if l.AdditionalProperties == nil {
				l.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				l.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LookupActivity.
func (l LookupActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", l.DependsOn)
	populate(objectMap, "description", l.Description)
	populate(objectMap, "linkedServiceName", l.LinkedServiceName)
	populate(objectMap, "name", l.Name)
	populate(objectMap, "policy", l.Policy)
	objectMap["type"] = "Lookup"
	populate(objectMap, "typeProperties", l.TypeProperties)
	populate(objectMap, "userProperties", l.UserProperties)
	if l.AdditionalProperties != nil {
		for key, val := range l.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LookupActivity.
func (l *LookupActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &l.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &l.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &l.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &l.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &l.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &l.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &l.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &l.UserProperties)
			delete(rawMsg, key)
		default:
			if l.AdditionalProperties == nil {
				l.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				l.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type LookupActivityTypeProperties.
func (l LookupActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", l.Dataset)
	populate(objectMap, "firstRowOnly", &l.FirstRowOnly)
	populate(objectMap, "source", l.Source)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type LookupActivityTypeProperties.
func (l *LookupActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", l, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &l.Dataset)
			delete(rawMsg, key)
		case "firstRowOnly":
			err = unpopulate(val, "FirstRowOnly", &l.FirstRowOnly)
			delete(rawMsg, key)
		case "source":
			l.Source, err = unmarshalCopySourceClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", l, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MagentoLinkedService.
func (m MagentoLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "Magento"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MagentoLinkedService.
func (m *MagentoLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MagentoLinkedServiceTypeProperties.
func (m MagentoLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", m.AccessToken)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "host", &m.Host)
	populate(objectMap, "useEncryptedEndpoints", &m.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &m.UseHostVerification)
	populate(objectMap, "usePeerVerification", &m.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MagentoLinkedServiceTypeProperties.
func (m *MagentoLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			m.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &m.Host)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &m.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &m.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &m.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MagentoObjectDataset.
func (m MagentoObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MagentoObject"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MagentoObjectDataset.
func (m *MagentoObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MagentoSource.
func (m MagentoSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MagentoSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MagentoSource.
func (m *MagentoSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntime.
func (m ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", m.Description)
	populate(objectMap, "managedVirtualNetwork", m.ManagedVirtualNetwork)
	populate(objectMap, "state", m.State)
	objectMap["type"] = IntegrationRuntimeTypeManaged
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntime.
func (m *ManagedIntegrationRuntime) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "managedVirtualNetwork":
			err = unpopulate(val, "ManagedVirtualNetwork", &m.ManagedVirtualNetwork)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &m.State)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeError.
func (m ManagedIntegrationRuntimeError) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "code", m.Code)
	populate(objectMap, "message", m.Message)
	populate(objectMap, "parameters", m.Parameters)
	populateTimeRFC3339(objectMap, "time", m.Time)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeError.
func (m *ManagedIntegrationRuntimeError) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "code":
			err = unpopulate(val, "Code", &m.Code)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &m.Message)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "time":
			err = unpopulateTimeRFC3339(val, "Time", &m.Time)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeNode.
func (m ManagedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "errors", m.Errors)
	populate(objectMap, "nodeId", m.NodeID)
	populate(objectMap, "status", m.Status)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeNode.
func (m *ManagedIntegrationRuntimeNode) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "errors":
			err = unpopulate(val, "Errors", &m.Errors)
			delete(rawMsg, key)
		case "nodeId":
			err = unpopulate(val, "NodeID", &m.NodeID)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &m.Status)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeOperationResult.
func (m ManagedIntegrationRuntimeOperationResult) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activityId", m.ActivityID)
	populate(objectMap, "errorCode", m.ErrorCode)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "result", m.Result)
	populateTimeRFC3339(objectMap, "startTime", m.StartTime)
	populate(objectMap, "type", m.Type)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeOperationResult.
func (m *ManagedIntegrationRuntimeOperationResult) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activityId":
			err = unpopulate(val, "ActivityID", &m.ActivityID)
			delete(rawMsg, key)
		case "errorCode":
			err = unpopulate(val, "ErrorCode", &m.ErrorCode)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "result":
			err = unpopulate(val, "Result", &m.Result)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeStatus.
func (m ManagedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFactoryName", m.DataFactoryName)
	populate(objectMap, "state", m.State)
	objectMap["type"] = IntegrationRuntimeTypeManaged
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeStatus.
func (m *ManagedIntegrationRuntimeStatus) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataFactoryName":
			err = unpopulate(val, "DataFactoryName", &m.DataFactoryName)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &m.State)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeStatusTypeProperties.
func (m ManagedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populateTimeRFC3339(objectMap, "createTime", m.CreateTime)
	populate(objectMap, "lastOperation", m.LastOperation)
	populate(objectMap, "nodes", m.Nodes)
	populate(objectMap, "otherErrors", m.OtherErrors)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeStatusTypeProperties.
func (m *ManagedIntegrationRuntimeStatusTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "createTime":
			err = unpopulateTimeRFC3339(val, "CreateTime", &m.CreateTime)
			delete(rawMsg, key)
		case "lastOperation":
			err = unpopulate(val, "LastOperation", &m.LastOperation)
			delete(rawMsg, key)
		case "nodes":
			err = unpopulate(val, "Nodes", &m.Nodes)
			delete(rawMsg, key)
		case "otherErrors":
			err = unpopulate(val, "OtherErrors", &m.OtherErrors)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedIntegrationRuntimeTypeProperties.
func (m ManagedIntegrationRuntimeTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "computeProperties", m.ComputeProperties)
	populate(objectMap, "customerVirtualNetwork", m.CustomerVirtualNetwork)
	populate(objectMap, "ssisProperties", m.SsisProperties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedIntegrationRuntimeTypeProperties.
func (m *ManagedIntegrationRuntimeTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "computeProperties":
			err = unpopulate(val, "ComputeProperties", &m.ComputeProperties)
			delete(rawMsg, key)
		case "customerVirtualNetwork":
			err = unpopulate(val, "CustomerVirtualNetwork", &m.CustomerVirtualNetwork)
			delete(rawMsg, key)
		case "ssisProperties":
			err = unpopulate(val, "SsisProperties", &m.SsisProperties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ManagedPrivateEndpoint.
func (m ManagedPrivateEndpoint) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionState", m.ConnectionState)
	populate(objectMap, "fqdns", m.Fqdns)
	populate(objectMap, "groupId", m.GroupID)
	populate(objectMap, "isReserved", m.IsReserved)
	populate(objectMap, "privateLinkResourceId", m.PrivateLinkResourceID)
	populate(objectMap, "provisioningState", m.ProvisioningState)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedPrivateEndpoint.
func (m *ManagedPrivateEndpoint) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionState":
			err = unpopulate(val, "ConnectionState", &m.ConnectionState)
			delete(rawMsg, key)
		case "fqdns":
			err = unpopulate(val, "Fqdns", &m.Fqdns)
			delete(rawMsg, key)
		case "groupId":
			err = unpopulate(val, "GroupID", &m.GroupID)
			delete(rawMsg, key)
		case "isReserved":
			err = unpopulate(val, "IsReserved", &m.IsReserved)
			delete(rawMsg, key)
		case "privateLinkResourceId":
			err = unpopulate(val, "PrivateLinkResourceID", &m.PrivateLinkResourceID)
			delete(rawMsg, key)
		case "provisioningState":
			err = unpopulate(val, "ProvisioningState", &m.ProvisioningState)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type ManagedVirtualNetwork.
func (m ManagedVirtualNetwork) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alias", m.Alias)
	populate(objectMap, "vNetId", m.VNetID)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedVirtualNetwork.
func (m *ManagedVirtualNetwork) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alias":
			err = unpopulate(val, "Alias", &m.Alias)
			delete(rawMsg, key)
		case "vNetId":
			err = unpopulate(val, "VNetID", &m.VNetID)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ManagedVirtualNetworkReference.
func (m ManagedVirtualNetworkReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", m.ReferenceName)
	populate(objectMap, "type", m.Type)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type MappingDataFlow.
func (m MappingDataFlow) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	objectMap["type"] = "MappingDataFlow"
	populate(objectMap, "typeProperties", m.TypeProperties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MappingDataFlow.
func (m *MappingDataFlow) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MappingDataFlowTypeProperties.
func (m MappingDataFlowTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "script", m.Script)
	populate(objectMap, "scriptLines", m.ScriptLines)
	populate(objectMap, "sinks", m.Sinks)
	populate(objectMap, "sources", m.Sources)
	populate(objectMap, "transformations", m.Transformations)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MappingDataFlowTypeProperties.
func (m *MappingDataFlowTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "script":
			err = unpopulate(val, "Script", &m.Script)
			delete(rawMsg, key)
		case "scriptLines":
			err = unpopulate(val, "ScriptLines", &m.ScriptLines)
			delete(rawMsg, key)
		case "sinks":
			err = unpopulate(val, "Sinks", &m.Sinks)
			delete(rawMsg, key)
		case "sources":
			err = unpopulate(val, "Sources", &m.Sources)
			delete(rawMsg, key)
		case "transformations":
			err = unpopulate(val, "Transformations", &m.Transformations)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MariaDBLinkedService.
func (m MariaDBLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MariaDB"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MariaDBLinkedService.
func (m *MariaDBLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MariaDBLinkedServiceTypeProperties.
func (m MariaDBLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &m.ConnectionString)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "pwd", m.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MariaDBLinkedServiceTypeProperties.
func (m *MariaDBLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &m.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &m.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MariaDBSource.
func (m MariaDBSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MariaDBSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MariaDBSource.
func (m *MariaDBSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MariaDBTableDataset.
func (m MariaDBTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MariaDBTable"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MariaDBTableDataset.
func (m *MariaDBTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MarketoLinkedService.
func (m MarketoLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "Marketo"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketoLinkedService.
func (m *MarketoLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MarketoLinkedServiceTypeProperties.
func (m MarketoLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &m.ClientID)
	populate(objectMap, "clientSecret", m.ClientSecret)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "endpoint", &m.Endpoint)
	populate(objectMap, "useEncryptedEndpoints", &m.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &m.UseHostVerification)
	populate(objectMap, "usePeerVerification", &m.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketoLinkedServiceTypeProperties.
func (m *MarketoLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &m.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			m.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &m.Endpoint)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &m.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &m.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &m.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MarketoObjectDataset.
func (m MarketoObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MarketoObject"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketoObjectDataset.
func (m *MarketoObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MarketoSource.
func (m MarketoSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MarketoSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MarketoSource.
func (m *MarketoSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessLinkedService.
func (m MicrosoftAccessLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MicrosoftAccess"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftAccessLinkedService.
func (m *MicrosoftAccessLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessLinkedServiceTypeProperties.
func (m MicrosoftAccessLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &m.AuthenticationType)
	populate(objectMap, "connectionString", &m.ConnectionString)
	populate(objectMap, "credential", m.Credential)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "password", m.Password)
	populate(objectMap, "userName", &m.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftAccessLinkedServiceTypeProperties.
func (m *MicrosoftAccessLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &m.AuthenticationType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &m.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			m.Credential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			m.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &m.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessSink.
func (m MicrosoftAccessSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &m.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &m.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &m.SinkRetryWait)
	objectMap["type"] = "MicrosoftAccessSink"
	populate(objectMap, "writeBatchSize", &m.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &m.WriteBatchTimeout)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftAccessSink.
func (m *MicrosoftAccessSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &m.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &m.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &m.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &m.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &m.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessSource.
func (m MicrosoftAccessSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MicrosoftAccessSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftAccessSource.
func (m *MicrosoftAccessSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessTableDataset.
func (m MicrosoftAccessTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MicrosoftAccessTable"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftAccessTableDataset.
func (m *MicrosoftAccessTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MicrosoftAccessTableDatasetTypeProperties.
func (m MicrosoftAccessTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &m.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasCollectionDataset.
func (m MongoDbAtlasCollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MongoDbAtlasCollection"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbAtlasCollectionDataset.
func (m *MongoDbAtlasCollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasCollectionDatasetTypeProperties.
func (m MongoDbAtlasCollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collection", &m.Collection)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasLinkedService.
func (m MongoDbAtlasLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MongoDbAtlas"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbAtlasLinkedService.
func (m *MongoDbAtlasLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasLinkedServiceTypeProperties.
func (m MongoDbAtlasLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &m.ConnectionString)
	populate(objectMap, "database", &m.Database)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasSink.
func (m MongoDbAtlasSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &m.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &m.SinkRetryWait)
	objectMap["type"] = "MongoDbAtlasSink"
	populate(objectMap, "writeBatchSize", &m.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &m.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &m.WriteBehavior)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbAtlasSink.
func (m *MongoDbAtlasSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &m.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &m.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &m.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &m.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &m.WriteBehavior)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbAtlasSource.
func (m MongoDbAtlasSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "batchSize", &m.BatchSize)
	populate(objectMap, "cursorMethods", m.CursorMethods)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "filter", &m.Filter)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MongoDbAtlasSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbAtlasSource.
func (m *MongoDbAtlasSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "batchSize":
			err = unpopulate(val, "BatchSize", &m.BatchSize)
			delete(rawMsg, key)
		case "cursorMethods":
			err = unpopulate(val, "CursorMethods", &m.CursorMethods)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "filter":
			err = unpopulate(val, "Filter", &m.Filter)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionDataset.
func (m MongoDbCollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MongoDbCollection"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCollectionDataset.
func (m *MongoDbCollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbCollectionDatasetTypeProperties.
func (m MongoDbCollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collectionName", &m.CollectionName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbCursorMethodsProperties.
func (m MongoDbCursorMethodsProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "limit", &m.Limit)
	populate(objectMap, "project", &m.Project)
	populate(objectMap, "skip", &m.Skip)
	populate(objectMap, "sort", &m.Sort)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbCursorMethodsProperties.
func (m *MongoDbCursorMethodsProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "limit":
			err = unpopulate(val, "Limit", &m.Limit)
			delete(rawMsg, key)
		case "project":
			err = unpopulate(val, "Project", &m.Project)
			delete(rawMsg, key)
		case "skip":
			err = unpopulate(val, "Skip", &m.Skip)
			delete(rawMsg, key)
		case "sort":
			err = unpopulate(val, "Sort", &m.Sort)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbLinkedService.
func (m MongoDbLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MongoDb"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbLinkedService.
func (m *MongoDbLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbLinkedServiceTypeProperties.
func (m MongoDbLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowSelfSignedServerCert", &m.AllowSelfSignedServerCert)
	populate(objectMap, "authSource", &m.AuthSource)
	populate(objectMap, "authenticationType", m.AuthenticationType)
	populate(objectMap, "databaseName", &m.DatabaseName)
	populate(objectMap, "enableSsl", &m.EnableSSL)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "password", m.Password)
	populate(objectMap, "port", &m.Port)
	populate(objectMap, "server", &m.Server)
	populate(objectMap, "username", &m.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbLinkedServiceTypeProperties.
func (m *MongoDbLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &m.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authSource":
			err = unpopulate(val, "AuthSource", &m.AuthSource)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &m.AuthenticationType)
			delete(rawMsg, key)
		case "databaseName":
			err = unpopulate(val, "DatabaseName", &m.DatabaseName)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &m.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			m.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &m.Port)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &m.Server)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &m.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbSource.
func (m MongoDbSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MongoDbSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbSource.
func (m *MongoDbSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2CollectionDataset.
func (m MongoDbV2CollectionDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MongoDbV2Collection"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbV2CollectionDataset.
func (m *MongoDbV2CollectionDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2CollectionDatasetTypeProperties.
func (m MongoDbV2CollectionDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "collection", &m.Collection)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2LinkedService.
func (m MongoDbV2LinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MongoDbV2"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbV2LinkedService.
func (m *MongoDbV2LinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2LinkedServiceTypeProperties.
func (m MongoDbV2LinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &m.ConnectionString)
	populate(objectMap, "database", &m.Database)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2Sink.
func (m MongoDbV2Sink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &m.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &m.SinkRetryWait)
	objectMap["type"] = "MongoDbV2Sink"
	populate(objectMap, "writeBatchSize", &m.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &m.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &m.WriteBehavior)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbV2Sink.
func (m *MongoDbV2Sink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &m.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &m.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &m.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &m.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &m.WriteBehavior)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MongoDbV2Source.
func (m MongoDbV2Source) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "batchSize", &m.BatchSize)
	populate(objectMap, "cursorMethods", m.CursorMethods)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "filter", &m.Filter)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MongoDbV2Source"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MongoDbV2Source.
func (m *MongoDbV2Source) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "batchSize":
			err = unpopulate(val, "BatchSize", &m.BatchSize)
			delete(rawMsg, key)
		case "cursorMethods":
			err = unpopulate(val, "CursorMethods", &m.CursorMethods)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "filter":
			err = unpopulate(val, "Filter", &m.Filter)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MultiplePipelineTrigger.
func (m MultiplePipelineTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "pipelines", m.Pipelines)
	populate(objectMap, "runtimeState", m.RuntimeState)
	objectMap["type"] = "MultiplePipelineTrigger"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MultiplePipelineTrigger.
func (m *MultiplePipelineTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "pipelines":
			err = unpopulate(val, "Pipelines", &m.Pipelines)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &m.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MySQLLinkedService.
func (m MySQLLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "connectVia", m.ConnectVia)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "parameters", m.Parameters)
	objectMap["type"] = "MySql"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLLinkedService.
func (m *MySQLLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &m.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MySQLLinkedServiceTypeProperties.
func (m MySQLLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &m.ConnectionString)
	populate(objectMap, "encryptedCredential", &m.EncryptedCredential)
	populate(objectMap, "password", m.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLLinkedServiceTypeProperties.
func (m *MySQLLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &m.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &m.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &m.Password)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MySQLSource.
func (m MySQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &m.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &m.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &m.MaxConcurrentConnections)
	populate(objectMap, "query", &m.Query)
	populate(objectMap, "queryTimeout", &m.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &m.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &m.SourceRetryWait)
	objectMap["type"] = "MySqlSource"
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLSource.
func (m *MySQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &m.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &m.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &m.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &m.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &m.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &m.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &m.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MySQLTableDataset.
func (m MySQLTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", m.Annotations)
	populate(objectMap, "description", m.Description)
	populate(objectMap, "folder", m.Folder)
	populate(objectMap, "linkedServiceName", m.LinkedServiceName)
	populate(objectMap, "parameters", m.Parameters)
	populate(objectMap, "schema", &m.Schema)
	populate(objectMap, "structure", &m.Structure)
	objectMap["type"] = "MySqlTable"
	populate(objectMap, "typeProperties", m.TypeProperties)
	if m.AdditionalProperties != nil {
		for key, val := range m.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type MySQLTableDataset.
func (m *MySQLTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", m, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &m.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &m.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &m.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &m.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &m.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &m.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &m.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &m.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &m.TypeProperties)
			delete(rawMsg, key)
		default:
			if m.AdditionalProperties == nil {
				m.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				m.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", m, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type MySQLTableDatasetTypeProperties.
func (m MySQLTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &m.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type NetezzaLinkedService.
func (n NetezzaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", n.Annotations)
	populate(objectMap, "connectVia", n.ConnectVia)
	populate(objectMap, "description", n.Description)
	populate(objectMap, "parameters", n.Parameters)
	objectMap["type"] = "Netezza"
	populate(objectMap, "typeProperties", n.TypeProperties)
	if n.AdditionalProperties != nil {
		for key, val := range n.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaLinkedService.
func (n *NetezzaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &n.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &n.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &n.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &n.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &n.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &n.TypeProperties)
			delete(rawMsg, key)
		default:
			if n.AdditionalProperties == nil {
				n.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				n.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetezzaLinkedServiceTypeProperties.
func (n NetezzaLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &n.ConnectionString)
	populate(objectMap, "encryptedCredential", &n.EncryptedCredential)
	populate(objectMap, "pwd", n.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaLinkedServiceTypeProperties.
func (n *NetezzaLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &n.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &n.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &n.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetezzaPartitionSettings.
func (n NetezzaPartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &n.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &n.PartitionLowerBound)
	populate(objectMap, "partitionUpperBound", &n.PartitionUpperBound)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaPartitionSettings.
func (n *NetezzaPartitionSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "partitionColumnName":
			err = unpopulate(val, "PartitionColumnName", &n.PartitionColumnName)
			delete(rawMsg, key)
		case "partitionLowerBound":
			err = unpopulate(val, "PartitionLowerBound", &n.PartitionLowerBound)
			delete(rawMsg, key)
		case "partitionUpperBound":
			err = unpopulate(val, "PartitionUpperBound", &n.PartitionUpperBound)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetezzaSource.
func (n NetezzaSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &n.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &n.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &n.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &n.PartitionOption)
	populate(objectMap, "partitionSettings", n.PartitionSettings)
	populate(objectMap, "query", &n.Query)
	populate(objectMap, "queryTimeout", &n.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &n.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &n.SourceRetryWait)
	objectMap["type"] = "NetezzaSource"
	if n.AdditionalProperties != nil {
		for key, val := range n.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaSource.
func (n *NetezzaSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &n.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &n.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &n.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &n.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &n.PartitionSettings)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &n.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &n.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &n.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &n.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &n.Type)
			delete(rawMsg, key)
		default:
			if n.AdditionalProperties == nil {
				n.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				n.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetezzaTableDataset.
func (n NetezzaTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", n.Annotations)
	populate(objectMap, "description", n.Description)
	populate(objectMap, "folder", n.Folder)
	populate(objectMap, "linkedServiceName", n.LinkedServiceName)
	populate(objectMap, "parameters", n.Parameters)
	populate(objectMap, "schema", &n.Schema)
	populate(objectMap, "structure", &n.Structure)
	objectMap["type"] = "NetezzaTable"
	populate(objectMap, "typeProperties", n.TypeProperties)
	if n.AdditionalProperties != nil {
		for key, val := range n.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaTableDataset.
func (n *NetezzaTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &n.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &n.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &n.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &n.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &n.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &n.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &n.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &n.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &n.TypeProperties)
			delete(rawMsg, key)
		default:
			if n.AdditionalProperties == nil {
				n.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				n.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type NetezzaTableDatasetTypeProperties.
func (n NetezzaTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &n.Schema)
	populate(objectMap, "table", &n.Table)
	populate(objectMap, "tableName", &n.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type NetezzaTableDatasetTypeProperties.
func (n *NetezzaTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", n, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &n.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &n.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &n.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", n, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ODataLinkedService.
func (o ODataLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "OData"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ODataLinkedService.
func (o *ODataLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ODataLinkedServiceTypeProperties.
func (o ODataLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "aadResourceId", &o.AADResourceID)
	populate(objectMap, "aadServicePrincipalCredentialType", o.AADServicePrincipalCredentialType)
	populate(objectMap, "authHeaders", &o.AuthHeaders)
	populate(objectMap, "authenticationType", o.AuthenticationType)
	populate(objectMap, "azureCloudType", &o.AzureCloudType)
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "password", o.Password)
	populate(objectMap, "servicePrincipalEmbeddedCert", o.ServicePrincipalEmbeddedCert)
	populate(objectMap, "servicePrincipalEmbeddedCertPassword", o.ServicePrincipalEmbeddedCertPassword)
	populate(objectMap, "servicePrincipalId", &o.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", o.ServicePrincipalKey)
	populate(objectMap, "tenant", &o.Tenant)
	populate(objectMap, "url", &o.URL)
	populate(objectMap, "userName", &o.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ODataLinkedServiceTypeProperties.
func (o *ODataLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "aadResourceId":
			err = unpopulate(val, "AADResourceID", &o.AADResourceID)
			delete(rawMsg, key)
		case "aadServicePrincipalCredentialType":
			err = unpopulate(val, "AADServicePrincipalCredentialType", &o.AADServicePrincipalCredentialType)
			delete(rawMsg, key)
		case "authHeaders":
			err = unpopulate(val, "AuthHeaders", &o.AuthHeaders)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &o.AuthenticationType)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &o.AzureCloudType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			o.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalEmbeddedCert":
			o.ServicePrincipalEmbeddedCert, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalEmbeddedCertPassword":
			o.ServicePrincipalEmbeddedCertPassword, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &o.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			o.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &o.Tenant)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &o.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &o.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ODataResourceDataset.
func (o ODataResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "ODataResource"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ODataResourceDataset.
func (o *ODataResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ODataSource.
func (o ODataSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &o.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &o.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "query", &o.Query)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	objectMap["type"] = "ODataSource"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ODataSource.
func (o *ODataSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &o.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &o.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &o.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcLinkedService.
func (o OdbcLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "Odbc"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OdbcLinkedService.
func (o *OdbcLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcLinkedServiceTypeProperties.
func (o OdbcLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", &o.AuthenticationType)
	populate(objectMap, "connectionString", &o.ConnectionString)
	populate(objectMap, "credential", o.Credential)
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "password", o.Password)
	populate(objectMap, "userName", &o.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OdbcLinkedServiceTypeProperties.
func (o *OdbcLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &o.AuthenticationType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &o.ConnectionString)
			delete(rawMsg, key)
		case "credential":
			o.Credential, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			o.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &o.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcSink.
func (o OdbcSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &o.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &o.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &o.SinkRetryWait)
	objectMap["type"] = "OdbcSink"
	populate(objectMap, "writeBatchSize", &o.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &o.WriteBatchTimeout)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OdbcSink.
func (o *OdbcSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &o.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &o.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &o.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &o.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &o.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcSource.
func (o OdbcSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &o.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "query", &o.Query)
	populate(objectMap, "queryTimeout", &o.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	objectMap["type"] = "OdbcSource"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OdbcSource.
func (o *OdbcSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &o.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &o.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &o.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcTableDataset.
func (o OdbcTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "OdbcTable"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OdbcTableDataset.
func (o *OdbcTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OdbcTableDatasetTypeProperties.
func (o OdbcTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &o.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type Office365Dataset.
func (o Office365Dataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "Office365Table"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Office365Dataset.
func (o *Office365Dataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Office365DatasetTypeProperties.
func (o Office365DatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "predicate", &o.Predicate)
	populate(objectMap, "tableName", &o.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type Office365LinkedService.
func (o Office365LinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "Office365"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Office365LinkedService.
func (o *Office365LinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Office365LinkedServiceTypeProperties.
func (o Office365LinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "office365TenantId", &o.Office365TenantID)
	populate(objectMap, "servicePrincipalId", &o.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", o.ServicePrincipalKey)
	populate(objectMap, "servicePrincipalTenantId", &o.ServicePrincipalTenantID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Office365LinkedServiceTypeProperties.
func (o *Office365LinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "office365TenantId":
			err = unpopulate(val, "Office365TenantID", &o.Office365TenantID)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &o.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			o.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "servicePrincipalTenantId":
			err = unpopulate(val, "ServicePrincipalTenantID", &o.ServicePrincipalTenantID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Office365Source.
func (o Office365Source) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowedGroups", &o.AllowedGroups)
	populate(objectMap, "dateFilterColumn", &o.DateFilterColumn)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "endTime", &o.EndTime)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "outputColumns", &o.OutputColumns)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	populate(objectMap, "startTime", &o.StartTime)
	objectMap["type"] = "Office365Source"
	populate(objectMap, "userScopeFilterUri", &o.UserScopeFilterURI)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Office365Source.
func (o *Office365Source) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowedGroups":
			err = unpopulate(val, "AllowedGroups", &o.AllowedGroups)
			delete(rawMsg, key)
		case "dateFilterColumn":
			err = unpopulate(val, "DateFilterColumn", &o.DateFilterColumn)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "endTime":
			err = unpopulate(val, "EndTime", &o.EndTime)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "outputColumns":
			err = unpopulate(val, "OutputColumns", &o.OutputColumns)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulate(val, "StartTime", &o.StartTime)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "userScopeFilterUri":
			err = unpopulate(val, "UserScopeFilterURI", &o.UserScopeFilterURI)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Operation.
func (o Operation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "display", o.Display)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "origin", o.Origin)
	populate(objectMap, "properties", o.Properties)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (o OperationDisplay) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", o.Description)
	populate(objectMap, "operation", o.Operation)
	populate(objectMap, "provider", o.Provider)
	populate(objectMap, "resource", o.Resource)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
func (o *OperationDisplay) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "operation":
			err = unpopulate(val, "Operation", &o.Operation)
			delete(rawMsg, key)
		case "provider":
			err = unpopulate(val, "Provider", &o.Provider)
			delete(rawMsg, key)
		case "resource":
			err = unpopulate(val, "Resource", &o.Resource)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type OperationLogSpecification.
func (o OperationLogSpecification) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blobDuration", o.BlobDuration)
	populate(objectMap, "displayName", o.DisplayName)
	populate(objectMap, "name", o.Name)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OperationMetricAvailability.
func (o OperationMetricAvailability) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "blobDuration", o.BlobDuration)
	populate(objectMap, "timeGrain", o.TimeGrain)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OperationMetricDimension.
func (o OperationMetricDimension) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "displayName", o.DisplayName)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "toBeExportedForShoebox", o.ToBeExportedForShoebox)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecification.
func (o OperationMetricSpecification) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "aggregationType", o.AggregationType)
	populate(objectMap, "availabilities", o.Availabilities)
	populate(objectMap, "dimensions", o.Dimensions)
	populate(objectMap, "displayDescription", o.DisplayDescription)
	populate(objectMap, "displayName", o.DisplayName)
	populate(objectMap, "enableRegionalMdmAccount", o.EnableRegionalMdmAccount)
	populate(objectMap, "name", o.Name)
	populate(objectMap, "sourceMdmAccount", o.SourceMdmAccount)
	populate(objectMap, "sourceMdmNamespace", o.SourceMdmNamespace)
	populate(objectMap, "unit", o.Unit)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecification.
func (o *OperationMetricSpecification) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "aggregationType":
			err = unpopulate(val, "AggregationType", &o.AggregationType)
			delete(rawMsg, key)
		case "availabilities":
			err = unpopulate(val, "Availabilities", &o.Availabilities)
			delete(rawMsg, key)
		case "dimensions":
			err = unpopulate(val, "Dimensions", &o.Dimensions)
			delete(rawMsg, key)
		case "displayDescription":
			err = unpopulate(val, "DisplayDescription", &o.DisplayDescription)
			delete(rawMsg, key)
		case "displayName":
			err = unpopulate(val, "DisplayName", &o.DisplayName)
			delete(rawMsg, key)
		case "enableRegionalMdmAccount":
			err = unpopulate(val, "EnableRegionalMdmAccount", &o.EnableRegionalMdmAccount)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &o.Name)
			delete(rawMsg, key)
		case "sourceMdmAccount":
			err = unpopulate(val, "SourceMdmAccount", &o.SourceMdmAccount)
			delete(rawMsg, key)
		case "sourceMdmNamespace":
			err = unpopulate(val, "SourceMdmNamespace", &o.SourceMdmNamespace)
			delete(rawMsg, key)
		case "unit":
			err = unpopulate(val, "Unit", &o.Unit)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OperationProperties.
func (o OperationProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "serviceSpecification", o.ServiceSpecification)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecification.
func (o OperationServiceSpecification) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "logSpecifications", o.LogSpecifications)
	populate(objectMap, "metricSpecifications", o.MetricSpecifications)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type OracleCloudStorageLinkedService.
func (o OracleCloudStorageLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "OracleCloudStorage"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleCloudStorageLinkedService.
func (o *OracleCloudStorageLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleCloudStorageLinkedServiceTypeProperties.
func (o OracleCloudStorageLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessKeyId", &o.AccessKeyID)
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "secretAccessKey", o.SecretAccessKey)
	populate(objectMap, "serviceUrl", &o.ServiceURL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleCloudStorageLinkedServiceTypeProperties.
func (o *OracleCloudStorageLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessKeyId":
			err = unpopulate(val, "AccessKeyID", &o.AccessKeyID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "secretAccessKey":
			o.SecretAccessKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "serviceUrl":
			err = unpopulate(val, "ServiceURL", &o.ServiceURL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleCloudStorageLocation.
func (o OracleCloudStorageLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &o.BucketName)
	populate(objectMap, "fileName", &o.FileName)
	populate(objectMap, "folderPath", &o.FolderPath)
	objectMap["type"] = "OracleCloudStorageLocation"
	populate(objectMap, "version", &o.Version)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleCloudStorageLocation.
func (o *OracleCloudStorageLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "bucketName":
			err = unpopulate(val, "BucketName", &o.BucketName)
			delete(rawMsg, key)
		case "fileName":
			err = unpopulate(val, "FileName", &o.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &o.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &o.Version)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleCloudStorageReadSettings.
func (o OracleCloudStorageReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &o.DeleteFilesAfterCompletion)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", o.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &o.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &o.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &o.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &o.PartitionRootPath)
	populate(objectMap, "prefix", &o.Prefix)
	populate(objectMap, "recursive", &o.Recursive)
	objectMap["type"] = "OracleCloudStorageReadSettings"
	populate(objectMap, "wildcardFileName", &o.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &o.WildcardFolderPath)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleCloudStorageReadSettings.
func (o *OracleCloudStorageReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &o.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &o.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &o.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &o.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &o.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &o.PartitionRootPath)
			delete(rawMsg, key)
		case "prefix":
			err = unpopulate(val, "Prefix", &o.Prefix)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &o.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &o.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &o.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleLinkedService.
func (o OracleLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "Oracle"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleLinkedService.
func (o *OracleLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleLinkedServiceTypeProperties.
func (o OracleLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &o.ConnectionString)
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "password", o.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleLinkedServiceTypeProperties.
func (o *OracleLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &o.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &o.Password)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OraclePartitionSettings.
func (o OraclePartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &o.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &o.PartitionLowerBound)
	populate(objectMap, "partitionNames", &o.PartitionNames)
	populate(objectMap, "partitionUpperBound", &o.PartitionUpperBound)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OraclePartitionSettings.
func (o *OraclePartitionSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "partitionColumnName":
			err = unpopulate(val, "PartitionColumnName", &o.PartitionColumnName)
			delete(rawMsg, key)
		case "partitionLowerBound":
			err = unpopulate(val, "PartitionLowerBound", &o.PartitionLowerBound)
			delete(rawMsg, key)
		case "partitionNames":
			err = unpopulate(val, "PartitionNames", &o.PartitionNames)
			delete(rawMsg, key)
		case "partitionUpperBound":
			err = unpopulate(val, "PartitionUpperBound", &o.PartitionUpperBound)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleServiceCloudLinkedService.
func (o OracleServiceCloudLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "connectVia", o.ConnectVia)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "parameters", o.Parameters)
	objectMap["type"] = "OracleServiceCloud"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleServiceCloudLinkedService.
func (o *OracleServiceCloudLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &o.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleServiceCloudLinkedServiceTypeProperties.
func (o OracleServiceCloudLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &o.EncryptedCredential)
	populate(objectMap, "host", &o.Host)
	populate(objectMap, "password", o.Password)
	populate(objectMap, "useEncryptedEndpoints", &o.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &o.UseHostVerification)
	populate(objectMap, "usePeerVerification", &o.UsePeerVerification)
	populate(objectMap, "username", &o.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleServiceCloudLinkedServiceTypeProperties.
func (o *OracleServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &o.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &o.Host)
			delete(rawMsg, key)
		case "password":
			o.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &o.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &o.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &o.UsePeerVerification)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &o.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleServiceCloudObjectDataset.
func (o OracleServiceCloudObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "OracleServiceCloudObject"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleServiceCloudObjectDataset.
func (o *OracleServiceCloudObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleServiceCloudSource.
func (o OracleServiceCloudSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &o.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "query", &o.Query)
	populate(objectMap, "queryTimeout", &o.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	objectMap["type"] = "OracleServiceCloudSource"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleServiceCloudSource.
func (o *OracleServiceCloudSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &o.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &o.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &o.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleSink.
func (o OracleSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &o.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &o.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &o.SinkRetryWait)
	objectMap["type"] = "OracleSink"
	populate(objectMap, "writeBatchSize", &o.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &o.WriteBatchTimeout)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleSink.
func (o *OracleSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &o.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &o.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &o.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &o.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &o.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleSource.
func (o OracleSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &o.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "oracleReaderQuery", &o.OracleReaderQuery)
	populate(objectMap, "partitionOption", &o.PartitionOption)
	populate(objectMap, "partitionSettings", o.PartitionSettings)
	populate(objectMap, "queryTimeout", &o.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	objectMap["type"] = "OracleSource"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleSource.
func (o *OracleSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &o.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "oracleReaderQuery":
			err = unpopulate(val, "OracleReaderQuery", &o.OracleReaderQuery)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &o.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &o.PartitionSettings)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &o.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleTableDataset.
func (o OracleTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "OracleTable"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleTableDataset.
func (o *OracleTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OracleTableDatasetTypeProperties.
func (o OracleTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "table", &o.Table)
	populate(objectMap, "tableName", &o.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OracleTableDatasetTypeProperties.
func (o *OracleTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &o.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &o.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcDataset.
func (o OrcDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", o.Annotations)
	populate(objectMap, "description", o.Description)
	populate(objectMap, "folder", o.Folder)
	populate(objectMap, "linkedServiceName", o.LinkedServiceName)
	populate(objectMap, "parameters", o.Parameters)
	populate(objectMap, "schema", &o.Schema)
	populate(objectMap, "structure", &o.Structure)
	objectMap["type"] = "Orc"
	populate(objectMap, "typeProperties", o.TypeProperties)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcDataset.
func (o *OrcDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &o.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &o.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &o.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &o.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &o.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &o.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &o.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &o.TypeProperties)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcDatasetTypeProperties.
func (o OrcDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "location", o.Location)
	populate(objectMap, "orcCompressionCodec", &o.OrcCompressionCodec)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcDatasetTypeProperties.
func (o *OrcDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "location":
			o.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		case "orcCompressionCodec":
			err = unpopulate(val, "OrcCompressionCodec", &o.OrcCompressionCodec)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcFormat.
func (o OrcFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deserializer", &o.Deserializer)
	populate(objectMap, "serializer", &o.Serializer)
	objectMap["type"] = "OrcFormat"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcFormat.
func (o *OrcFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deserializer":
			err = unpopulate(val, "Deserializer", &o.Deserializer)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &o.Serializer)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcSink.
func (o OrcSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "formatSettings", o.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &o.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &o.SinkRetryWait)
	populate(objectMap, "storeSettings", o.StoreSettings)
	objectMap["type"] = "OrcSink"
	populate(objectMap, "writeBatchSize", &o.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &o.WriteBatchTimeout)
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcSink.
func (o *OrcSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &o.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &o.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &o.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			o.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &o.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &o.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcSource.
func (o OrcSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &o.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &o.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &o.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &o.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &o.SourceRetryWait)
	populate(objectMap, "storeSettings", o.StoreSettings)
	objectMap["type"] = "OrcSource"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcSource.
func (o *OrcSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &o.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &o.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &o.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &o.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &o.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			o.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type OrcWriteSettings.
func (o OrcWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileNamePrefix", &o.FileNamePrefix)
	populate(objectMap, "maxRowsPerFile", &o.MaxRowsPerFile)
	objectMap["type"] = "OrcWriteSettings"
	if o.AdditionalProperties != nil {
		for key, val := range o.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type OrcWriteSettings.
func (o *OrcWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", o, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileNamePrefix":
			err = unpopulate(val, "FileNamePrefix", &o.FileNamePrefix)
			delete(rawMsg, key)
		case "maxRowsPerFile":
			err = unpopulate(val, "MaxRowsPerFile", &o.MaxRowsPerFile)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &o.Type)
			delete(rawMsg, key)
		default:
			if o.AdditionalProperties == nil {
				o.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				o.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", o, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ParameterSpecification.
func (p ParameterSpecification) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "defaultValue", &p.DefaultValue)
	populate(objectMap, "type", p.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ParquetDataset.
func (p ParquetDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "linkedServiceName", p.LinkedServiceName)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "structure", &p.Structure)
	objectMap["type"] = "Parquet"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetDataset.
func (p *ParquetDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &p.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &p.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ParquetDatasetTypeProperties.
func (p ParquetDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compressionCodec", &p.CompressionCodec)
	populate(objectMap, "location", p.Location)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ParquetFormat.
func (p ParquetFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deserializer", &p.Deserializer)
	populate(objectMap, "serializer", &p.Serializer)
	objectMap["type"] = "ParquetFormat"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetFormat.
func (p *ParquetFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deserializer":
			err = unpopulate(val, "Deserializer", &p.Deserializer)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &p.Serializer)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ParquetSink.
func (p ParquetSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "formatSettings", p.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &p.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &p.SinkRetryWait)
	populate(objectMap, "storeSettings", p.StoreSettings)
	objectMap["type"] = "ParquetSink"
	populate(objectMap, "writeBatchSize", &p.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &p.WriteBatchTimeout)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetSink.
func (p *ParquetSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &p.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &p.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &p.SinkRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			p.StoreSettings, err = unmarshalStoreWriteSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &p.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &p.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ParquetSource.
func (p ParquetSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &p.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &p.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &p.SourceRetryWait)
	populate(objectMap, "storeSettings", p.StoreSettings)
	objectMap["type"] = "ParquetSource"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetSource.
func (p *ParquetSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &p.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &p.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &p.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			p.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ParquetWriteSettings.
func (p ParquetWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileNamePrefix", &p.FileNamePrefix)
	populate(objectMap, "maxRowsPerFile", &p.MaxRowsPerFile)
	objectMap["type"] = "ParquetWriteSettings"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ParquetWriteSettings.
func (p *ParquetWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileNamePrefix":
			err = unpopulate(val, "FileNamePrefix", &p.FileNamePrefix)
			delete(rawMsg, key)
		case "maxRowsPerFile":
			err = unpopulate(val, "MaxRowsPerFile", &p.MaxRowsPerFile)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PaypalLinkedService.
func (p PaypalLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "connectVia", p.ConnectVia)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "parameters", p.Parameters)
	objectMap["type"] = "Paypal"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PaypalLinkedService.
func (p *PaypalLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &p.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PaypalLinkedServiceTypeProperties.
func (p PaypalLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &p.ClientID)
	populate(objectMap, "clientSecret", p.ClientSecret)
	populate(objectMap, "encryptedCredential", &p.EncryptedCredential)
	populate(objectMap, "host", &p.Host)
	populate(objectMap, "useEncryptedEndpoints", &p.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &p.UseHostVerification)
	populate(objectMap, "usePeerVerification", &p.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PaypalLinkedServiceTypeProperties.
func (p *PaypalLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &p.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			p.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &p.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &p.Host)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &p.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &p.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &p.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PaypalObjectDataset.
func (p PaypalObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "linkedServiceName", p.LinkedServiceName)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "structure", &p.Structure)
	objectMap["type"] = "PaypalObject"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PaypalObjectDataset.
func (p *PaypalObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &p.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &p.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PaypalSource.
func (p PaypalSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &p.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "query", &p.Query)
	populate(objectMap, "queryTimeout", &p.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &p.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &p.SourceRetryWait)
	objectMap["type"] = "PaypalSource"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PaypalSource.
func (p *PaypalSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &p.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &p.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &p.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &p.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &p.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PhoenixDatasetTypeProperties.
func (p PhoenixDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "table", &p.Table)
	populate(objectMap, "tableName", &p.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PhoenixDatasetTypeProperties.
func (p *PhoenixDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &p.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &p.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PhoenixLinkedService.
func (p PhoenixLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "connectVia", p.ConnectVia)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "parameters", p.Parameters)
	objectMap["type"] = "Phoenix"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PhoenixLinkedService.
func (p *PhoenixLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &p.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PhoenixLinkedServiceTypeProperties.
func (p PhoenixLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &p.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &p.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", p.AuthenticationType)
	populate(objectMap, "enableSsl", &p.EnableSSL)
	populate(objectMap, "encryptedCredential", &p.EncryptedCredential)
	populate(objectMap, "httpPath", &p.HTTPPath)
	populate(objectMap, "host", &p.Host)
	populate(objectMap, "password", p.Password)
	populate(objectMap, "port", &p.Port)
	populate(objectMap, "trustedCertPath", &p.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &p.UseSystemTrustStore)
	populate(objectMap, "username", &p.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PhoenixLinkedServiceTypeProperties.
func (p *PhoenixLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &p.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &p.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &p.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &p.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &p.EncryptedCredential)
			delete(rawMsg, key)
		case "httpPath":
			err = unpopulate(val, "HTTPPath", &p.HTTPPath)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &p.Host)
			delete(rawMsg, key)
		case "password":
			p.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &p.Port)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &p.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &p.UseSystemTrustStore)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &p.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PhoenixObjectDataset.
func (p PhoenixObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "linkedServiceName", p.LinkedServiceName)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "structure", &p.Structure)
	objectMap["type"] = "PhoenixObject"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PhoenixObjectDataset.
func (p *PhoenixObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &p.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &p.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PhoenixSource.
func (p PhoenixSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &p.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "query", &p.Query)
	populate(objectMap, "queryTimeout", &p.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &p.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &p.SourceRetryWait)
	objectMap["type"] = "PhoenixSource"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PhoenixSource.
func (p *PhoenixSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &p.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &p.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &p.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &p.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &p.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Pipeline.
func (p Pipeline) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activities", p.Activities)
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "concurrency", p.Concurrency)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "policy", p.Policy)
	populate(objectMap, "runDimensions", p.RunDimensions)
	populate(objectMap, "variables", p.Variables)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Pipeline.
func (p *Pipeline) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activities":
			p.Activities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "concurrency":
			err = unpopulate(val, "Concurrency", &p.Concurrency)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &p.Policy)
			delete(rawMsg, key)
		case "runDimensions":
			err = unpopulate(val, "RunDimensions", &p.RunDimensions)
			delete(rawMsg, key)
		case "variables":
			err = unpopulate(val, "Variables", &p.Variables)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PipelineElapsedTimeMetricPolicy.
func (p PipelineElapsedTimeMetricPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "duration", &p.Duration)
	return json.Marshal(objectMap)
}

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

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

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

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type PipelineResource.
func (p PipelineResource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "etag", p.Etag)
	populate(objectMap, "id", p.ID)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "properties", p.Properties)
	populate(objectMap, "type", p.Type)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type PipelineRun.
func (p PipelineRun) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "durationInMs", p.DurationInMs)
	populate(objectMap, "invokedBy", p.InvokedBy)
	populate(objectMap, "isLatest", p.IsLatest)
	populateTimeRFC3339(objectMap, "lastUpdated", p.LastUpdated)
	populate(objectMap, "message", p.Message)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "pipelineName", p.PipelineName)
	populate(objectMap, "runDimensions", p.RunDimensions)
	populateTimeRFC3339(objectMap, "runEnd", p.RunEnd)
	populate(objectMap, "runGroupId", p.RunGroupID)
	populate(objectMap, "runId", p.RunID)
	populateTimeRFC3339(objectMap, "runStart", p.RunStart)
	populate(objectMap, "status", p.Status)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRun.
func (p *PipelineRun) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "durationInMs":
			err = unpopulate(val, "DurationInMs", &p.DurationInMs)
			delete(rawMsg, key)
		case "invokedBy":
			err = unpopulate(val, "InvokedBy", &p.InvokedBy)
			delete(rawMsg, key)
		case "isLatest":
			err = unpopulate(val, "IsLatest", &p.IsLatest)
			delete(rawMsg, key)
		case "lastUpdated":
			err = unpopulateTimeRFC3339(val, "LastUpdated", &p.LastUpdated)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &p.Message)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "pipelineName":
			err = unpopulate(val, "PipelineName", &p.PipelineName)
			delete(rawMsg, key)
		case "runDimensions":
			err = unpopulate(val, "RunDimensions", &p.RunDimensions)
			delete(rawMsg, key)
		case "runEnd":
			err = unpopulateTimeRFC3339(val, "RunEnd", &p.RunEnd)
			delete(rawMsg, key)
		case "runGroupId":
			err = unpopulate(val, "RunGroupID", &p.RunGroupID)
			delete(rawMsg, key)
		case "runId":
			err = unpopulate(val, "RunID", &p.RunID)
			delete(rawMsg, key)
		case "runStart":
			err = unpopulateTimeRFC3339(val, "RunStart", &p.RunStart)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &p.Status)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PipelineRunInvokedBy.
func (p PipelineRunInvokedBy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "id", p.ID)
	populate(objectMap, "invokedByType", p.InvokedByType)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "pipelineName", p.PipelineName)
	populate(objectMap, "pipelineRunId", p.PipelineRunID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunInvokedBy.
func (p *PipelineRunInvokedBy) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "id":
			err = unpopulate(val, "ID", &p.ID)
			delete(rawMsg, key)
		case "invokedByType":
			err = unpopulate(val, "InvokedByType", &p.InvokedByType)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "pipelineName":
			err = unpopulate(val, "PipelineName", &p.PipelineName)
			delete(rawMsg, key)
		case "pipelineRunId":
			err = unpopulate(val, "PipelineRunID", &p.PipelineRunID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type PolybaseSettings.
func (p PolybaseSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "rejectSampleValue", &p.RejectSampleValue)
	populate(objectMap, "rejectType", p.RejectType)
	populate(objectMap, "rejectValue", &p.RejectValue)
	populate(objectMap, "useTypeDefault", &p.UseTypeDefault)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PolybaseSettings.
func (p *PolybaseSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "rejectSampleValue":
			err = unpopulate(val, "RejectSampleValue", &p.RejectSampleValue)
			delete(rawMsg, key)
		case "rejectType":
			err = unpopulate(val, "RejectType", &p.RejectType)
			delete(rawMsg, key)
		case "rejectValue":
			err = unpopulate(val, "RejectValue", &p.RejectValue)
			delete(rawMsg, key)
		case "useTypeDefault":
			err = unpopulate(val, "UseTypeDefault", &p.UseTypeDefault)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PostgreSQLLinkedService.
func (p PostgreSQLLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "connectVia", p.ConnectVia)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "parameters", p.Parameters)
	objectMap["type"] = "PostgreSql"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLLinkedService.
func (p *PostgreSQLLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &p.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PostgreSQLLinkedServiceTypeProperties.
func (p PostgreSQLLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &p.ConnectionString)
	populate(objectMap, "encryptedCredential", &p.EncryptedCredential)
	populate(objectMap, "password", p.Password)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLLinkedServiceTypeProperties.
func (p *PostgreSQLLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &p.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &p.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			err = unpopulate(val, "Password", &p.Password)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PostgreSQLSource.
func (p PostgreSQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &p.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "query", &p.Query)
	populate(objectMap, "queryTimeout", &p.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &p.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &p.SourceRetryWait)
	objectMap["type"] = "PostgreSqlSource"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLSource.
func (p *PostgreSQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &p.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &p.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &p.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &p.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &p.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PostgreSQLTableDataset.
func (p PostgreSQLTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "linkedServiceName", p.LinkedServiceName)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "structure", &p.Structure)
	objectMap["type"] = "PostgreSqlTable"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLTableDataset.
func (p *PostgreSQLTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &p.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &p.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PostgreSQLTableDatasetTypeProperties.
func (p PostgreSQLTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "table", &p.Table)
	populate(objectMap, "tableName", &p.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PostgreSQLTableDatasetTypeProperties.
func (p *PostgreSQLTableDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &p.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &p.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PowerQuerySink.
func (p PowerQuerySink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", p.Dataset)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "flowlet", p.Flowlet)
	populate(objectMap, "linkedService", p.LinkedService)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "rejectedDataLinkedService", p.RejectedDataLinkedService)
	populate(objectMap, "schemaLinkedService", p.SchemaLinkedService)
	populate(objectMap, "script", p.Script)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PowerQuerySink.
func (p *PowerQuerySink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &p.Dataset)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "flowlet":
			err = unpopulate(val, "Flowlet", &p.Flowlet)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &p.LinkedService)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "rejectedDataLinkedService":
			err = unpopulate(val, "RejectedDataLinkedService", &p.RejectedDataLinkedService)
			delete(rawMsg, key)
		case "schemaLinkedService":
			err = unpopulate(val, "SchemaLinkedService", &p.SchemaLinkedService)
			delete(rawMsg, key)
		case "script":
			err = unpopulate(val, "Script", &p.Script)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PowerQuerySinkMapping.
func (p PowerQuerySinkMapping) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataflowSinks", p.DataflowSinks)
	populate(objectMap, "queryName", p.QueryName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type PowerQuerySource.
func (p PowerQuerySource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", p.Dataset)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "flowlet", p.Flowlet)
	populate(objectMap, "linkedService", p.LinkedService)
	populate(objectMap, "name", p.Name)
	populate(objectMap, "schemaLinkedService", p.SchemaLinkedService)
	populate(objectMap, "script", p.Script)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PowerQuerySource.
func (p *PowerQuerySource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &p.Dataset)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "flowlet":
			err = unpopulate(val, "Flowlet", &p.Flowlet)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &p.LinkedService)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &p.Name)
			delete(rawMsg, key)
		case "schemaLinkedService":
			err = unpopulate(val, "SchemaLinkedService", &p.SchemaLinkedService)
			delete(rawMsg, key)
		case "script":
			err = unpopulate(val, "Script", &p.Script)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PowerQueryTypeProperties.
func (p PowerQueryTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "documentLocale", p.DocumentLocale)
	populate(objectMap, "script", p.Script)
	populate(objectMap, "sources", p.Sources)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PowerQueryTypeProperties.
func (p *PowerQueryTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "documentLocale":
			err = unpopulate(val, "DocumentLocale", &p.DocumentLocale)
			delete(rawMsg, key)
		case "script":
			err = unpopulate(val, "Script", &p.Script)
			delete(rawMsg, key)
		case "sources":
			err = unpopulate(val, "Sources", &p.Sources)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PrestoDatasetTypeProperties.
func (p PrestoDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "table", &p.Table)
	populate(objectMap, "tableName", &p.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrestoDatasetTypeProperties.
func (p *PrestoDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &p.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &p.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PrestoLinkedService.
func (p PrestoLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "connectVia", p.ConnectVia)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "parameters", p.Parameters)
	objectMap["type"] = "Presto"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrestoLinkedService.
func (p *PrestoLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &p.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PrestoLinkedServiceTypeProperties.
func (p PrestoLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &p.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &p.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", p.AuthenticationType)
	populate(objectMap, "catalog", &p.Catalog)
	populate(objectMap, "enableSsl", &p.EnableSSL)
	populate(objectMap, "encryptedCredential", &p.EncryptedCredential)
	populate(objectMap, "host", &p.Host)
	populate(objectMap, "password", p.Password)
	populate(objectMap, "port", &p.Port)
	populate(objectMap, "serverVersion", &p.ServerVersion)
	populate(objectMap, "timeZoneID", &p.TimeZoneID)
	populate(objectMap, "trustedCertPath", &p.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &p.UseSystemTrustStore)
	populate(objectMap, "username", &p.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrestoLinkedServiceTypeProperties.
func (p *PrestoLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &p.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &p.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &p.AuthenticationType)
			delete(rawMsg, key)
		case "catalog":
			err = unpopulate(val, "Catalog", &p.Catalog)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &p.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &p.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &p.Host)
			delete(rawMsg, key)
		case "password":
			p.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &p.Port)
			delete(rawMsg, key)
		case "serverVersion":
			err = unpopulate(val, "ServerVersion", &p.ServerVersion)
			delete(rawMsg, key)
		case "timeZoneID":
			err = unpopulate(val, "TimeZoneID", &p.TimeZoneID)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &p.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &p.UseSystemTrustStore)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &p.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PrestoObjectDataset.
func (p PrestoObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", p.Annotations)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "folder", p.Folder)
	populate(objectMap, "linkedServiceName", p.LinkedServiceName)
	populate(objectMap, "parameters", p.Parameters)
	populate(objectMap, "schema", &p.Schema)
	populate(objectMap, "structure", &p.Structure)
	objectMap["type"] = "PrestoObject"
	populate(objectMap, "typeProperties", p.TypeProperties)
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrestoObjectDataset.
func (p *PrestoObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &p.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &p.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &p.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &p.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &p.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &p.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &p.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &p.TypeProperties)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type PrestoSource.
func (p PrestoSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &p.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &p.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &p.MaxConcurrentConnections)
	populate(objectMap, "query", &p.Query)
	populate(objectMap, "queryTimeout", &p.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &p.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &p.SourceRetryWait)
	objectMap["type"] = "PrestoSource"
	if p.AdditionalProperties != nil {
		for key, val := range p.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrestoSource.
func (p *PrestoSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &p.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &p.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &p.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &p.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &p.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &p.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &p.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &p.Type)
			delete(rawMsg, key)
		default:
			if p.AdditionalProperties == nil {
				p.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				p.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type PrivateLinkConnectionApprovalRequest.
func (p PrivateLinkConnectionApprovalRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "privateEndpoint", p.PrivateEndpoint)
	populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type PrivateLinkConnectionState.
func (p PrivateLinkConnectionState) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "actionsRequired", p.ActionsRequired)
	populate(objectMap, "description", p.Description)
	populate(objectMap, "status", p.Status)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "groupId", p.GroupID)
	populate(objectMap, "requiredMembers", p.RequiredMembers)
	populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", p, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "groupId":
			err = unpopulate(val, "GroupID", &p.GroupID)
			delete(rawMsg, key)
		case "requiredMembers":
			err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
			delete(rawMsg, key)
		case "requiredZoneNames":
			err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", p, err)
		}
	}
	return nil
}

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type QuickBooksLinkedService.
func (q QuickBooksLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", q.Annotations)
	populate(objectMap, "connectVia", q.ConnectVia)
	populate(objectMap, "description", q.Description)
	populate(objectMap, "parameters", q.Parameters)
	objectMap["type"] = "QuickBooks"
	populate(objectMap, "typeProperties", q.TypeProperties)
	if q.AdditionalProperties != nil {
		for key, val := range q.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickBooksLinkedService.
func (q *QuickBooksLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &q.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &q.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &q.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &q.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &q.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &q.TypeProperties)
			delete(rawMsg, key)
		default:
			if q.AdditionalProperties == nil {
				q.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				q.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type QuickBooksLinkedServiceTypeProperties.
func (q QuickBooksLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", q.AccessToken)
	populate(objectMap, "accessTokenSecret", q.AccessTokenSecret)
	populate(objectMap, "companyId", &q.CompanyID)
	populate(objectMap, "connectionProperties", &q.ConnectionProperties)
	populate(objectMap, "consumerKey", &q.ConsumerKey)
	populate(objectMap, "consumerSecret", q.ConsumerSecret)
	populate(objectMap, "encryptedCredential", &q.EncryptedCredential)
	populate(objectMap, "endpoint", &q.Endpoint)
	populate(objectMap, "useEncryptedEndpoints", &q.UseEncryptedEndpoints)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickBooksLinkedServiceTypeProperties.
func (q *QuickBooksLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			q.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "accessTokenSecret":
			q.AccessTokenSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "companyId":
			err = unpopulate(val, "CompanyID", &q.CompanyID)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &q.ConnectionProperties)
			delete(rawMsg, key)
		case "consumerKey":
			err = unpopulate(val, "ConsumerKey", &q.ConsumerKey)
			delete(rawMsg, key)
		case "consumerSecret":
			q.ConsumerSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &q.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &q.Endpoint)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &q.UseEncryptedEndpoints)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type QuickBooksObjectDataset.
func (q QuickBooksObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", q.Annotations)
	populate(objectMap, "description", q.Description)
	populate(objectMap, "folder", q.Folder)
	populate(objectMap, "linkedServiceName", q.LinkedServiceName)
	populate(objectMap, "parameters", q.Parameters)
	populate(objectMap, "schema", &q.Schema)
	populate(objectMap, "structure", &q.Structure)
	objectMap["type"] = "QuickBooksObject"
	populate(objectMap, "typeProperties", q.TypeProperties)
	if q.AdditionalProperties != nil {
		for key, val := range q.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickBooksObjectDataset.
func (q *QuickBooksObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &q.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &q.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &q.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &q.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &q.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &q.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &q.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &q.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &q.TypeProperties)
			delete(rawMsg, key)
		default:
			if q.AdditionalProperties == nil {
				q.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				q.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type QuickBooksSource.
func (q QuickBooksSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &q.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &q.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &q.MaxConcurrentConnections)
	populate(objectMap, "query", &q.Query)
	populate(objectMap, "queryTimeout", &q.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &q.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &q.SourceRetryWait)
	objectMap["type"] = "QuickBooksSource"
	if q.AdditionalProperties != nil {
		for key, val := range q.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickBooksSource.
func (q *QuickBooksSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &q.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &q.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &q.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &q.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &q.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &q.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &q.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &q.Type)
			delete(rawMsg, key)
		default:
			if q.AdditionalProperties == nil {
				q.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				q.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type QuickbaseLinkedService.
func (q QuickbaseLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", q.Annotations)
	populate(objectMap, "connectVia", q.ConnectVia)
	populate(objectMap, "description", q.Description)
	populate(objectMap, "parameters", q.Parameters)
	objectMap["type"] = "Quickbase"
	populate(objectMap, "typeProperties", q.TypeProperties)
	if q.AdditionalProperties != nil {
		for key, val := range q.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickbaseLinkedService.
func (q *QuickbaseLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &q.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &q.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &q.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &q.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &q.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &q.TypeProperties)
			delete(rawMsg, key)
		default:
			if q.AdditionalProperties == nil {
				q.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				q.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type QuickbaseLinkedServiceTypeProperties.
func (q QuickbaseLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &q.EncryptedCredential)
	populate(objectMap, "url", &q.URL)
	populate(objectMap, "userToken", q.UserToken)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type QuickbaseLinkedServiceTypeProperties.
func (q *QuickbaseLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", q, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &q.EncryptedCredential)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &q.URL)
			delete(rawMsg, key)
		case "userToken":
			q.UserToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", q, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RecurrenceSchedule.
func (r RecurrenceSchedule) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "hours", r.Hours)
	populate(objectMap, "minutes", r.Minutes)
	populate(objectMap, "monthDays", r.MonthDays)
	populate(objectMap, "monthlyOccurrences", r.MonthlyOccurrences)
	populate(objectMap, "weekDays", r.WeekDays)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceSchedule.
func (r *RecurrenceSchedule) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "hours":
			err = unpopulate(val, "Hours", &r.Hours)
			delete(rawMsg, key)
		case "minutes":
			err = unpopulate(val, "Minutes", &r.Minutes)
			delete(rawMsg, key)
		case "monthDays":
			err = unpopulate(val, "MonthDays", &r.MonthDays)
			delete(rawMsg, key)
		case "monthlyOccurrences":
			err = unpopulate(val, "MonthlyOccurrences", &r.MonthlyOccurrences)
			delete(rawMsg, key)
		case "weekDays":
			err = unpopulate(val, "WeekDays", &r.WeekDays)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RecurrenceScheduleOccurrence.
func (r RecurrenceScheduleOccurrence) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "day", r.Day)
	populate(objectMap, "occurrence", r.Occurrence)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RecurrenceScheduleOccurrence.
func (r *RecurrenceScheduleOccurrence) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "day":
			err = unpopulate(val, "Day", &r.Day)
			delete(rawMsg, key)
		case "occurrence":
			err = unpopulate(val, "Occurrence", &r.Occurrence)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RedirectIncompatibleRowSettings.
func (r RedirectIncompatibleRowSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "linkedServiceName", &r.LinkedServiceName)
	populate(objectMap, "path", &r.Path)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RedirectIncompatibleRowSettings.
func (r *RedirectIncompatibleRowSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &r.LinkedServiceName)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &r.Path)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RedshiftUnloadSettings.
func (r RedshiftUnloadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "bucketName", &r.BucketName)
	populate(objectMap, "s3LinkedServiceName", r.S3LinkedServiceName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type RelationalSource.
func (r RelationalSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &r.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &r.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &r.MaxConcurrentConnections)
	populate(objectMap, "query", &r.Query)
	populate(objectMap, "sourceRetryCount", &r.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &r.SourceRetryWait)
	objectMap["type"] = "RelationalSource"
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RelationalSource.
func (r *RelationalSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &r.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &r.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &r.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &r.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &r.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &r.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RelationalTableDataset.
func (r RelationalTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "folder", r.Folder)
	populate(objectMap, "linkedServiceName", r.LinkedServiceName)
	populate(objectMap, "parameters", r.Parameters)
	populate(objectMap, "schema", &r.Schema)
	populate(objectMap, "structure", &r.Structure)
	objectMap["type"] = "RelationalTable"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RelationalTableDataset.
func (r *RelationalTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &r.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &r.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &r.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &r.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &r.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RelationalTableDatasetTypeProperties.
func (r RelationalTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &r.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnection.
func (r RemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "privateEndpoint", r.PrivateEndpoint)
	populate(objectMap, "privateLinkServiceConnectionState", r.PrivateLinkServiceConnectionState)
	populate(objectMap, "provisioningState", r.ProvisioningState)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type RerunTumblingWindowTrigger.
func (r RerunTumblingWindowTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "runtimeState", r.RuntimeState)
	objectMap["type"] = "RerunTumblingWindowTrigger"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RerunTumblingWindowTrigger.
func (r *RerunTumblingWindowTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &r.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RerunTumblingWindowTriggerTypeProperties.
func (r RerunTumblingWindowTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parentTrigger", &r.ParentTrigger)
	populateTimeRFC3339(objectMap, "requestedEndTime", r.RequestedEndTime)
	populateTimeRFC3339(objectMap, "requestedStartTime", r.RequestedStartTime)
	populate(objectMap, "rerunConcurrency", r.RerunConcurrency)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RerunTumblingWindowTriggerTypeProperties.
func (r *RerunTumblingWindowTriggerTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "parentTrigger":
			err = unpopulate(val, "ParentTrigger", &r.ParentTrigger)
			delete(rawMsg, key)
		case "requestedEndTime":
			err = unpopulateTimeRFC3339(val, "RequestedEndTime", &r.RequestedEndTime)
			delete(rawMsg, key)
		case "requestedStartTime":
			err = unpopulateTimeRFC3339(val, "RequestedStartTime", &r.RequestedStartTime)
			delete(rawMsg, key)
		case "rerunConcurrency":
			err = unpopulate(val, "RerunConcurrency", &r.RerunConcurrency)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResponsysLinkedService.
func (r ResponsysLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "connectVia", r.ConnectVia)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "parameters", r.Parameters)
	objectMap["type"] = "Responsys"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResponsysLinkedService.
func (r *ResponsysLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &r.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &r.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResponsysLinkedServiceTypeProperties.
func (r ResponsysLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &r.ClientID)
	populate(objectMap, "clientSecret", r.ClientSecret)
	populate(objectMap, "encryptedCredential", &r.EncryptedCredential)
	populate(objectMap, "endpoint", &r.Endpoint)
	populate(objectMap, "useEncryptedEndpoints", &r.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &r.UseHostVerification)
	populate(objectMap, "usePeerVerification", &r.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResponsysLinkedServiceTypeProperties.
func (r *ResponsysLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &r.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			r.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &r.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &r.Endpoint)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &r.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &r.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &r.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResponsysObjectDataset.
func (r ResponsysObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "folder", r.Folder)
	populate(objectMap, "linkedServiceName", r.LinkedServiceName)
	populate(objectMap, "parameters", r.Parameters)
	populate(objectMap, "schema", &r.Schema)
	populate(objectMap, "structure", &r.Structure)
	objectMap["type"] = "ResponsysObject"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResponsysObjectDataset.
func (r *ResponsysObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &r.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &r.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &r.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &r.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &r.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ResponsysSource.
func (r ResponsysSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &r.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &r.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &r.MaxConcurrentConnections)
	populate(objectMap, "query", &r.Query)
	populate(objectMap, "queryTimeout", &r.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &r.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &r.SourceRetryWait)
	objectMap["type"] = "ResponsysSource"
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ResponsysSource.
func (r *ResponsysSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &r.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &r.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &r.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &r.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &r.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &r.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &r.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestResourceDataset.
func (r RestResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "folder", r.Folder)
	populate(objectMap, "linkedServiceName", r.LinkedServiceName)
	populate(objectMap, "parameters", r.Parameters)
	populate(objectMap, "schema", &r.Schema)
	populate(objectMap, "structure", &r.Structure)
	objectMap["type"] = "RestResource"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestResourceDataset.
func (r *RestResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &r.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &r.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &r.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &r.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &r.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestResourceDatasetTypeProperties.
func (r RestResourceDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalHeaders", &r.AdditionalHeaders)
	populate(objectMap, "paginationRules", &r.PaginationRules)
	populate(objectMap, "relativeUrl", &r.RelativeURL)
	populate(objectMap, "requestBody", &r.RequestBody)
	populate(objectMap, "requestMethod", &r.RequestMethod)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestResourceDatasetTypeProperties.
func (r *RestResourceDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalHeaders":
			err = unpopulate(val, "AdditionalHeaders", &r.AdditionalHeaders)
			delete(rawMsg, key)
		case "paginationRules":
			err = unpopulate(val, "PaginationRules", &r.PaginationRules)
			delete(rawMsg, key)
		case "relativeUrl":
			err = unpopulate(val, "RelativeURL", &r.RelativeURL)
			delete(rawMsg, key)
		case "requestBody":
			err = unpopulate(val, "RequestBody", &r.RequestBody)
			delete(rawMsg, key)
		case "requestMethod":
			err = unpopulate(val, "RequestMethod", &r.RequestMethod)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestServiceLinkedService.
func (r RestServiceLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", r.Annotations)
	populate(objectMap, "connectVia", r.ConnectVia)
	populate(objectMap, "description", r.Description)
	populate(objectMap, "parameters", r.Parameters)
	objectMap["type"] = "RestService"
	populate(objectMap, "typeProperties", r.TypeProperties)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestServiceLinkedService.
func (r *RestServiceLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &r.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &r.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &r.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &r.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &r.TypeProperties)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestServiceLinkedServiceTypeProperties.
func (r RestServiceLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "aadResourceId", &r.AADResourceID)
	populate(objectMap, "authHeaders", &r.AuthHeaders)
	populate(objectMap, "authenticationType", r.AuthenticationType)
	populate(objectMap, "azureCloudType", &r.AzureCloudType)
	populate(objectMap, "clientId", &r.ClientID)
	populate(objectMap, "clientSecret", r.ClientSecret)
	populate(objectMap, "credential", r.Credential)
	populate(objectMap, "enableServerCertificateValidation", &r.EnableServerCertificateValidation)
	populate(objectMap, "encryptedCredential", &r.EncryptedCredential)
	populate(objectMap, "password", r.Password)
	populate(objectMap, "resource", &r.Resource)
	populate(objectMap, "scope", &r.Scope)
	populate(objectMap, "servicePrincipalId", &r.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", r.ServicePrincipalKey)
	populate(objectMap, "tenant", &r.Tenant)
	populate(objectMap, "tokenEndpoint", &r.TokenEndpoint)
	populate(objectMap, "url", &r.URL)
	populate(objectMap, "userName", &r.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestServiceLinkedServiceTypeProperties.
func (r *RestServiceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "aadResourceId":
			err = unpopulate(val, "AADResourceID", &r.AADResourceID)
			delete(rawMsg, key)
		case "authHeaders":
			err = unpopulate(val, "AuthHeaders", &r.AuthHeaders)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &r.AuthenticationType)
			delete(rawMsg, key)
		case "azureCloudType":
			err = unpopulate(val, "AzureCloudType", &r.AzureCloudType)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &r.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			r.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &r.Credential)
			delete(rawMsg, key)
		case "enableServerCertificateValidation":
			err = unpopulate(val, "EnableServerCertificateValidation", &r.EnableServerCertificateValidation)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &r.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			r.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "resource":
			err = unpopulate(val, "Resource", &r.Resource)
			delete(rawMsg, key)
		case "scope":
			err = unpopulate(val, "Scope", &r.Scope)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &r.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			r.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "tenant":
			err = unpopulate(val, "Tenant", &r.Tenant)
			delete(rawMsg, key)
		case "tokenEndpoint":
			err = unpopulate(val, "TokenEndpoint", &r.TokenEndpoint)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &r.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &r.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestSink.
func (r RestSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalHeaders", &r.AdditionalHeaders)
	populate(objectMap, "disableMetricsCollection", &r.DisableMetricsCollection)
	populate(objectMap, "httpCompressionType", &r.HTTPCompressionType)
	populate(objectMap, "httpRequestTimeout", &r.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &r.MaxConcurrentConnections)
	populate(objectMap, "requestInterval", &r.RequestInterval)
	populate(objectMap, "requestMethod", &r.RequestMethod)
	populate(objectMap, "sinkRetryCount", &r.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &r.SinkRetryWait)
	objectMap["type"] = "RestSink"
	populate(objectMap, "writeBatchSize", &r.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &r.WriteBatchTimeout)
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestSink.
func (r *RestSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalHeaders":
			err = unpopulate(val, "AdditionalHeaders", &r.AdditionalHeaders)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &r.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpCompressionType":
			err = unpopulate(val, "HTTPCompressionType", &r.HTTPCompressionType)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &r.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &r.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "requestInterval":
			err = unpopulate(val, "RequestInterval", &r.RequestInterval)
			delete(rawMsg, key)
		case "requestMethod":
			err = unpopulate(val, "RequestMethod", &r.RequestMethod)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &r.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &r.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &r.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &r.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RestSource.
func (r RestSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &r.AdditionalColumns)
	populate(objectMap, "additionalHeaders", &r.AdditionalHeaders)
	populate(objectMap, "disableMetricsCollection", &r.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &r.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &r.MaxConcurrentConnections)
	populate(objectMap, "paginationRules", &r.PaginationRules)
	populate(objectMap, "requestBody", &r.RequestBody)
	populate(objectMap, "requestInterval", &r.RequestInterval)
	populate(objectMap, "requestMethod", &r.RequestMethod)
	populate(objectMap, "sourceRetryCount", &r.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &r.SourceRetryWait)
	objectMap["type"] = "RestSource"
	if r.AdditionalProperties != nil {
		for key, val := range r.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RestSource.
func (r *RestSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &r.AdditionalColumns)
			delete(rawMsg, key)
		case "additionalHeaders":
			err = unpopulate(val, "AdditionalHeaders", &r.AdditionalHeaders)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &r.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &r.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &r.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "paginationRules":
			err = unpopulate(val, "PaginationRules", &r.PaginationRules)
			delete(rawMsg, key)
		case "requestBody":
			err = unpopulate(val, "RequestBody", &r.RequestBody)
			delete(rawMsg, key)
		case "requestInterval":
			err = unpopulate(val, "RequestInterval", &r.RequestInterval)
			delete(rawMsg, key)
		case "requestMethod":
			err = unpopulate(val, "RequestMethod", &r.RequestMethod)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &r.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &r.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &r.Type)
			delete(rawMsg, key)
		default:
			if r.AdditionalProperties == nil {
				r.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				r.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RetryPolicy.
func (r RetryPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "count", &r.Count)
	populate(objectMap, "intervalInSeconds", r.IntervalInSeconds)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type RunFilterParameters.
func (r RunFilterParameters) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "continuationToken", r.ContinuationToken)
	populate(objectMap, "filters", r.Filters)
	populateTimeRFC3339(objectMap, "lastUpdatedAfter", r.LastUpdatedAfter)
	populateTimeRFC3339(objectMap, "lastUpdatedBefore", r.LastUpdatedBefore)
	populate(objectMap, "orderBy", r.OrderBy)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RunFilterParameters.
func (r *RunFilterParameters) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "continuationToken":
			err = unpopulate(val, "ContinuationToken", &r.ContinuationToken)
			delete(rawMsg, key)
		case "filters":
			err = unpopulate(val, "Filters", &r.Filters)
			delete(rawMsg, key)
		case "lastUpdatedAfter":
			err = unpopulateTimeRFC3339(val, "LastUpdatedAfter", &r.LastUpdatedAfter)
			delete(rawMsg, key)
		case "lastUpdatedBefore":
			err = unpopulateTimeRFC3339(val, "LastUpdatedBefore", &r.LastUpdatedBefore)
			delete(rawMsg, key)
		case "orderBy":
			err = unpopulate(val, "OrderBy", &r.OrderBy)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RunQueryFilter.
func (r RunQueryFilter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "operand", r.Operand)
	populate(objectMap, "operator", r.Operator)
	populate(objectMap, "values", r.Values)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type RunQueryFilter.
func (r *RunQueryFilter) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", r, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "operand":
			err = unpopulate(val, "Operand", &r.Operand)
			delete(rawMsg, key)
		case "operator":
			err = unpopulate(val, "Operator", &r.Operator)
			delete(rawMsg, key)
		case "values":
			err = unpopulate(val, "Values", &r.Values)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", r, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type RunQueryOrderBy.
func (r RunQueryOrderBy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "order", r.Order)
	populate(objectMap, "orderBy", r.OrderBy)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SQLAlwaysEncryptedProperties.
func (s SQLAlwaysEncryptedProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alwaysEncryptedAkvAuthType", s.AlwaysEncryptedAkvAuthType)
	populate(objectMap, "credential", s.Credential)
	populate(objectMap, "servicePrincipalId", &s.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", s.ServicePrincipalKey)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLAlwaysEncryptedProperties.
func (s *SQLAlwaysEncryptedProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alwaysEncryptedAkvAuthType":
			err = unpopulate(val, "AlwaysEncryptedAkvAuthType", &s.AlwaysEncryptedAkvAuthType)
			delete(rawMsg, key)
		case "credential":
			err = unpopulate(val, "Credential", &s.Credential)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &s.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			s.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLDWSink.
func (s SQLDWSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowCopyCommand", &s.AllowCopyCommand)
	populate(objectMap, "allowPolyBase", &s.AllowPolyBase)
	populate(objectMap, "copyCommandSettings", s.CopyCommandSettings)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "polyBaseSettings", s.PolyBaseSettings)
	populate(objectMap, "preCopyScript", &s.PreCopyScript)
	populate(objectMap, "sqlWriterUseTableLock", &s.SQLWriterUseTableLock)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	populate(objectMap, "tableOption", &s.TableOption)
	objectMap["type"] = "SqlDWSink"
	populate(objectMap, "upsertSettings", s.UpsertSettings)
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDWSink.
func (s *SQLDWSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowCopyCommand":
			err = unpopulate(val, "AllowCopyCommand", &s.AllowCopyCommand)
			delete(rawMsg, key)
		case "allowPolyBase":
			err = unpopulate(val, "AllowPolyBase", &s.AllowPolyBase)
			delete(rawMsg, key)
		case "copyCommandSettings":
			err = unpopulate(val, "CopyCommandSettings", &s.CopyCommandSettings)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "polyBaseSettings":
			err = unpopulate(val, "PolyBaseSettings", &s.PolyBaseSettings)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &s.PreCopyScript)
			delete(rawMsg, key)
		case "sqlWriterUseTableLock":
			err = unpopulate(val, "SQLWriterUseTableLock", &s.SQLWriterUseTableLock)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "tableOption":
			err = unpopulate(val, "TableOption", &s.TableOption)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "upsertSettings":
			err = unpopulate(val, "UpsertSettings", &s.UpsertSettings)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLDWSource.
func (s SQLDWSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &s.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	objectMap["type"] = "SqlDWSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDWSource.
func (s *SQLDWSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &s.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLDWUpsertSettings.
func (s SQLDWUpsertSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "interimSchemaName", &s.InterimSchemaName)
	populate(objectMap, "keys", &s.Keys)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SQLMISink.
func (s SQLMISink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &s.PreCopyScript)
	populate(objectMap, "sqlWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
	populate(objectMap, "sqlWriterTableType", &s.SQLWriterTableType)
	populate(objectMap, "sqlWriterUseTableLock", &s.SQLWriterUseTableLock)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	populate(objectMap, "storedProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
	populate(objectMap, "tableOption", &s.TableOption)
	objectMap["type"] = "SqlMISink"
	populate(objectMap, "upsertSettings", s.UpsertSettings)
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMISink.
func (s *SQLMISink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &s.PreCopyScript)
			delete(rawMsg, key)
		case "sqlWriterStoredProcedureName":
			err = unpopulate(val, "SQLWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
			delete(rawMsg, key)
		case "sqlWriterTableType":
			err = unpopulate(val, "SQLWriterTableType", &s.SQLWriterTableType)
			delete(rawMsg, key)
		case "sqlWriterUseTableLock":
			err = unpopulate(val, "SQLWriterUseTableLock", &s.SQLWriterUseTableLock)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "storedProcedureTableTypeParameterName":
			err = unpopulate(val, "StoredProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
			delete(rawMsg, key)
		case "tableOption":
			err = unpopulate(val, "TableOption", &s.TableOption)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "upsertSettings":
			err = unpopulate(val, "UpsertSettings", &s.UpsertSettings)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLMISource.
func (s SQLMISource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "produceAdditionalTypes", &s.ProduceAdditionalTypes)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &s.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	objectMap["type"] = "SqlMISource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLMISource.
func (s *SQLMISource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "produceAdditionalTypes":
			err = unpopulate(val, "ProduceAdditionalTypes", &s.ProduceAdditionalTypes)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &s.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLPartitionSettings.
func (s SQLPartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &s.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &s.PartitionLowerBound)
	populate(objectMap, "partitionUpperBound", &s.PartitionUpperBound)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SQLServerLinkedService.
func (s SQLServerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SqlServer"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerLinkedService.
func (s *SQLServerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerLinkedServiceTypeProperties.
func (s SQLServerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "alwaysEncryptedSettings", s.AlwaysEncryptedSettings)
	populate(objectMap, "connectionString", &s.ConnectionString)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerLinkedServiceTypeProperties.
func (s *SQLServerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "alwaysEncryptedSettings":
			err = unpopulate(val, "AlwaysEncryptedSettings", &s.AlwaysEncryptedSettings)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &s.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerSink.
func (s SQLServerSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &s.PreCopyScript)
	populate(objectMap, "sqlWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
	populate(objectMap, "sqlWriterTableType", &s.SQLWriterTableType)
	populate(objectMap, "sqlWriterUseTableLock", &s.SQLWriterUseTableLock)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	populate(objectMap, "storedProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
	populate(objectMap, "tableOption", &s.TableOption)
	objectMap["type"] = "SqlServerSink"
	populate(objectMap, "upsertSettings", s.UpsertSettings)
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerSink.
func (s *SQLServerSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &s.PreCopyScript)
			delete(rawMsg, key)
		case "sqlWriterStoredProcedureName":
			err = unpopulate(val, "SQLWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
			delete(rawMsg, key)
		case "sqlWriterTableType":
			err = unpopulate(val, "SQLWriterTableType", &s.SQLWriterTableType)
			delete(rawMsg, key)
		case "sqlWriterUseTableLock":
			err = unpopulate(val, "SQLWriterUseTableLock", &s.SQLWriterUseTableLock)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "storedProcedureTableTypeParameterName":
			err = unpopulate(val, "StoredProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
			delete(rawMsg, key)
		case "tableOption":
			err = unpopulate(val, "TableOption", &s.TableOption)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "upsertSettings":
			err = unpopulate(val, "UpsertSettings", &s.UpsertSettings)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerSource.
func (s SQLServerSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "produceAdditionalTypes", &s.ProduceAdditionalTypes)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &s.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	objectMap["type"] = "SqlServerSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerSource.
func (s *SQLServerSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "produceAdditionalTypes":
			err = unpopulate(val, "ProduceAdditionalTypes", &s.ProduceAdditionalTypes)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &s.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerStoredProcedureActivity.
func (s SQLServerStoredProcedureActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "policy", s.Policy)
	objectMap["type"] = "SqlServerStoredProcedure"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerStoredProcedureActivity.
func (s *SQLServerStoredProcedureActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &s.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerStoredProcedureActivityTypeProperties.
func (s SQLServerStoredProcedureActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "storedProcedureName", &s.StoredProcedureName)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SQLServerTableDataset.
func (s SQLServerTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SqlServerTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLServerTableDataset.
func (s *SQLServerTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLServerTableDatasetTypeProperties.
func (s SQLServerTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "table", &s.Table)
	populate(objectMap, "tableName", &s.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SQLSink.
func (s SQLSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &s.PreCopyScript)
	populate(objectMap, "sqlWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
	populate(objectMap, "sqlWriterTableType", &s.SQLWriterTableType)
	populate(objectMap, "sqlWriterUseTableLock", &s.SQLWriterUseTableLock)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	populate(objectMap, "storedProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
	populate(objectMap, "tableOption", &s.TableOption)
	objectMap["type"] = "SqlSink"
	populate(objectMap, "upsertSettings", s.UpsertSettings)
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", &s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLSink.
func (s *SQLSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &s.PreCopyScript)
			delete(rawMsg, key)
		case "sqlWriterStoredProcedureName":
			err = unpopulate(val, "SQLWriterStoredProcedureName", &s.SQLWriterStoredProcedureName)
			delete(rawMsg, key)
		case "sqlWriterTableType":
			err = unpopulate(val, "SQLWriterTableType", &s.SQLWriterTableType)
			delete(rawMsg, key)
		case "sqlWriterUseTableLock":
			err = unpopulate(val, "SQLWriterUseTableLock", &s.SQLWriterUseTableLock)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "storedProcedureTableTypeParameterName":
			err = unpopulate(val, "StoredProcedureTableTypeParameterName", &s.StoredProcedureTableTypeParameterName)
			delete(rawMsg, key)
		case "tableOption":
			err = unpopulate(val, "TableOption", &s.TableOption)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "upsertSettings":
			err = unpopulate(val, "UpsertSettings", &s.UpsertSettings)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLSource.
func (s SQLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "isolationLevel", &s.IsolationLevel)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sqlReaderQuery", &s.SQLReaderQuery)
	populate(objectMap, "sqlReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	populate(objectMap, "storedProcedureParameters", &s.StoredProcedureParameters)
	objectMap["type"] = "SqlSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SQLSource.
func (s *SQLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "isolationLevel":
			err = unpopulate(val, "IsolationLevel", &s.IsolationLevel)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sqlReaderQuery":
			err = unpopulate(val, "SQLReaderQuery", &s.SQLReaderQuery)
			delete(rawMsg, key)
		case "sqlReaderStoredProcedureName":
			err = unpopulate(val, "SQLReaderStoredProcedureName", &s.SQLReaderStoredProcedureName)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "storedProcedureParameters":
			err = unpopulate(val, "StoredProcedureParameters", &s.StoredProcedureParameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SQLUpsertSettings.
func (s SQLUpsertSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "interimSchemaName", &s.InterimSchemaName)
	populate(objectMap, "keys", &s.Keys)
	populate(objectMap, "useTempDB", &s.UseTempDB)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SSISAccessCredential.
func (s SSISAccessCredential) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "domain", &s.Domain)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SSISAccessCredential.
func (s *SSISAccessCredential) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "domain":
			err = unpopulate(val, "Domain", &s.Domain)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SSISChildPackage.
func (s SSISChildPackage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "packageContent", &s.PackageContent)
	populate(objectMap, "packageLastModifiedDate", s.PackageLastModifiedDate)
	populate(objectMap, "packageName", s.PackageName)
	populate(objectMap, "packagePath", &s.PackagePath)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SSISChildPackage.
func (s *SSISChildPackage) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "packageContent":
			err = unpopulate(val, "PackageContent", &s.PackageContent)
			delete(rawMsg, key)
		case "packageLastModifiedDate":
			err = unpopulate(val, "PackageLastModifiedDate", &s.PackageLastModifiedDate)
			delete(rawMsg, key)
		case "packageName":
			err = unpopulate(val, "PackageName", &s.PackageName)
			delete(rawMsg, key)
		case "packagePath":
			err = unpopulate(val, "PackagePath", &s.PackagePath)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SSISExecutionCredential.
func (s SSISExecutionCredential) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "domain", &s.Domain)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type SSISLogLocation.
func (s SSISLogLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "logPath", &s.LogPath)
	populate(objectMap, "type", s.Type)
	populate(objectMap, "typeProperties", s.TypeProperties)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SSISLogLocationTypeProperties.
func (s SSISLogLocationTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessCredential", s.AccessCredential)
	populate(objectMap, "logRefreshInterval", &s.LogRefreshInterval)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SSISPackageLocation.
func (s SSISPackageLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "packagePath", &s.PackagePath)
	populate(objectMap, "type", s.Type)
	populate(objectMap, "typeProperties", s.TypeProperties)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SSISPackageLocationTypeProperties.
func (s SSISPackageLocationTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessCredential", s.AccessCredential)
	populate(objectMap, "childPackages", s.ChildPackages)
	populate(objectMap, "configurationAccessCredential", s.ConfigurationAccessCredential)
	populate(objectMap, "configurationPath", &s.ConfigurationPath)
	populate(objectMap, "packageContent", &s.PackageContent)
	populate(objectMap, "packageLastModifiedDate", s.PackageLastModifiedDate)
	populate(objectMap, "packageName", s.PackageName)
	populate(objectMap, "packagePassword", s.PackagePassword)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SSISPackageLocationTypeProperties.
func (s *SSISPackageLocationTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessCredential":
			err = unpopulate(val, "AccessCredential", &s.AccessCredential)
			delete(rawMsg, key)
		case "childPackages":
			err = unpopulate(val, "ChildPackages", &s.ChildPackages)
			delete(rawMsg, key)
		case "configurationAccessCredential":
			err = unpopulate(val, "ConfigurationAccessCredential", &s.ConfigurationAccessCredential)
			delete(rawMsg, key)
		case "configurationPath":
			err = unpopulate(val, "ConfigurationPath", &s.ConfigurationPath)
			delete(rawMsg, key)
		case "packageContent":
			err = unpopulate(val, "PackageContent", &s.PackageContent)
			delete(rawMsg, key)
		case "packageLastModifiedDate":
			err = unpopulate(val, "PackageLastModifiedDate", &s.PackageLastModifiedDate)
			delete(rawMsg, key)
		case "packageName":
			err = unpopulate(val, "PackageName", &s.PackageName)
			delete(rawMsg, key)
		case "packagePassword":
			s.PackagePassword, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type SalesforceLinkedService.
func (s SalesforceLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Salesforce"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceLinkedService.
func (s *SalesforceLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceLinkedServiceTypeProperties.
func (s SalesforceLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiVersion", &s.APIVersion)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "environmentUrl", &s.EnvironmentURL)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "securityToken", s.SecurityToken)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceLinkedServiceTypeProperties.
func (s *SalesforceLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiVersion":
			err = unpopulate(val, "APIVersion", &s.APIVersion)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "environmentUrl":
			err = unpopulate(val, "EnvironmentURL", &s.EnvironmentURL)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "securityToken":
			s.SecurityToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceMarketingCloudLinkedService.
func (s SalesforceMarketingCloudLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SalesforceMarketingCloud"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceMarketingCloudLinkedService.
func (s *SalesforceMarketingCloudLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceMarketingCloudLinkedServiceTypeProperties.
func (s SalesforceMarketingCloudLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "clientSecret", s.ClientSecret)
	populate(objectMap, "connectionProperties", &s.ConnectionProperties)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "useEncryptedEndpoints", &s.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &s.UseHostVerification)
	populate(objectMap, "usePeerVerification", &s.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceMarketingCloudLinkedServiceTypeProperties.
func (s *SalesforceMarketingCloudLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			s.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &s.ConnectionProperties)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &s.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &s.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &s.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceMarketingCloudObjectDataset.
func (s SalesforceMarketingCloudObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SalesforceMarketingCloudObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceMarketingCloudObjectDataset.
func (s *SalesforceMarketingCloudObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceMarketingCloudSource.
func (s SalesforceMarketingCloudSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SalesforceMarketingCloudSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceMarketingCloudSource.
func (s *SalesforceMarketingCloudSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceObjectDataset.
func (s SalesforceObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SalesforceObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceObjectDataset.
func (s *SalesforceObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceObjectDatasetTypeProperties.
func (s SalesforceObjectDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "objectApiName", &s.ObjectAPIName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudLinkedService.
func (s SalesforceServiceCloudLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SalesforceServiceCloud"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceServiceCloudLinkedService.
func (s *SalesforceServiceCloudLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudLinkedServiceTypeProperties.
func (s SalesforceServiceCloudLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiVersion", &s.APIVersion)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "environmentUrl", &s.EnvironmentURL)
	populate(objectMap, "extendedProperties", &s.ExtendedProperties)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "securityToken", s.SecurityToken)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceServiceCloudLinkedServiceTypeProperties.
func (s *SalesforceServiceCloudLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiVersion":
			err = unpopulate(val, "APIVersion", &s.APIVersion)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "environmentUrl":
			err = unpopulate(val, "EnvironmentURL", &s.EnvironmentURL)
			delete(rawMsg, key)
		case "extendedProperties":
			err = unpopulate(val, "ExtendedProperties", &s.ExtendedProperties)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "securityToken":
			s.SecurityToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudObjectDataset.
func (s SalesforceServiceCloudObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SalesforceServiceCloudObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceServiceCloudObjectDataset.
func (s *SalesforceServiceCloudObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudObjectDatasetTypeProperties.
func (s SalesforceServiceCloudObjectDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "objectApiName", &s.ObjectAPIName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudSink.
func (s SalesforceServiceCloudSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "externalIdFieldName", &s.ExternalIDFieldName)
	populate(objectMap, "ignoreNullValues", &s.IgnoreNullValues)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	objectMap["type"] = "SalesforceServiceCloudSink"
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceServiceCloudSink.
func (s *SalesforceServiceCloudSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "externalIdFieldName":
			err = unpopulate(val, "ExternalIDFieldName", &s.ExternalIDFieldName)
			delete(rawMsg, key)
		case "ignoreNullValues":
			err = unpopulate(val, "IgnoreNullValues", &s.IgnoreNullValues)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceServiceCloudSource.
func (s SalesforceServiceCloudSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "readBehavior", s.ReadBehavior)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SalesforceServiceCloudSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceServiceCloudSource.
func (s *SalesforceServiceCloudSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "readBehavior":
			err = unpopulate(val, "ReadBehavior", &s.ReadBehavior)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceSink.
func (s SalesforceSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "externalIdFieldName", &s.ExternalIDFieldName)
	populate(objectMap, "ignoreNullValues", &s.IgnoreNullValues)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	objectMap["type"] = "SalesforceSink"
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceSink.
func (s *SalesforceSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "externalIdFieldName":
			err = unpopulate(val, "ExternalIDFieldName", &s.ExternalIDFieldName)
			delete(rawMsg, key)
		case "ignoreNullValues":
			err = unpopulate(val, "IgnoreNullValues", &s.IgnoreNullValues)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SalesforceSource.
func (s SalesforceSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "readBehavior", s.ReadBehavior)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SalesforceSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SalesforceSource.
func (s *SalesforceSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "readBehavior":
			err = unpopulate(val, "ReadBehavior", &s.ReadBehavior)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapBWLinkedService.
func (s SapBWLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapBW"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapBWLinkedService.
func (s *SapBWLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapBWLinkedServiceTypeProperties.
func (s SapBWLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "systemNumber", &s.SystemNumber)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapBWLinkedServiceTypeProperties.
func (s *SapBWLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "systemNumber":
			err = unpopulate(val, "SystemNumber", &s.SystemNumber)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapBwCubeDataset.
func (s SapBwCubeDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapBwCube"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapBwCubeDataset.
func (s *SapBwCubeDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapBwSource.
func (s SapBwSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapBwSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapBwSource.
func (s *SapBwSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapCloudForCustomerLinkedService.
func (s SapCloudForCustomerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapCloudForCustomer"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapCloudForCustomerLinkedService.
func (s *SapCloudForCustomerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapCloudForCustomerLinkedServiceTypeProperties.
func (s SapCloudForCustomerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "url", &s.URL)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapCloudForCustomerLinkedServiceTypeProperties.
func (s *SapCloudForCustomerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &s.URL)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapCloudForCustomerResourceDataset.
func (s SapCloudForCustomerResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapCloudForCustomerResource"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapCloudForCustomerResourceDataset.
func (s *SapCloudForCustomerResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type SapCloudForCustomerSink.
func (s SapCloudForCustomerSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &s.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	objectMap["type"] = "SapCloudForCustomerSink"
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	populate(objectMap, "writeBehavior", s.WriteBehavior)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapCloudForCustomerSink.
func (s *SapCloudForCustomerSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &s.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		case "writeBehavior":
			err = unpopulate(val, "WriteBehavior", &s.WriteBehavior)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapCloudForCustomerSource.
func (s SapCloudForCustomerSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &s.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapCloudForCustomerSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapCloudForCustomerSource.
func (s *SapCloudForCustomerSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &s.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapEccLinkedService.
func (s SapEccLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapEcc"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapEccLinkedService.
func (s *SapEccLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapEccLinkedServiceTypeProperties.
func (s SapEccLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "url", s.URL)
	populate(objectMap, "username", s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapEccLinkedServiceTypeProperties.
func (s *SapEccLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &s.URL)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapEccResourceDataset.
func (s SapEccResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapEccResource"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapEccResourceDataset.
func (s *SapEccResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type SapEccSource.
func (s SapEccSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &s.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapEccSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapEccSource.
func (s *SapEccSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &s.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapHanaLinkedService.
func (s SapHanaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapHana"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapHanaLinkedService.
func (s *SapHanaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapHanaLinkedServiceProperties.
func (s SapHanaLinkedServiceProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", s.AuthenticationType)
	populate(objectMap, "connectionString", &s.ConnectionString)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapHanaLinkedServiceProperties.
func (s *SapHanaLinkedServiceProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &s.AuthenticationType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &s.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapHanaPartitionSettings.
func (s SapHanaPartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &s.PartitionColumnName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SapHanaSource.
func (s SapHanaSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "packetSize", &s.PacketSize)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapHanaSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapHanaSource.
func (s *SapHanaSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "packetSize":
			err = unpopulate(val, "PacketSize", &s.PacketSize)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapHanaTableDataset.
func (s SapHanaTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapHanaTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapHanaTableDataset.
func (s *SapHanaTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapHanaTableDatasetTypeProperties.
func (s SapHanaTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "table", &s.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SapOdpLinkedService.
func (s SapOdpLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapOdp"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOdpLinkedService.
func (s *SapOdpLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOdpLinkedServiceTypeProperties.
func (s SapOdpLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "language", &s.Language)
	populate(objectMap, "logonGroup", &s.LogonGroup)
	populate(objectMap, "messageServer", &s.MessageServer)
	populate(objectMap, "messageServerService", &s.MessageServerService)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "sncLibraryPath", &s.SncLibraryPath)
	populate(objectMap, "sncMode", &s.SncMode)
	populate(objectMap, "sncMyName", &s.SncMyName)
	populate(objectMap, "sncPartnerName", &s.SncPartnerName)
	populate(objectMap, "sncQop", &s.SncQop)
	populate(objectMap, "subscriberName", &s.SubscriberName)
	populate(objectMap, "systemId", &s.SystemID)
	populate(objectMap, "systemNumber", &s.SystemNumber)
	populate(objectMap, "userName", &s.UserName)
	populate(objectMap, "x509CertificatePath", &s.X509CertificatePath)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOdpLinkedServiceTypeProperties.
func (s *SapOdpLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "language":
			err = unpopulate(val, "Language", &s.Language)
			delete(rawMsg, key)
		case "logonGroup":
			err = unpopulate(val, "LogonGroup", &s.LogonGroup)
			delete(rawMsg, key)
		case "messageServer":
			err = unpopulate(val, "MessageServer", &s.MessageServer)
			delete(rawMsg, key)
		case "messageServerService":
			err = unpopulate(val, "MessageServerService", &s.MessageServerService)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "sncLibraryPath":
			err = unpopulate(val, "SncLibraryPath", &s.SncLibraryPath)
			delete(rawMsg, key)
		case "sncMode":
			err = unpopulate(val, "SncMode", &s.SncMode)
			delete(rawMsg, key)
		case "sncMyName":
			err = unpopulate(val, "SncMyName", &s.SncMyName)
			delete(rawMsg, key)
		case "sncPartnerName":
			err = unpopulate(val, "SncPartnerName", &s.SncPartnerName)
			delete(rawMsg, key)
		case "sncQop":
			err = unpopulate(val, "SncQop", &s.SncQop)
			delete(rawMsg, key)
		case "subscriberName":
			err = unpopulate(val, "SubscriberName", &s.SubscriberName)
			delete(rawMsg, key)
		case "systemId":
			err = unpopulate(val, "SystemID", &s.SystemID)
			delete(rawMsg, key)
		case "systemNumber":
			err = unpopulate(val, "SystemNumber", &s.SystemNumber)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		case "x509CertificatePath":
			err = unpopulate(val, "X509CertificatePath", &s.X509CertificatePath)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOdpResourceDataset.
func (s SapOdpResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapOdpResource"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOdpResourceDataset.
func (s *SapOdpResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOdpResourceDatasetTypeProperties.
func (s SapOdpResourceDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "context", &s.Context)
	populate(objectMap, "objectName", &s.ObjectName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SapOdpSource.
func (s SapOdpSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "extractionMode", &s.ExtractionMode)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "projection", &s.Projection)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "selection", &s.Selection)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	populate(objectMap, "subscriberProcess", &s.SubscriberProcess)
	objectMap["type"] = "SapOdpSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOdpSource.
func (s *SapOdpSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "extractionMode":
			err = unpopulate(val, "ExtractionMode", &s.ExtractionMode)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "projection":
			err = unpopulate(val, "Projection", &s.Projection)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "selection":
			err = unpopulate(val, "Selection", &s.Selection)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "subscriberProcess":
			err = unpopulate(val, "SubscriberProcess", &s.SubscriberProcess)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOpenHubLinkedService.
func (s SapOpenHubLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapOpenHub"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOpenHubLinkedService.
func (s *SapOpenHubLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOpenHubLinkedServiceTypeProperties.
func (s SapOpenHubLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "language", &s.Language)
	populate(objectMap, "logonGroup", &s.LogonGroup)
	populate(objectMap, "messageServer", &s.MessageServer)
	populate(objectMap, "messageServerService", &s.MessageServerService)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "systemId", &s.SystemID)
	populate(objectMap, "systemNumber", &s.SystemNumber)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOpenHubLinkedServiceTypeProperties.
func (s *SapOpenHubLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "language":
			err = unpopulate(val, "Language", &s.Language)
			delete(rawMsg, key)
		case "logonGroup":
			err = unpopulate(val, "LogonGroup", &s.LogonGroup)
			delete(rawMsg, key)
		case "messageServer":
			err = unpopulate(val, "MessageServer", &s.MessageServer)
			delete(rawMsg, key)
		case "messageServerService":
			err = unpopulate(val, "MessageServerService", &s.MessageServerService)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "systemId":
			err = unpopulate(val, "SystemID", &s.SystemID)
			delete(rawMsg, key)
		case "systemNumber":
			err = unpopulate(val, "SystemNumber", &s.SystemNumber)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOpenHubSource.
func (s SapOpenHubSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "baseRequestId", &s.BaseRequestID)
	populate(objectMap, "customRfcReadTableFunctionModule", &s.CustomRFCReadTableFunctionModule)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "excludeLastRequest", &s.ExcludeLastRequest)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sapDataColumnDelimiter", &s.SapDataColumnDelimiter)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapOpenHubSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOpenHubSource.
func (s *SapOpenHubSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "baseRequestId":
			err = unpopulate(val, "BaseRequestID", &s.BaseRequestID)
			delete(rawMsg, key)
		case "customRfcReadTableFunctionModule":
			err = unpopulate(val, "CustomRFCReadTableFunctionModule", &s.CustomRFCReadTableFunctionModule)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "excludeLastRequest":
			err = unpopulate(val, "ExcludeLastRequest", &s.ExcludeLastRequest)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sapDataColumnDelimiter":
			err = unpopulate(val, "SapDataColumnDelimiter", &s.SapDataColumnDelimiter)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOpenHubTableDataset.
func (s SapOpenHubTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapOpenHubTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapOpenHubTableDataset.
func (s *SapOpenHubTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapOpenHubTableDatasetTypeProperties.
func (s SapOpenHubTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "baseRequestId", &s.BaseRequestID)
	populate(objectMap, "excludeLastRequest", &s.ExcludeLastRequest)
	populate(objectMap, "openHubDestinationName", &s.OpenHubDestinationName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SapTableLinkedService.
func (s SapTableLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SapTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapTableLinkedService.
func (s *SapTableLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapTableLinkedServiceTypeProperties.
func (s SapTableLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "language", &s.Language)
	populate(objectMap, "logonGroup", &s.LogonGroup)
	populate(objectMap, "messageServer", &s.MessageServer)
	populate(objectMap, "messageServerService", &s.MessageServerService)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "sncLibraryPath", &s.SncLibraryPath)
	populate(objectMap, "sncMode", &s.SncMode)
	populate(objectMap, "sncMyName", &s.SncMyName)
	populate(objectMap, "sncPartnerName", &s.SncPartnerName)
	populate(objectMap, "sncQop", &s.SncQop)
	populate(objectMap, "systemId", &s.SystemID)
	populate(objectMap, "systemNumber", &s.SystemNumber)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapTableLinkedServiceTypeProperties.
func (s *SapTableLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "language":
			err = unpopulate(val, "Language", &s.Language)
			delete(rawMsg, key)
		case "logonGroup":
			err = unpopulate(val, "LogonGroup", &s.LogonGroup)
			delete(rawMsg, key)
		case "messageServer":
			err = unpopulate(val, "MessageServer", &s.MessageServer)
			delete(rawMsg, key)
		case "messageServerService":
			err = unpopulate(val, "MessageServerService", &s.MessageServerService)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "sncLibraryPath":
			err = unpopulate(val, "SncLibraryPath", &s.SncLibraryPath)
			delete(rawMsg, key)
		case "sncMode":
			err = unpopulate(val, "SncMode", &s.SncMode)
			delete(rawMsg, key)
		case "sncMyName":
			err = unpopulate(val, "SncMyName", &s.SncMyName)
			delete(rawMsg, key)
		case "sncPartnerName":
			err = unpopulate(val, "SncPartnerName", &s.SncPartnerName)
			delete(rawMsg, key)
		case "sncQop":
			err = unpopulate(val, "SncQop", &s.SncQop)
			delete(rawMsg, key)
		case "systemId":
			err = unpopulate(val, "SystemID", &s.SystemID)
			delete(rawMsg, key)
		case "systemNumber":
			err = unpopulate(val, "SystemNumber", &s.SystemNumber)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapTablePartitionSettings.
func (s SapTablePartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "maxPartitionsNumber", &s.MaxPartitionsNumber)
	populate(objectMap, "partitionColumnName", &s.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &s.PartitionLowerBound)
	populate(objectMap, "partitionUpperBound", &s.PartitionUpperBound)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapTablePartitionSettings.
func (s *SapTablePartitionSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "maxPartitionsNumber":
			err = unpopulate(val, "MaxPartitionsNumber", &s.MaxPartitionsNumber)
			delete(rawMsg, key)
		case "partitionColumnName":
			err = unpopulate(val, "PartitionColumnName", &s.PartitionColumnName)
			delete(rawMsg, key)
		case "partitionLowerBound":
			err = unpopulate(val, "PartitionLowerBound", &s.PartitionLowerBound)
			delete(rawMsg, key)
		case "partitionUpperBound":
			err = unpopulate(val, "PartitionUpperBound", &s.PartitionUpperBound)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapTableResourceDataset.
func (s SapTableResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SapTableResource"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapTableResourceDataset.
func (s *SapTableResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SapTableResourceDatasetTypeProperties.
func (s SapTableResourceDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &s.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SapTableSource.
func (s SapTableSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "batchSize", &s.BatchSize)
	populate(objectMap, "customRfcReadTableFunctionModule", &s.CustomRFCReadTableFunctionModule)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &s.PartitionOption)
	populate(objectMap, "partitionSettings", s.PartitionSettings)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "rfcTableFields", &s.RFCTableFields)
	populate(objectMap, "rfcTableOptions", &s.RFCTableOptions)
	populate(objectMap, "rowCount", &s.RowCount)
	populate(objectMap, "rowSkips", &s.RowSkips)
	populate(objectMap, "sapDataColumnDelimiter", &s.SapDataColumnDelimiter)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SapTableSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SapTableSource.
func (s *SapTableSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "batchSize":
			err = unpopulate(val, "BatchSize", &s.BatchSize)
			delete(rawMsg, key)
		case "customRfcReadTableFunctionModule":
			err = unpopulate(val, "CustomRFCReadTableFunctionModule", &s.CustomRFCReadTableFunctionModule)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &s.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &s.PartitionSettings)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "rfcTableFields":
			err = unpopulate(val, "RFCTableFields", &s.RFCTableFields)
			delete(rawMsg, key)
		case "rfcTableOptions":
			err = unpopulate(val, "RFCTableOptions", &s.RFCTableOptions)
			delete(rawMsg, key)
		case "rowCount":
			err = unpopulate(val, "RowCount", &s.RowCount)
			delete(rawMsg, key)
		case "rowSkips":
			err = unpopulate(val, "RowSkips", &s.RowSkips)
			delete(rawMsg, key)
		case "sapDataColumnDelimiter":
			err = unpopulate(val, "SapDataColumnDelimiter", &s.SapDataColumnDelimiter)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScheduleTrigger.
func (s ScheduleTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "pipelines", s.Pipelines)
	populate(objectMap, "runtimeState", s.RuntimeState)
	objectMap["type"] = "ScheduleTrigger"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleTrigger.
func (s *ScheduleTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "pipelines":
			err = unpopulate(val, "Pipelines", &s.Pipelines)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &s.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScheduleTriggerRecurrence.
func (s ScheduleTriggerRecurrence) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populateTimeRFC3339(objectMap, "endTime", s.EndTime)
	populate(objectMap, "frequency", s.Frequency)
	populate(objectMap, "interval", s.Interval)
	populate(objectMap, "schedule", s.Schedule)
	populateTimeRFC3339(objectMap, "startTime", s.StartTime)
	populate(objectMap, "timeZone", s.TimeZone)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleTriggerRecurrence.
func (s *ScheduleTriggerRecurrence) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "endTime":
			err = unpopulateTimeRFC3339(val, "EndTime", &s.EndTime)
			delete(rawMsg, key)
		case "frequency":
			err = unpopulate(val, "Frequency", &s.Frequency)
			delete(rawMsg, key)
		case "interval":
			err = unpopulate(val, "Interval", &s.Interval)
			delete(rawMsg, key)
		case "schedule":
			err = unpopulate(val, "Schedule", &s.Schedule)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime)
			delete(rawMsg, key)
		case "timeZone":
			err = unpopulate(val, "TimeZone", &s.TimeZone)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ScriptAction.
func (s ScriptAction) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "name", s.Name)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "roles", &s.Roles)
	populate(objectMap, "uri", s.URI)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ScriptActivity.
func (s ScriptActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "policy", s.Policy)
	objectMap["type"] = "Script"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptActivity.
func (s *ScriptActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &s.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ScriptActivityParameter.
func (s ScriptActivityParameter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "direction", s.Direction)
	populate(objectMap, "name", &s.Name)
	populate(objectMap, "size", s.Size)
	populate(objectMap, "type", s.Type)
	populate(objectMap, "value", &s.Value)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ScriptActivityScriptBlock.
func (s ScriptActivityScriptBlock) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "text", &s.Text)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ScriptActivityTypeProperties.
func (s ScriptActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "logSettings", s.LogSettings)
	populate(objectMap, "scriptBlockExecutionTimeout", &s.ScriptBlockExecutionTimeout)
	populate(objectMap, "scripts", s.Scripts)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type ScriptActivityTypePropertiesLogSettings.
func (s ScriptActivityTypePropertiesLogSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "logDestination", s.LogDestination)
	populate(objectMap, "logLocationSettings", s.LogLocationSettings)
	return json.Marshal(objectMap)
}

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type SelfDependencyTumblingWindowTriggerReference.
func (s SelfDependencyTumblingWindowTriggerReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "offset", s.Offset)
	populate(objectMap, "size", s.Size)
	objectMap["type"] = "SelfDependencyTumblingWindowTriggerReference"
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SelfHostedIntegrationRuntime.
func (s SelfHostedIntegrationRuntime) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", s.Description)
	objectMap["type"] = IntegrationRuntimeTypeSelfHosted
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SelfHostedIntegrationRuntimeNode.
func (s SelfHostedIntegrationRuntimeNode) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "capabilities", s.Capabilities)
	populate(objectMap, "concurrentJobsLimit", s.ConcurrentJobsLimit)
	populateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime)
	populate(objectMap, "hostServiceUri", s.HostServiceURI)
	populate(objectMap, "isActiveDispatcher", s.IsActiveDispatcher)
	populateTimeRFC3339(objectMap, "lastConnectTime", s.LastConnectTime)
	populateTimeRFC3339(objectMap, "lastEndUpdateTime", s.LastEndUpdateTime)
	populateTimeRFC3339(objectMap, "lastStartTime", s.LastStartTime)
	populateTimeRFC3339(objectMap, "lastStartUpdateTime", s.LastStartUpdateTime)
	populateTimeRFC3339(objectMap, "lastStopTime", s.LastStopTime)
	populate(objectMap, "lastUpdateResult", s.LastUpdateResult)
	populate(objectMap, "machineName", s.MachineName)
	populate(objectMap, "maxConcurrentJobs", s.MaxConcurrentJobs)
	populate(objectMap, "nodeName", s.NodeName)
	populateTimeRFC3339(objectMap, "registerTime", s.RegisterTime)
	populate(objectMap, "status", s.Status)
	populate(objectMap, "version", s.Version)
	populate(objectMap, "versionStatus", s.VersionStatus)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SelfHostedIntegrationRuntimeNode.
func (s *SelfHostedIntegrationRuntimeNode) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "capabilities":
			err = unpopulate(val, "Capabilities", &s.Capabilities)
			delete(rawMsg, key)
		case "concurrentJobsLimit":
			err = unpopulate(val, "ConcurrentJobsLimit", &s.ConcurrentJobsLimit)
			delete(rawMsg, key)
		case "expiryTime":
			err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime)
			delete(rawMsg, key)
		case "hostServiceUri":
			err = unpopulate(val, "HostServiceURI", &s.HostServiceURI)
			delete(rawMsg, key)
		case "isActiveDispatcher":
			err = unpopulate(val, "IsActiveDispatcher", &s.IsActiveDispatcher)
			delete(rawMsg, key)
		case "lastConnectTime":
			err = unpopulateTimeRFC3339(val, "LastConnectTime", &s.LastConnectTime)
			delete(rawMsg, key)
		case "lastEndUpdateTime":
			err = unpopulateTimeRFC3339(val, "LastEndUpdateTime", &s.LastEndUpdateTime)
			delete(rawMsg, key)
		case "lastStartTime":
			err = unpopulateTimeRFC3339(val, "LastStartTime", &s.LastStartTime)
			delete(rawMsg, key)
		case "lastStartUpdateTime":
			err = unpopulateTimeRFC3339(val, "LastStartUpdateTime", &s.LastStartUpdateTime)
			delete(rawMsg, key)
		case "lastStopTime":
			err = unpopulateTimeRFC3339(val, "LastStopTime", &s.LastStopTime)
			delete(rawMsg, key)
		case "lastUpdateResult":
			err = unpopulate(val, "LastUpdateResult", &s.LastUpdateResult)
			delete(rawMsg, key)
		case "machineName":
			err = unpopulate(val, "MachineName", &s.MachineName)
			delete(rawMsg, key)
		case "maxConcurrentJobs":
			err = unpopulate(val, "MaxConcurrentJobs", &s.MaxConcurrentJobs)
			delete(rawMsg, key)
		case "nodeName":
			err = unpopulate(val, "NodeName", &s.NodeName)
			delete(rawMsg, key)
		case "registerTime":
			err = unpopulateTimeRFC3339(val, "RegisterTime", &s.RegisterTime)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &s.Status)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &s.Version)
			delete(rawMsg, key)
		case "versionStatus":
			err = unpopulate(val, "VersionStatus", &s.VersionStatus)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SelfHostedIntegrationRuntimeStatus.
func (s SelfHostedIntegrationRuntimeStatus) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataFactoryName", s.DataFactoryName)
	populate(objectMap, "state", s.State)
	objectMap["type"] = IntegrationRuntimeTypeSelfHosted
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SelfHostedIntegrationRuntimeStatus.
func (s *SelfHostedIntegrationRuntimeStatus) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataFactoryName":
			err = unpopulate(val, "DataFactoryName", &s.DataFactoryName)
			delete(rawMsg, key)
		case "state":
			err = unpopulate(val, "State", &s.State)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SelfHostedIntegrationRuntimeStatusTypeProperties.
func (s SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "autoUpdate", s.AutoUpdate)
	populateTimeRFC3339(objectMap, "autoUpdateETA", s.AutoUpdateETA)
	populate(objectMap, "capabilities", s.Capabilities)
	populateTimeRFC3339(objectMap, "createTime", s.CreateTime)
	populate(objectMap, "internalChannelEncryption", s.InternalChannelEncryption)
	populate(objectMap, "latestVersion", s.LatestVersion)
	populate(objectMap, "links", s.Links)
	populate(objectMap, "localTimeZoneOffset", s.LocalTimeZoneOffset)
	populate(objectMap, "nodes", s.Nodes)
	populate(objectMap, "pushedVersion", s.PushedVersion)
	populateTimeRFC3339(objectMap, "scheduledUpdateDate", s.ScheduledUpdateDate)
	populate(objectMap, "serviceUrls", s.ServiceUrls)
	populate(objectMap, "taskQueueId", s.TaskQueueID)
	populate(objectMap, "updateDelayOffset", s.UpdateDelayOffset)
	populate(objectMap, "version", s.Version)
	populate(objectMap, "versionStatus", s.VersionStatus)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SelfHostedIntegrationRuntimeStatusTypeProperties.
func (s *SelfHostedIntegrationRuntimeStatusTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "autoUpdate":
			err = unpopulate(val, "AutoUpdate", &s.AutoUpdate)
			delete(rawMsg, key)
		case "autoUpdateETA":
			err = unpopulateTimeRFC3339(val, "AutoUpdateETA", &s.AutoUpdateETA)
			delete(rawMsg, key)
		case "capabilities":
			err = unpopulate(val, "Capabilities", &s.Capabilities)
			delete(rawMsg, key)
		case "createTime":
			err = unpopulateTimeRFC3339(val, "CreateTime", &s.CreateTime)
			delete(rawMsg, key)
		case "internalChannelEncryption":
			err = unpopulate(val, "InternalChannelEncryption", &s.InternalChannelEncryption)
			delete(rawMsg, key)
		case "latestVersion":
			err = unpopulate(val, "LatestVersion", &s.LatestVersion)
			delete(rawMsg, key)
		case "links":
			err = unpopulate(val, "Links", &s.Links)
			delete(rawMsg, key)
		case "localTimeZoneOffset":
			err = unpopulate(val, "LocalTimeZoneOffset", &s.LocalTimeZoneOffset)
			delete(rawMsg, key)
		case "nodes":
			err = unpopulate(val, "Nodes", &s.Nodes)
			delete(rawMsg, key)
		case "pushedVersion":
			err = unpopulate(val, "PushedVersion", &s.PushedVersion)
			delete(rawMsg, key)
		case "scheduledUpdateDate":
			err = unpopulateTimeRFC3339(val, "ScheduledUpdateDate", &s.ScheduledUpdateDate)
			delete(rawMsg, key)
		case "serviceUrls":
			err = unpopulate(val, "ServiceUrls", &s.ServiceUrls)
			delete(rawMsg, key)
		case "taskQueueId":
			err = unpopulate(val, "TaskQueueID", &s.TaskQueueID)
			delete(rawMsg, key)
		case "updateDelayOffset":
			err = unpopulate(val, "UpdateDelayOffset", &s.UpdateDelayOffset)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &s.Version)
			delete(rawMsg, key)
		case "versionStatus":
			err = unpopulate(val, "VersionStatus", &s.VersionStatus)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ServiceNowLinkedService.
func (s ServiceNowLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "ServiceNow"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNowLinkedService.
func (s *ServiceNowLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ServiceNowLinkedServiceTypeProperties.
func (s ServiceNowLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", s.AuthenticationType)
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "clientSecret", s.ClientSecret)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "endpoint", &s.Endpoint)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "useEncryptedEndpoints", &s.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &s.UseHostVerification)
	populate(objectMap, "usePeerVerification", &s.UsePeerVerification)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNowLinkedServiceTypeProperties.
func (s *ServiceNowLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &s.AuthenticationType)
			delete(rawMsg, key)
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			s.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &s.Endpoint)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &s.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &s.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &s.UsePeerVerification)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ServiceNowObjectDataset.
func (s ServiceNowObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "ServiceNowObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNowObjectDataset.
func (s *ServiceNowObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ServiceNowSource.
func (s ServiceNowSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "ServiceNowSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNowSource.
func (s *ServiceNowSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SetVariableActivity.
func (s SetVariableActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "name", s.Name)
	objectMap["type"] = "SetVariable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SetVariableActivity.
func (s *SetVariableActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type SftpLocation.
func (s SftpLocation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "fileName", &s.FileName)
	populate(objectMap, "folderPath", &s.FolderPath)
	objectMap["type"] = "SftpLocation"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SftpLocation.
func (s *SftpLocation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "fileName":
			err = unpopulate(val, "FileName", &s.FileName)
			delete(rawMsg, key)
		case "folderPath":
			err = unpopulate(val, "FolderPath", &s.FolderPath)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SftpReadSettings.
func (s SftpReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "deleteFilesAfterCompletion", &s.DeleteFilesAfterCompletion)
	populate(objectMap, "disableChunking", &s.DisableChunking)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "enablePartitionDiscovery", s.EnablePartitionDiscovery)
	populate(objectMap, "fileListPath", &s.FileListPath)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "modifiedDatetimeEnd", &s.ModifiedDatetimeEnd)
	populate(objectMap, "modifiedDatetimeStart", &s.ModifiedDatetimeStart)
	populate(objectMap, "partitionRootPath", &s.PartitionRootPath)
	populate(objectMap, "recursive", &s.Recursive)
	objectMap["type"] = "SftpReadSettings"
	populate(objectMap, "wildcardFileName", &s.WildcardFileName)
	populate(objectMap, "wildcardFolderPath", &s.WildcardFolderPath)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SftpReadSettings.
func (s *SftpReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "deleteFilesAfterCompletion":
			err = unpopulate(val, "DeleteFilesAfterCompletion", &s.DeleteFilesAfterCompletion)
			delete(rawMsg, key)
		case "disableChunking":
			err = unpopulate(val, "DisableChunking", &s.DisableChunking)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "enablePartitionDiscovery":
			err = unpopulate(val, "EnablePartitionDiscovery", &s.EnablePartitionDiscovery)
			delete(rawMsg, key)
		case "fileListPath":
			err = unpopulate(val, "FileListPath", &s.FileListPath)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "modifiedDatetimeEnd":
			err = unpopulate(val, "ModifiedDatetimeEnd", &s.ModifiedDatetimeEnd)
			delete(rawMsg, key)
		case "modifiedDatetimeStart":
			err = unpopulate(val, "ModifiedDatetimeStart", &s.ModifiedDatetimeStart)
			delete(rawMsg, key)
		case "partitionRootPath":
			err = unpopulate(val, "PartitionRootPath", &s.PartitionRootPath)
			delete(rawMsg, key)
		case "recursive":
			err = unpopulate(val, "Recursive", &s.Recursive)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "wildcardFileName":
			err = unpopulate(val, "WildcardFileName", &s.WildcardFileName)
			delete(rawMsg, key)
		case "wildcardFolderPath":
			err = unpopulate(val, "WildcardFolderPath", &s.WildcardFolderPath)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SftpServerLinkedService.
func (s SftpServerLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Sftp"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SftpServerLinkedService.
func (s *SftpServerLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SftpServerLinkedServiceTypeProperties.
func (s SftpServerLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", s.AuthenticationType)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "host", &s.Host)
	populate(objectMap, "hostKeyFingerprint", &s.HostKeyFingerprint)
	populate(objectMap, "passPhrase", s.PassPhrase)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "port", &s.Port)
	populate(objectMap, "privateKeyContent", s.PrivateKeyContent)
	populate(objectMap, "privateKeyPath", &s.PrivateKeyPath)
	populate(objectMap, "skipHostKeyValidation", &s.SkipHostKeyValidation)
	populate(objectMap, "userName", &s.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SftpServerLinkedServiceTypeProperties.
func (s *SftpServerLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &s.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &s.Host)
			delete(rawMsg, key)
		case "hostKeyFingerprint":
			err = unpopulate(val, "HostKeyFingerprint", &s.HostKeyFingerprint)
			delete(rawMsg, key)
		case "passPhrase":
			s.PassPhrase, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &s.Port)
			delete(rawMsg, key)
		case "privateKeyContent":
			s.PrivateKeyContent, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "privateKeyPath":
			err = unpopulate(val, "PrivateKeyPath", &s.PrivateKeyPath)
			delete(rawMsg, key)
		case "skipHostKeyValidation":
			err = unpopulate(val, "SkipHostKeyValidation", &s.SkipHostKeyValidation)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &s.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SftpWriteSettings.
func (s SftpWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &s.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "operationTimeout", &s.OperationTimeout)
	objectMap["type"] = "SftpWriteSettings"
	populate(objectMap, "useTempFileRename", &s.UseTempFileRename)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SftpWriteSettings.
func (s *SftpWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &s.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "operationTimeout":
			err = unpopulate(val, "OperationTimeout", &s.OperationTimeout)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "useTempFileRename":
			err = unpopulate(val, "UseTempFileRename", &s.UseTempFileRename)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SharePointOnlineListDatasetTypeProperties.
func (s SharePointOnlineListDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "listName", &s.ListName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SharePointOnlineListLinkedService.
func (s SharePointOnlineListLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "SharePointOnlineList"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SharePointOnlineListLinkedService.
func (s *SharePointOnlineListLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SharePointOnlineListLinkedServiceTypeProperties.
func (s SharePointOnlineListLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "servicePrincipalId", &s.ServicePrincipalID)
	populate(objectMap, "servicePrincipalKey", s.ServicePrincipalKey)
	populate(objectMap, "siteUrl", &s.SiteURL)
	populate(objectMap, "tenantId", &s.TenantID)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SharePointOnlineListLinkedServiceTypeProperties.
func (s *SharePointOnlineListLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "servicePrincipalId":
			err = unpopulate(val, "ServicePrincipalID", &s.ServicePrincipalID)
			delete(rawMsg, key)
		case "servicePrincipalKey":
			s.ServicePrincipalKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "siteUrl":
			err = unpopulate(val, "SiteURL", &s.SiteURL)
			delete(rawMsg, key)
		case "tenantId":
			err = unpopulate(val, "TenantID", &s.TenantID)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SharePointOnlineListResourceDataset.
func (s SharePointOnlineListResourceDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SharePointOnlineListResource"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SharePointOnlineListResourceDataset.
func (s *SharePointOnlineListResourceDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SharePointOnlineListSource.
func (s SharePointOnlineListSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "httpRequestTimeout", &s.HTTPRequestTimeout)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SharePointOnlineListSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SharePointOnlineListSource.
func (s *SharePointOnlineListSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "httpRequestTimeout":
			err = unpopulate(val, "HTTPRequestTimeout", &s.HTTPRequestTimeout)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ShopifyLinkedService.
func (s ShopifyLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Shopify"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ShopifyLinkedService.
func (s *ShopifyLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ShopifyLinkedServiceTypeProperties.
func (s ShopifyLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", s.AccessToken)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "host", &s.Host)
	populate(objectMap, "useEncryptedEndpoints", &s.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &s.UseHostVerification)
	populate(objectMap, "usePeerVerification", &s.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ShopifyLinkedServiceTypeProperties.
func (s *ShopifyLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			s.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &s.Host)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &s.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &s.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &s.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ShopifyObjectDataset.
func (s ShopifyObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "ShopifyObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ShopifyObjectDataset.
func (s *ShopifyObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ShopifySource.
func (s ShopifySource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "ShopifySource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ShopifySource.
func (s *ShopifySource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SkipErrorFile.
func (s SkipErrorFile) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataInconsistency", &s.DataInconsistency)
	populate(objectMap, "fileMissing", &s.FileMissing)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SmartsheetLinkedService.
func (s SmartsheetLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Smartsheet"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SmartsheetLinkedService.
func (s *SmartsheetLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SmartsheetLinkedServiceTypeProperties.
func (s SmartsheetLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", s.APIToken)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SnowflakeDataset.
func (s SnowflakeDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SnowflakeTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeDataset.
func (s *SnowflakeDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SnowflakeDatasetTypeProperties.
func (s SnowflakeDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "table", &s.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SnowflakeExportCopyCommand.
func (s SnowflakeExportCopyCommand) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalCopyOptions", s.AdditionalCopyOptions)
	populate(objectMap, "additionalFormatOptions", s.AdditionalFormatOptions)
	objectMap["type"] = "SnowflakeExportCopyCommand"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeExportCopyCommand.
func (s *SnowflakeExportCopyCommand) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalCopyOptions":
			err = unpopulate(val, "AdditionalCopyOptions", &s.AdditionalCopyOptions)
			delete(rawMsg, key)
		case "additionalFormatOptions":
			err = unpopulate(val, "AdditionalFormatOptions", &s.AdditionalFormatOptions)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SnowflakeImportCopyCommand.
func (s SnowflakeImportCopyCommand) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalCopyOptions", s.AdditionalCopyOptions)
	populate(objectMap, "additionalFormatOptions", s.AdditionalFormatOptions)
	objectMap["type"] = "SnowflakeImportCopyCommand"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeImportCopyCommand.
func (s *SnowflakeImportCopyCommand) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalCopyOptions":
			err = unpopulate(val, "AdditionalCopyOptions", &s.AdditionalCopyOptions)
			delete(rawMsg, key)
		case "additionalFormatOptions":
			err = unpopulate(val, "AdditionalFormatOptions", &s.AdditionalFormatOptions)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SnowflakeLinkedService.
func (s SnowflakeLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Snowflake"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeLinkedService.
func (s *SnowflakeLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SnowflakeLinkedServiceTypeProperties.
func (s SnowflakeLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &s.ConnectionString)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SnowflakeSink.
func (s SnowflakeSink) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "importSettings", s.ImportSettings)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "preCopyScript", &s.PreCopyScript)
	populate(objectMap, "sinkRetryCount", &s.SinkRetryCount)
	populate(objectMap, "sinkRetryWait", &s.SinkRetryWait)
	objectMap["type"] = "SnowflakeSink"
	populate(objectMap, "writeBatchSize", &s.WriteBatchSize)
	populate(objectMap, "writeBatchTimeout", &s.WriteBatchTimeout)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeSink.
func (s *SnowflakeSink) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "importSettings":
			err = unpopulate(val, "ImportSettings", &s.ImportSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "preCopyScript":
			err = unpopulate(val, "PreCopyScript", &s.PreCopyScript)
			delete(rawMsg, key)
		case "sinkRetryCount":
			err = unpopulate(val, "SinkRetryCount", &s.SinkRetryCount)
			delete(rawMsg, key)
		case "sinkRetryWait":
			err = unpopulate(val, "SinkRetryWait", &s.SinkRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "writeBatchSize":
			err = unpopulate(val, "WriteBatchSize", &s.WriteBatchSize)
			delete(rawMsg, key)
		case "writeBatchTimeout":
			err = unpopulate(val, "WriteBatchTimeout", &s.WriteBatchTimeout)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SnowflakeSource.
func (s SnowflakeSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "exportSettings", s.ExportSettings)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SnowflakeSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SnowflakeSource.
func (s *SnowflakeSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "exportSettings":
			err = unpopulate(val, "ExportSettings", &s.ExportSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SparkDatasetTypeProperties.
func (s SparkDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "table", &s.Table)
	populate(objectMap, "tableName", &s.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SparkLinkedService.
func (s SparkLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Spark"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SparkLinkedService.
func (s *SparkLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SparkLinkedServiceTypeProperties.
func (s SparkLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "allowHostNameCNMismatch", &s.AllowHostNameCNMismatch)
	populate(objectMap, "allowSelfSignedServerCert", &s.AllowSelfSignedServerCert)
	populate(objectMap, "authenticationType", s.AuthenticationType)
	populate(objectMap, "enableSsl", &s.EnableSSL)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "httpPath", &s.HTTPPath)
	populate(objectMap, "host", &s.Host)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "port", &s.Port)
	populate(objectMap, "serverType", s.ServerType)
	populate(objectMap, "thriftTransportProtocol", s.ThriftTransportProtocol)
	populate(objectMap, "trustedCertPath", &s.TrustedCertPath)
	populate(objectMap, "useSystemTrustStore", &s.UseSystemTrustStore)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SparkLinkedServiceTypeProperties.
func (s *SparkLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "allowHostNameCNMismatch":
			err = unpopulate(val, "AllowHostNameCNMismatch", &s.AllowHostNameCNMismatch)
			delete(rawMsg, key)
		case "allowSelfSignedServerCert":
			err = unpopulate(val, "AllowSelfSignedServerCert", &s.AllowSelfSignedServerCert)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &s.AuthenticationType)
			delete(rawMsg, key)
		case "enableSsl":
			err = unpopulate(val, "EnableSSL", &s.EnableSSL)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "httpPath":
			err = unpopulate(val, "HTTPPath", &s.HTTPPath)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &s.Host)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "port":
			err = unpopulate(val, "Port", &s.Port)
			delete(rawMsg, key)
		case "serverType":
			err = unpopulate(val, "ServerType", &s.ServerType)
			delete(rawMsg, key)
		case "thriftTransportProtocol":
			err = unpopulate(val, "ThriftTransportProtocol", &s.ThriftTransportProtocol)
			delete(rawMsg, key)
		case "trustedCertPath":
			err = unpopulate(val, "TrustedCertPath", &s.TrustedCertPath)
			delete(rawMsg, key)
		case "useSystemTrustStore":
			err = unpopulate(val, "UseSystemTrustStore", &s.UseSystemTrustStore)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SparkObjectDataset.
func (s SparkObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SparkObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SparkObjectDataset.
func (s *SparkObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SparkSource.
func (s SparkSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SparkSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SparkSource.
func (s *SparkSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SquareLinkedService.
func (s SquareLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Square"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SquareLinkedService.
func (s *SquareLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SquareLinkedServiceTypeProperties.
func (s SquareLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "clientId", &s.ClientID)
	populate(objectMap, "clientSecret", s.ClientSecret)
	populate(objectMap, "connectionProperties", &s.ConnectionProperties)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "host", &s.Host)
	populate(objectMap, "redirectUri", &s.RedirectURI)
	populate(objectMap, "useEncryptedEndpoints", &s.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &s.UseHostVerification)
	populate(objectMap, "usePeerVerification", &s.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SquareLinkedServiceTypeProperties.
func (s *SquareLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "clientId":
			err = unpopulate(val, "ClientID", &s.ClientID)
			delete(rawMsg, key)
		case "clientSecret":
			s.ClientSecret, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &s.ConnectionProperties)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &s.Host)
			delete(rawMsg, key)
		case "redirectUri":
			err = unpopulate(val, "RedirectURI", &s.RedirectURI)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &s.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &s.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &s.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SquareObjectDataset.
func (s SquareObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SquareObject"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SquareObjectDataset.
func (s *SquareObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SquareSource.
func (s SquareSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SquareSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SquareSource.
func (s *SquareSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SsisEnvironment.
func (s SsisEnvironment) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folderId", s.FolderID)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	objectMap["type"] = SsisObjectMetadataTypeEnvironment
	populate(objectMap, "variables", s.Variables)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SsisEnvironmentReference.
func (s SsisEnvironmentReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "environmentFolderName", s.EnvironmentFolderName)
	populate(objectMap, "environmentName", s.EnvironmentName)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "referenceType", s.ReferenceType)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SsisFolder.
func (s SsisFolder) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", s.Description)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	objectMap["type"] = SsisObjectMetadataTypeFolder
	return json.Marshal(objectMap)
}

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

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

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

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

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

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

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

// MarshalJSON implements the json.Marshaller interface for type SsisPackage.
func (s SsisPackage) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folderId", s.FolderID)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "projectId", s.ProjectID)
	populate(objectMap, "projectVersion", s.ProjectVersion)
	objectMap["type"] = SsisObjectMetadataTypePackage
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SsisPackage.
func (s *SsisPackage) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folderId":
			err = unpopulate(val, "FolderID", &s.FolderID)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &s.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "projectId":
			err = unpopulate(val, "ProjectID", &s.ProjectID)
			delete(rawMsg, key)
		case "projectVersion":
			err = unpopulate(val, "ProjectVersion", &s.ProjectVersion)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SsisParameter.
func (s SsisParameter) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataType", s.DataType)
	populate(objectMap, "defaultValue", s.DefaultValue)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "designDefaultValue", s.DesignDefaultValue)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "required", s.Required)
	populate(objectMap, "sensitive", s.Sensitive)
	populate(objectMap, "sensitiveDefaultValue", s.SensitiveDefaultValue)
	populate(objectMap, "valueSet", s.ValueSet)
	populate(objectMap, "valueType", s.ValueType)
	populate(objectMap, "variable", s.Variable)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SsisParameter.
func (s *SsisParameter) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataType":
			err = unpopulate(val, "DataType", &s.DataType)
			delete(rawMsg, key)
		case "defaultValue":
			err = unpopulate(val, "DefaultValue", &s.DefaultValue)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "designDefaultValue":
			err = unpopulate(val, "DesignDefaultValue", &s.DesignDefaultValue)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &s.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "required":
			err = unpopulate(val, "Required", &s.Required)
			delete(rawMsg, key)
		case "sensitive":
			err = unpopulate(val, "Sensitive", &s.Sensitive)
			delete(rawMsg, key)
		case "sensitiveDefaultValue":
			err = unpopulate(val, "SensitiveDefaultValue", &s.SensitiveDefaultValue)
			delete(rawMsg, key)
		case "valueSet":
			err = unpopulate(val, "ValueSet", &s.ValueSet)
			delete(rawMsg, key)
		case "valueType":
			err = unpopulate(val, "ValueType", &s.ValueType)
			delete(rawMsg, key)
		case "variable":
			err = unpopulate(val, "Variable", &s.Variable)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SsisProject.
func (s SsisProject) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "description", s.Description)
	populate(objectMap, "environmentRefs", s.EnvironmentRefs)
	populate(objectMap, "folderId", s.FolderID)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = SsisObjectMetadataTypeProject
	populate(objectMap, "version", s.Version)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SsisProject.
func (s *SsisProject) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "environmentRefs":
			err = unpopulate(val, "EnvironmentRefs", &s.EnvironmentRefs)
			delete(rawMsg, key)
		case "folderId":
			err = unpopulate(val, "FolderID", &s.FolderID)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &s.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "version":
			err = unpopulate(val, "Version", &s.Version)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SsisVariable.
func (s SsisVariable) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataType", s.DataType)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "id", s.ID)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "sensitive", s.Sensitive)
	populate(objectMap, "sensitiveValue", s.SensitiveValue)
	populate(objectMap, "value", s.Value)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SsisVariable.
func (s *SsisVariable) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataType":
			err = unpopulate(val, "DataType", &s.DataType)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "id":
			err = unpopulate(val, "ID", &s.ID)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "sensitive":
			err = unpopulate(val, "Sensitive", &s.Sensitive)
			delete(rawMsg, key)
		case "sensitiveValue":
			err = unpopulate(val, "SensitiveValue", &s.SensitiveValue)
			delete(rawMsg, key)
		case "value":
			err = unpopulate(val, "Value", &s.Value)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type StagingSettings.
func (s StagingSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "enableCompression", &s.EnableCompression)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "path", &s.Path)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type StagingSettings.
func (s *StagingSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "enableCompression":
			err = unpopulate(val, "EnableCompression", &s.EnableCompression)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "path":
			err = unpopulate(val, "Path", &s.Path)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type StoreReadSettings.
func (s StoreReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	objectMap["type"] = s.Type
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type StoreReadSettings.
func (s *StoreReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type StoreWriteSettings.
func (s StoreWriteSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "copyBehavior", &s.CopyBehavior)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	objectMap["type"] = s.Type
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type StoreWriteSettings.
func (s *StoreWriteSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "copyBehavior":
			err = unpopulate(val, "CopyBehavior", &s.CopyBehavior)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SwitchActivity.
func (s SwitchActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "name", s.Name)
	objectMap["type"] = "Switch"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SwitchActivity.
func (s *SwitchActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SwitchActivityTypeProperties.
func (s SwitchActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "cases", s.Cases)
	populate(objectMap, "defaultActivities", s.DefaultActivities)
	populate(objectMap, "on", s.On)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SwitchActivityTypeProperties.
func (s *SwitchActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "cases":
			err = unpopulate(val, "Cases", &s.Cases)
			delete(rawMsg, key)
		case "defaultActivities":
			s.DefaultActivities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		case "on":
			err = unpopulate(val, "On", &s.On)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type SybaseLinkedService.
func (s SybaseLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "connectVia", s.ConnectVia)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "parameters", s.Parameters)
	objectMap["type"] = "Sybase"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SybaseLinkedService.
func (s *SybaseLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &s.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SybaseLinkedServiceTypeProperties.
func (s SybaseLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", s.AuthenticationType)
	populate(objectMap, "database", &s.Database)
	populate(objectMap, "encryptedCredential", &s.EncryptedCredential)
	populate(objectMap, "password", s.Password)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "server", &s.Server)
	populate(objectMap, "username", &s.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SybaseLinkedServiceTypeProperties.
func (s *SybaseLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &s.AuthenticationType)
			delete(rawMsg, key)
		case "database":
			err = unpopulate(val, "Database", &s.Database)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &s.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			s.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &s.Server)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &s.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SybaseSource.
func (s SybaseSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &s.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &s.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &s.MaxConcurrentConnections)
	populate(objectMap, "query", &s.Query)
	populate(objectMap, "queryTimeout", &s.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &s.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &s.SourceRetryWait)
	objectMap["type"] = "SybaseSource"
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SybaseSource.
func (s *SybaseSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &s.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &s.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &s.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &s.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &s.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &s.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &s.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SybaseTableDataset.
func (s SybaseTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", s.Annotations)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "folder", s.Folder)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "schema", &s.Schema)
	populate(objectMap, "structure", &s.Structure)
	objectMap["type"] = "SybaseTable"
	populate(objectMap, "typeProperties", s.TypeProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SybaseTableDataset.
func (s *SybaseTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &s.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &s.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &s.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &s.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SybaseTableDatasetTypeProperties.
func (s SybaseTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "tableName", &s.TableName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SynapseNotebookActivity.
func (s SynapseNotebookActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "policy", s.Policy)
	objectMap["type"] = "SynapseNotebook"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseNotebookActivity.
func (s *SynapseNotebookActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &s.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SynapseNotebookActivityTypeProperties.
func (s SynapseNotebookActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "conf", &s.Conf)
	populate(objectMap, "driverSize", &s.DriverSize)
	populate(objectMap, "executorSize", &s.ExecutorSize)
	populate(objectMap, "notebook", s.Notebook)
	populate(objectMap, "numExecutors", s.NumExecutors)
	populate(objectMap, "parameters", s.Parameters)
	populate(objectMap, "sparkPool", s.SparkPool)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseNotebookActivityTypeProperties.
func (s *SynapseNotebookActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "conf":
			err = unpopulate(val, "Conf", &s.Conf)
			delete(rawMsg, key)
		case "driverSize":
			err = unpopulate(val, "DriverSize", &s.DriverSize)
			delete(rawMsg, key)
		case "executorSize":
			err = unpopulate(val, "ExecutorSize", &s.ExecutorSize)
			delete(rawMsg, key)
		case "notebook":
			err = unpopulate(val, "Notebook", &s.Notebook)
			delete(rawMsg, key)
		case "numExecutors":
			err = unpopulate(val, "NumExecutors", &s.NumExecutors)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &s.Parameters)
			delete(rawMsg, key)
		case "sparkPool":
			err = unpopulate(val, "SparkPool", &s.SparkPool)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SynapseNotebookReference.
func (s SynapseNotebookReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", &s.ReferenceName)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type SynapseSparkJobActivityTypeProperties.
func (s SynapseSparkJobActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "args", s.Arguments)
	populate(objectMap, "className", &s.ClassName)
	populate(objectMap, "conf", &s.Conf)
	populate(objectMap, "driverSize", &s.DriverSize)
	populate(objectMap, "executorSize", &s.ExecutorSize)
	populate(objectMap, "file", &s.File)
	populate(objectMap, "files", s.Files)
	populate(objectMap, "filesV2", s.FilesV2)
	populate(objectMap, "numExecutors", s.NumExecutors)
	populate(objectMap, "pythonCodeReference", s.PythonCodeReference)
	populate(objectMap, "sparkJob", s.SparkJob)
	populate(objectMap, "targetBigDataPool", s.TargetBigDataPool)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseSparkJobActivityTypeProperties.
func (s *SynapseSparkJobActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "args":
			err = unpopulate(val, "Arguments", &s.Arguments)
			delete(rawMsg, key)
		case "className":
			err = unpopulate(val, "ClassName", &s.ClassName)
			delete(rawMsg, key)
		case "conf":
			err = unpopulate(val, "Conf", &s.Conf)
			delete(rawMsg, key)
		case "driverSize":
			err = unpopulate(val, "DriverSize", &s.DriverSize)
			delete(rawMsg, key)
		case "executorSize":
			err = unpopulate(val, "ExecutorSize", &s.ExecutorSize)
			delete(rawMsg, key)
		case "file":
			err = unpopulate(val, "File", &s.File)
			delete(rawMsg, key)
		case "files":
			err = unpopulate(val, "Files", &s.Files)
			delete(rawMsg, key)
		case "filesV2":
			err = unpopulate(val, "FilesV2", &s.FilesV2)
			delete(rawMsg, key)
		case "numExecutors":
			err = unpopulate(val, "NumExecutors", &s.NumExecutors)
			delete(rawMsg, key)
		case "pythonCodeReference":
			err = unpopulate(val, "PythonCodeReference", &s.PythonCodeReference)
			delete(rawMsg, key)
		case "sparkJob":
			err = unpopulate(val, "SparkJob", &s.SparkJob)
			delete(rawMsg, key)
		case "targetBigDataPool":
			err = unpopulate(val, "TargetBigDataPool", &s.TargetBigDataPool)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SynapseSparkJobDefinitionActivity.
func (s SynapseSparkJobDefinitionActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", s.DependsOn)
	populate(objectMap, "description", s.Description)
	populate(objectMap, "linkedServiceName", s.LinkedServiceName)
	populate(objectMap, "name", s.Name)
	populate(objectMap, "policy", s.Policy)
	objectMap["type"] = "SparkJob"
	populate(objectMap, "typeProperties", s.TypeProperties)
	populate(objectMap, "userProperties", s.UserProperties)
	if s.AdditionalProperties != nil {
		for key, val := range s.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseSparkJobDefinitionActivity.
func (s *SynapseSparkJobDefinitionActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", s, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &s.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &s.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &s.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &s.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &s.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &s.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &s.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &s.UserProperties)
			delete(rawMsg, key)
		default:
			if s.AdditionalProperties == nil {
				s.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				s.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", s, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type SynapseSparkJobReference.
func (s SynapseSparkJobReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", &s.ReferenceName)
	populate(objectMap, "type", s.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TabularSource.
func (t TabularSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &t.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &t.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &t.MaxConcurrentConnections)
	populate(objectMap, "queryTimeout", &t.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &t.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &t.SourceRetryWait)
	objectMap["type"] = "TabularSource"
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TabularSource.
func (t *TabularSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &t.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &t.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &t.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &t.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &t.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &t.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TarGZipReadSettings.
func (t TarGZipReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "preserveCompressionFileNameAsFolder", &t.PreserveCompressionFileNameAsFolder)
	objectMap["type"] = "TarGZipReadSettings"
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TarGZipReadSettings.
func (t *TarGZipReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "preserveCompressionFileNameAsFolder":
			err = unpopulate(val, "PreserveCompressionFileNameAsFolder", &t.PreserveCompressionFileNameAsFolder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TarReadSettings.
func (t TarReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "preserveCompressionFileNameAsFolder", &t.PreserveCompressionFileNameAsFolder)
	objectMap["type"] = "TarReadSettings"
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TarReadSettings.
func (t *TarReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "preserveCompressionFileNameAsFolder":
			err = unpopulate(val, "PreserveCompressionFileNameAsFolder", &t.PreserveCompressionFileNameAsFolder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeamDeskLinkedService.
func (t TeamDeskLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "connectVia", t.ConnectVia)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "parameters", t.Parameters)
	objectMap["type"] = "TeamDesk"
	populate(objectMap, "typeProperties", t.TypeProperties)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeamDeskLinkedService.
func (t *TeamDeskLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &t.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &t.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &t.TypeProperties)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeamDeskLinkedServiceTypeProperties.
func (t TeamDeskLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", t.APIToken)
	populate(objectMap, "authenticationType", t.AuthenticationType)
	populate(objectMap, "encryptedCredential", &t.EncryptedCredential)
	populate(objectMap, "password", t.Password)
	populate(objectMap, "url", &t.URL)
	populate(objectMap, "userName", &t.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeamDeskLinkedServiceTypeProperties.
func (t *TeamDeskLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiToken":
			t.APIToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &t.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &t.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			t.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &t.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &t.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataLinkedService.
func (t TeradataLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "connectVia", t.ConnectVia)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "parameters", t.Parameters)
	objectMap["type"] = "Teradata"
	populate(objectMap, "typeProperties", t.TypeProperties)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeradataLinkedService.
func (t *TeradataLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &t.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &t.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &t.TypeProperties)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataLinkedServiceTypeProperties.
func (t TeradataLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authenticationType", t.AuthenticationType)
	populate(objectMap, "connectionString", &t.ConnectionString)
	populate(objectMap, "encryptedCredential", &t.EncryptedCredential)
	populate(objectMap, "password", t.Password)
	populate(objectMap, "server", &t.Server)
	populate(objectMap, "username", &t.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeradataLinkedServiceTypeProperties.
func (t *TeradataLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &t.AuthenticationType)
			delete(rawMsg, key)
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &t.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &t.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			t.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "server":
			err = unpopulate(val, "Server", &t.Server)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &t.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataPartitionSettings.
func (t TeradataPartitionSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "partitionColumnName", &t.PartitionColumnName)
	populate(objectMap, "partitionLowerBound", &t.PartitionLowerBound)
	populate(objectMap, "partitionUpperBound", &t.PartitionUpperBound)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeradataPartitionSettings.
func (t *TeradataPartitionSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "partitionColumnName":
			err = unpopulate(val, "PartitionColumnName", &t.PartitionColumnName)
			delete(rawMsg, key)
		case "partitionLowerBound":
			err = unpopulate(val, "PartitionLowerBound", &t.PartitionLowerBound)
			delete(rawMsg, key)
		case "partitionUpperBound":
			err = unpopulate(val, "PartitionUpperBound", &t.PartitionUpperBound)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataSource.
func (t TeradataSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &t.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &t.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &t.MaxConcurrentConnections)
	populate(objectMap, "partitionOption", &t.PartitionOption)
	populate(objectMap, "partitionSettings", t.PartitionSettings)
	populate(objectMap, "query", &t.Query)
	populate(objectMap, "queryTimeout", &t.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &t.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &t.SourceRetryWait)
	objectMap["type"] = "TeradataSource"
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeradataSource.
func (t *TeradataSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &t.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &t.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &t.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "partitionOption":
			err = unpopulate(val, "PartitionOption", &t.PartitionOption)
			delete(rawMsg, key)
		case "partitionSettings":
			err = unpopulate(val, "PartitionSettings", &t.PartitionSettings)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &t.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &t.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &t.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &t.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataTableDataset.
func (t TeradataTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "folder", t.Folder)
	populate(objectMap, "linkedServiceName", t.LinkedServiceName)
	populate(objectMap, "parameters", t.Parameters)
	populate(objectMap, "schema", &t.Schema)
	populate(objectMap, "structure", &t.Structure)
	objectMap["type"] = "TeradataTable"
	populate(objectMap, "typeProperties", t.TypeProperties)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TeradataTableDataset.
func (t *TeradataTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &t.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &t.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &t.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &t.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &t.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &t.TypeProperties)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TeradataTableDatasetTypeProperties.
func (t TeradataTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "database", &t.Database)
	populate(objectMap, "table", &t.Table)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TextFormat.
func (t TextFormat) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "columnDelimiter", &t.ColumnDelimiter)
	populate(objectMap, "deserializer", &t.Deserializer)
	populate(objectMap, "encodingName", &t.EncodingName)
	populate(objectMap, "escapeChar", &t.EscapeChar)
	populate(objectMap, "firstRowAsHeader", &t.FirstRowAsHeader)
	populate(objectMap, "nullValue", &t.NullValue)
	populate(objectMap, "quoteChar", &t.QuoteChar)
	populate(objectMap, "rowDelimiter", &t.RowDelimiter)
	populate(objectMap, "serializer", &t.Serializer)
	populate(objectMap, "skipLineCount", &t.SkipLineCount)
	populate(objectMap, "treatEmptyAsNull", &t.TreatEmptyAsNull)
	objectMap["type"] = "TextFormat"
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TextFormat.
func (t *TextFormat) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "columnDelimiter":
			err = unpopulate(val, "ColumnDelimiter", &t.ColumnDelimiter)
			delete(rawMsg, key)
		case "deserializer":
			err = unpopulate(val, "Deserializer", &t.Deserializer)
			delete(rawMsg, key)
		case "encodingName":
			err = unpopulate(val, "EncodingName", &t.EncodingName)
			delete(rawMsg, key)
		case "escapeChar":
			err = unpopulate(val, "EscapeChar", &t.EscapeChar)
			delete(rawMsg, key)
		case "firstRowAsHeader":
			err = unpopulate(val, "FirstRowAsHeader", &t.FirstRowAsHeader)
			delete(rawMsg, key)
		case "nullValue":
			err = unpopulate(val, "NullValue", &t.NullValue)
			delete(rawMsg, key)
		case "quoteChar":
			err = unpopulate(val, "QuoteChar", &t.QuoteChar)
			delete(rawMsg, key)
		case "rowDelimiter":
			err = unpopulate(val, "RowDelimiter", &t.RowDelimiter)
			delete(rawMsg, key)
		case "serializer":
			err = unpopulate(val, "Serializer", &t.Serializer)
			delete(rawMsg, key)
		case "skipLineCount":
			err = unpopulate(val, "SkipLineCount", &t.SkipLineCount)
			delete(rawMsg, key)
		case "treatEmptyAsNull":
			err = unpopulate(val, "TreatEmptyAsNull", &t.TreatEmptyAsNull)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Transformation.
func (t Transformation) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dataset", t.Dataset)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "flowlet", t.Flowlet)
	populate(objectMap, "linkedService", t.LinkedService)
	populate(objectMap, "name", t.Name)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Transformation.
func (t *Transformation) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dataset":
			err = unpopulate(val, "Dataset", &t.Dataset)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "flowlet":
			err = unpopulate(val, "Flowlet", &t.Flowlet)
			delete(rawMsg, key)
		case "linkedService":
			err = unpopulate(val, "LinkedService", &t.LinkedService)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &t.Name)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type Trigger.
func (t Trigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "runtimeState", t.RuntimeState)
	objectMap["type"] = t.Type
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type Trigger.
func (t *Trigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &t.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TriggerDependencyReference.
func (t TriggerDependencyReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceTrigger", t.ReferenceTrigger)
	objectMap["type"] = "TriggerDependencyReference"
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TriggerFilterParameters.
func (t TriggerFilterParameters) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "continuationToken", t.ContinuationToken)
	populate(objectMap, "parentTriggerName", t.ParentTriggerName)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type TriggerPipelineReference.
func (t TriggerPipelineReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "parameters", t.Parameters)
	populate(objectMap, "pipelineReference", t.PipelineReference)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TriggerQueryResponse.
func (t TriggerQueryResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "continuationToken", t.ContinuationToken)
	populate(objectMap, "value", t.Value)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TriggerReference.
func (t TriggerReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "referenceName", t.ReferenceName)
	populate(objectMap, "type", t.Type)
	return json.Marshal(objectMap)
}

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

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

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

// MarshalJSON implements the json.Marshaller interface for type TriggerRun.
func (t TriggerRun) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependencyStatus", t.DependencyStatus)
	populate(objectMap, "message", t.Message)
	populate(objectMap, "properties", t.Properties)
	populate(objectMap, "runDimension", t.RunDimension)
	populate(objectMap, "status", t.Status)
	populate(objectMap, "triggerName", t.TriggerName)
	populate(objectMap, "triggerRunId", t.TriggerRunID)
	populateTimeRFC3339(objectMap, "triggerRunTimestamp", t.TriggerRunTimestamp)
	populate(objectMap, "triggerType", t.TriggerType)
	populate(objectMap, "triggeredPipelines", t.TriggeredPipelines)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerRun.
func (t *TriggerRun) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependencyStatus":
			err = unpopulate(val, "DependencyStatus", &t.DependencyStatus)
			delete(rawMsg, key)
		case "message":
			err = unpopulate(val, "Message", &t.Message)
			delete(rawMsg, key)
		case "properties":
			err = unpopulate(val, "Properties", &t.Properties)
			delete(rawMsg, key)
		case "runDimension":
			err = unpopulate(val, "RunDimension", &t.RunDimension)
			delete(rawMsg, key)
		case "status":
			err = unpopulate(val, "Status", &t.Status)
			delete(rawMsg, key)
		case "triggerName":
			err = unpopulate(val, "TriggerName", &t.TriggerName)
			delete(rawMsg, key)
		case "triggerRunId":
			err = unpopulate(val, "TriggerRunID", &t.TriggerRunID)
			delete(rawMsg, key)
		case "triggerRunTimestamp":
			err = unpopulateTimeRFC3339(val, "TriggerRunTimestamp", &t.TriggerRunTimestamp)
			delete(rawMsg, key)
		case "triggerType":
			err = unpopulate(val, "TriggerType", &t.TriggerType)
			delete(rawMsg, key)
		case "triggeredPipelines":
			err = unpopulate(val, "TriggeredPipelines", &t.TriggeredPipelines)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TriggerRunsQueryResponse.
func (t TriggerRunsQueryResponse) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "continuationToken", t.ContinuationToken)
	populate(objectMap, "value", t.Value)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TriggerSubscriptionOperationStatus.
func (t TriggerSubscriptionOperationStatus) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "status", t.Status)
	populate(objectMap, "triggerName", t.TriggerName)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type TumblingWindowTrigger.
func (t TumblingWindowTrigger) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "pipeline", t.Pipeline)
	populate(objectMap, "runtimeState", t.RuntimeState)
	objectMap["type"] = "TumblingWindowTrigger"
	populate(objectMap, "typeProperties", t.TypeProperties)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TumblingWindowTrigger.
func (t *TumblingWindowTrigger) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "pipeline":
			err = unpopulate(val, "Pipeline", &t.Pipeline)
			delete(rawMsg, key)
		case "runtimeState":
			err = unpopulate(val, "RuntimeState", &t.RuntimeState)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &t.TypeProperties)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TumblingWindowTriggerDependencyReference.
func (t TumblingWindowTriggerDependencyReference) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "offset", t.Offset)
	populate(objectMap, "referenceTrigger", t.ReferenceTrigger)
	populate(objectMap, "size", t.Size)
	objectMap["type"] = "TumblingWindowTriggerDependencyReference"
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TumblingWindowTriggerDependencyReference.
func (t *TumblingWindowTriggerDependencyReference) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "offset":
			err = unpopulate(val, "Offset", &t.Offset)
			delete(rawMsg, key)
		case "referenceTrigger":
			err = unpopulate(val, "ReferenceTrigger", &t.ReferenceTrigger)
			delete(rawMsg, key)
		case "size":
			err = unpopulate(val, "Size", &t.Size)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TumblingWindowTriggerTypeProperties.
func (t TumblingWindowTriggerTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "delay", &t.Delay)
	populate(objectMap, "dependsOn", t.DependsOn)
	populateTimeRFC3339(objectMap, "endTime", t.EndTime)
	populate(objectMap, "frequency", t.Frequency)
	populate(objectMap, "interval", t.Interval)
	populate(objectMap, "maxConcurrency", t.MaxConcurrency)
	populate(objectMap, "retryPolicy", t.RetryPolicy)
	populateTimeRFC3339(objectMap, "startTime", t.StartTime)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TumblingWindowTriggerTypeProperties.
func (t *TumblingWindowTriggerTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "delay":
			err = unpopulate(val, "Delay", &t.Delay)
			delete(rawMsg, key)
		case "dependsOn":
			t.DependsOn, err = unmarshalDependencyReferenceClassificationArray(val)
			delete(rawMsg, key)
		case "endTime":
			err = unpopulateTimeRFC3339(val, "EndTime", &t.EndTime)
			delete(rawMsg, key)
		case "frequency":
			err = unpopulate(val, "Frequency", &t.Frequency)
			delete(rawMsg, key)
		case "interval":
			err = unpopulate(val, "Interval", &t.Interval)
			delete(rawMsg, key)
		case "maxConcurrency":
			err = unpopulate(val, "MaxConcurrency", &t.MaxConcurrency)
			delete(rawMsg, key)
		case "retryPolicy":
			err = unpopulate(val, "RetryPolicy", &t.RetryPolicy)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulateTimeRFC3339(val, "StartTime", &t.StartTime)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TwilioLinkedService.
func (t TwilioLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", t.Annotations)
	populate(objectMap, "connectVia", t.ConnectVia)
	populate(objectMap, "description", t.Description)
	populate(objectMap, "parameters", t.Parameters)
	objectMap["type"] = "Twilio"
	populate(objectMap, "typeProperties", t.TypeProperties)
	if t.AdditionalProperties != nil {
		for key, val := range t.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TwilioLinkedService.
func (t *TwilioLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &t.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &t.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &t.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &t.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &t.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &t.TypeProperties)
			delete(rawMsg, key)
		default:
			if t.AdditionalProperties == nil {
				t.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				t.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type TwilioLinkedServiceTypeProperties.
func (t TwilioLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "password", t.Password)
	populate(objectMap, "userName", &t.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type TwilioLinkedServiceTypeProperties.
func (t *TwilioLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", t, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "password":
			t.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &t.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", t, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type UntilActivity.
func (u UntilActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", u.DependsOn)
	populate(objectMap, "description", u.Description)
	populate(objectMap, "name", u.Name)
	objectMap["type"] = "Until"
	populate(objectMap, "typeProperties", u.TypeProperties)
	populate(objectMap, "userProperties", u.UserProperties)
	if u.AdditionalProperties != nil {
		for key, val := range u.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UntilActivity.
func (u *UntilActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", u, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &u.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &u.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &u.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &u.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &u.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &u.UserProperties)
			delete(rawMsg, key)
		default:
			if u.AdditionalProperties == nil {
				u.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				u.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", u, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type UntilActivityTypeProperties.
func (u UntilActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "activities", u.Activities)
	populate(objectMap, "expression", u.Expression)
	populate(objectMap, "timeout", &u.Timeout)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UntilActivityTypeProperties.
func (u *UntilActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", u, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "activities":
			u.Activities, err = unmarshalActivityClassificationArray(val)
			delete(rawMsg, key)
		case "expression":
			err = unpopulate(val, "Expression", &u.Expression)
			delete(rawMsg, key)
		case "timeout":
			err = unpopulate(val, "Timeout", &u.Timeout)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", u, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type UpdateIntegrationRuntimeRequest.
func (u UpdateIntegrationRuntimeRequest) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "autoUpdate", u.AutoUpdate)
	populate(objectMap, "updateDelayOffset", u.UpdateDelayOffset)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type UserAccessPolicy.
func (u UserAccessPolicy) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessResourcePath", u.AccessResourcePath)
	populate(objectMap, "expireTime", u.ExpireTime)
	populate(objectMap, "permissions", u.Permissions)
	populate(objectMap, "profileName", u.ProfileName)
	populate(objectMap, "startTime", u.StartTime)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type UserAccessPolicy.
func (u *UserAccessPolicy) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", u, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessResourcePath":
			err = unpopulate(val, "AccessResourcePath", &u.AccessResourcePath)
			delete(rawMsg, key)
		case "expireTime":
			err = unpopulate(val, "ExpireTime", &u.ExpireTime)
			delete(rawMsg, key)
		case "permissions":
			err = unpopulate(val, "Permissions", &u.Permissions)
			delete(rawMsg, key)
		case "profileName":
			err = unpopulate(val, "ProfileName", &u.ProfileName)
			delete(rawMsg, key)
		case "startTime":
			err = unpopulate(val, "StartTime", &u.StartTime)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", u, err)
		}
	}
	return nil
}

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

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

// MarshalJSON implements the json.Marshaller interface for type ValidationActivity.
func (v ValidationActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", v.DependsOn)
	populate(objectMap, "description", v.Description)
	populate(objectMap, "name", v.Name)
	objectMap["type"] = "Validation"
	populate(objectMap, "typeProperties", v.TypeProperties)
	populate(objectMap, "userProperties", v.UserProperties)
	if v.AdditionalProperties != nil {
		for key, val := range v.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationActivity.
func (v *ValidationActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &v.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &v.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &v.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &v.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &v.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &v.UserProperties)
			delete(rawMsg, key)
		default:
			if v.AdditionalProperties == nil {
				v.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				v.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ValidationActivityTypeProperties.
func (v ValidationActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "childItems", &v.ChildItems)
	populate(objectMap, "dataset", v.Dataset)
	populate(objectMap, "minimumSize", &v.MinimumSize)
	populate(objectMap, "sleep", &v.Sleep)
	populate(objectMap, "timeout", &v.Timeout)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationActivityTypeProperties.
func (v *ValidationActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "childItems":
			err = unpopulate(val, "ChildItems", &v.ChildItems)
			delete(rawMsg, key)
		case "dataset":
			err = unpopulate(val, "Dataset", &v.Dataset)
			delete(rawMsg, key)
		case "minimumSize":
			err = unpopulate(val, "MinimumSize", &v.MinimumSize)
			delete(rawMsg, key)
		case "sleep":
			err = unpopulate(val, "Sleep", &v.Sleep)
			delete(rawMsg, key)
		case "timeout":
			err = unpopulate(val, "Timeout", &v.Timeout)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type VariableSpecification.
func (v VariableSpecification) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "defaultValue", &v.DefaultValue)
	populate(objectMap, "type", v.Type)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type VerticaDatasetTypeProperties.
func (v VerticaDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "schema", &v.Schema)
	populate(objectMap, "table", &v.Table)
	populate(objectMap, "tableName", &v.TableName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type VerticaDatasetTypeProperties.
func (v *VerticaDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "schema":
			err = unpopulate(val, "Schema", &v.Schema)
			delete(rawMsg, key)
		case "table":
			err = unpopulate(val, "Table", &v.Table)
			delete(rawMsg, key)
		case "tableName":
			err = unpopulate(val, "TableName", &v.TableName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type VerticaLinkedService.
func (v VerticaLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", v.Annotations)
	populate(objectMap, "connectVia", v.ConnectVia)
	populate(objectMap, "description", v.Description)
	populate(objectMap, "parameters", v.Parameters)
	objectMap["type"] = "Vertica"
	populate(objectMap, "typeProperties", v.TypeProperties)
	if v.AdditionalProperties != nil {
		for key, val := range v.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type VerticaLinkedService.
func (v *VerticaLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &v.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &v.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &v.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &v.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &v.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &v.TypeProperties)
			delete(rawMsg, key)
		default:
			if v.AdditionalProperties == nil {
				v.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				v.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type VerticaLinkedServiceTypeProperties.
func (v VerticaLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionString", &v.ConnectionString)
	populate(objectMap, "encryptedCredential", &v.EncryptedCredential)
	populate(objectMap, "pwd", v.Pwd)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type VerticaLinkedServiceTypeProperties.
func (v *VerticaLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionString":
			err = unpopulate(val, "ConnectionString", &v.ConnectionString)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &v.EncryptedCredential)
			delete(rawMsg, key)
		case "pwd":
			err = unpopulate(val, "Pwd", &v.Pwd)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type VerticaSource.
func (v VerticaSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &v.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &v.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &v.MaxConcurrentConnections)
	populate(objectMap, "query", &v.Query)
	populate(objectMap, "queryTimeout", &v.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &v.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &v.SourceRetryWait)
	objectMap["type"] = "VerticaSource"
	if v.AdditionalProperties != nil {
		for key, val := range v.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type VerticaSource.
func (v *VerticaSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &v.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &v.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &v.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &v.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &v.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &v.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &v.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &v.Type)
			delete(rawMsg, key)
		default:
			if v.AdditionalProperties == nil {
				v.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				v.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type VerticaTableDataset.
func (v VerticaTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", v.Annotations)
	populate(objectMap, "description", v.Description)
	populate(objectMap, "folder", v.Folder)
	populate(objectMap, "linkedServiceName", v.LinkedServiceName)
	populate(objectMap, "parameters", v.Parameters)
	populate(objectMap, "schema", &v.Schema)
	populate(objectMap, "structure", &v.Structure)
	objectMap["type"] = "VerticaTable"
	populate(objectMap, "typeProperties", v.TypeProperties)
	if v.AdditionalProperties != nil {
		for key, val := range v.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type VerticaTableDataset.
func (v *VerticaTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", v, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &v.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &v.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &v.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &v.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &v.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &v.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &v.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &v.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &v.TypeProperties)
			delete(rawMsg, key)
		default:
			if v.AdditionalProperties == nil {
				v.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				v.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", v, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WaitActivity.
func (w WaitActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", w.DependsOn)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "name", w.Name)
	objectMap["type"] = "Wait"
	populate(objectMap, "typeProperties", w.TypeProperties)
	populate(objectMap, "userProperties", w.UserProperties)
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WaitActivity.
func (w *WaitActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &w.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &w.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &w.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &w.UserProperties)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WaitActivityTypeProperties.
func (w WaitActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "waitTimeInSeconds", &w.WaitTimeInSeconds)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type WebActivity.
func (w WebActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", w.DependsOn)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "linkedServiceName", w.LinkedServiceName)
	populate(objectMap, "name", w.Name)
	populate(objectMap, "policy", w.Policy)
	objectMap["type"] = "WebActivity"
	populate(objectMap, "typeProperties", w.TypeProperties)
	populate(objectMap, "userProperties", w.UserProperties)
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebActivity.
func (w *WebActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &w.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &w.LinkedServiceName)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &w.Name)
			delete(rawMsg, key)
		case "policy":
			err = unpopulate(val, "Policy", &w.Policy)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &w.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &w.UserProperties)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebActivityAuthentication.
func (w WebActivityAuthentication) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "credential", w.Credential)
	populate(objectMap, "password", w.Password)
	populate(objectMap, "pfx", w.Pfx)
	populate(objectMap, "resource", &w.Resource)
	populate(objectMap, "type", w.Type)
	populate(objectMap, "userTenant", &w.UserTenant)
	populate(objectMap, "username", &w.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebActivityAuthentication.
func (w *WebActivityAuthentication) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "credential":
			err = unpopulate(val, "Credential", &w.Credential)
			delete(rawMsg, key)
		case "password":
			w.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "pfx":
			w.Pfx, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "resource":
			err = unpopulate(val, "Resource", &w.Resource)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "userTenant":
			err = unpopulate(val, "UserTenant", &w.UserTenant)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &w.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebActivityTypeProperties.
func (w WebActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authentication", w.Authentication)
	populate(objectMap, "body", &w.Body)
	populate(objectMap, "connectVia", w.ConnectVia)
	populate(objectMap, "datasets", w.Datasets)
	populate(objectMap, "disableCertValidation", w.DisableCertValidation)
	populate(objectMap, "headers", &w.Headers)
	populate(objectMap, "linkedServices", w.LinkedServices)
	populate(objectMap, "method", w.Method)
	populate(objectMap, "url", &w.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebActivityTypeProperties.
func (w *WebActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authentication":
			err = unpopulate(val, "Authentication", &w.Authentication)
			delete(rawMsg, key)
		case "body":
			err = unpopulate(val, "Body", &w.Body)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &w.ConnectVia)
			delete(rawMsg, key)
		case "datasets":
			err = unpopulate(val, "Datasets", &w.Datasets)
			delete(rawMsg, key)
		case "disableCertValidation":
			err = unpopulate(val, "DisableCertValidation", &w.DisableCertValidation)
			delete(rawMsg, key)
		case "headers":
			err = unpopulate(val, "Headers", &w.Headers)
			delete(rawMsg, key)
		case "linkedServices":
			err = unpopulate(val, "LinkedServices", &w.LinkedServices)
			delete(rawMsg, key)
		case "method":
			err = unpopulate(val, "Method", &w.Method)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &w.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebAnonymousAuthentication.
func (w WebAnonymousAuthentication) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authenticationType"] = WebAuthenticationTypeAnonymous
	populate(objectMap, "url", &w.URL)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type WebBasicAuthentication.
func (w WebBasicAuthentication) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authenticationType"] = WebAuthenticationTypeBasic
	populate(objectMap, "password", w.Password)
	populate(objectMap, "url", &w.URL)
	populate(objectMap, "username", &w.Username)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebBasicAuthentication.
func (w *WebBasicAuthentication) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &w.AuthenticationType)
			delete(rawMsg, key)
		case "password":
			w.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &w.URL)
			delete(rawMsg, key)
		case "username":
			err = unpopulate(val, "Username", &w.Username)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebClientCertificateAuthentication.
func (w WebClientCertificateAuthentication) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authenticationType"] = WebAuthenticationTypeClientCertificate
	populate(objectMap, "password", w.Password)
	populate(objectMap, "pfx", w.Pfx)
	populate(objectMap, "url", &w.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebClientCertificateAuthentication.
func (w *WebClientCertificateAuthentication) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &w.AuthenticationType)
			delete(rawMsg, key)
		case "password":
			w.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "pfx":
			w.Pfx, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &w.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebHookActivity.
func (w WebHookActivity) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "dependsOn", w.DependsOn)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "name", w.Name)
	objectMap["type"] = "WebHook"
	populate(objectMap, "typeProperties", w.TypeProperties)
	populate(objectMap, "userProperties", w.UserProperties)
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebHookActivity.
func (w *WebHookActivity) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "dependsOn":
			err = unpopulate(val, "DependsOn", &w.DependsOn)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "name":
			err = unpopulate(val, "Name", &w.Name)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &w.TypeProperties)
			delete(rawMsg, key)
		case "userProperties":
			err = unpopulate(val, "UserProperties", &w.UserProperties)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebHookActivityTypeProperties.
func (w WebHookActivityTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "authentication", w.Authentication)
	populate(objectMap, "body", &w.Body)
	populate(objectMap, "headers", &w.Headers)
	populate(objectMap, "method", w.Method)
	populate(objectMap, "reportStatusOnCallBack", &w.ReportStatusOnCallBack)
	populate(objectMap, "timeout", w.Timeout)
	populate(objectMap, "url", &w.URL)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebHookActivityTypeProperties.
func (w *WebHookActivityTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "authentication":
			err = unpopulate(val, "Authentication", &w.Authentication)
			delete(rawMsg, key)
		case "body":
			err = unpopulate(val, "Body", &w.Body)
			delete(rawMsg, key)
		case "headers":
			err = unpopulate(val, "Headers", &w.Headers)
			delete(rawMsg, key)
		case "method":
			err = unpopulate(val, "Method", &w.Method)
			delete(rawMsg, key)
		case "reportStatusOnCallBack":
			err = unpopulate(val, "ReportStatusOnCallBack", &w.ReportStatusOnCallBack)
			delete(rawMsg, key)
		case "timeout":
			err = unpopulate(val, "Timeout", &w.Timeout)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &w.URL)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebLinkedService.
func (w WebLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", w.Annotations)
	populate(objectMap, "connectVia", w.ConnectVia)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "parameters", w.Parameters)
	objectMap["type"] = "Web"
	populate(objectMap, "typeProperties", w.TypeProperties)
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebLinkedService.
func (w *WebLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &w.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &w.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &w.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			w.TypeProperties, err = unmarshalWebLinkedServiceTypePropertiesClassification(val)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebLinkedServiceTypeProperties.
func (w WebLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	objectMap["authenticationType"] = w.AuthenticationType
	populate(objectMap, "url", &w.URL)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type WebSource.
func (w WebSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &w.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &w.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &w.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &w.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &w.SourceRetryWait)
	objectMap["type"] = "WebSource"
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebSource.
func (w *WebSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &w.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &w.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &w.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &w.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &w.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebTableDataset.
func (w WebTableDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", w.Annotations)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "folder", w.Folder)
	populate(objectMap, "linkedServiceName", w.LinkedServiceName)
	populate(objectMap, "parameters", w.Parameters)
	populate(objectMap, "schema", &w.Schema)
	populate(objectMap, "structure", &w.Structure)
	objectMap["type"] = "WebTable"
	populate(objectMap, "typeProperties", w.TypeProperties)
	if w.AdditionalProperties != nil {
		for key, val := range w.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WebTableDataset.
func (w *WebTableDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &w.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &w.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &w.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &w.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &w.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &w.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &w.TypeProperties)
			delete(rawMsg, key)
		default:
			if w.AdditionalProperties == nil {
				w.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				w.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type WebTableDatasetTypeProperties.
func (w WebTableDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "index", &w.Index)
	populate(objectMap, "path", &w.Path)
	return json.Marshal(objectMap)
}

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

// MarshalJSON implements the json.Marshaller interface for type WranglingDataFlow.
func (w WranglingDataFlow) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", w.Annotations)
	populate(objectMap, "description", w.Description)
	populate(objectMap, "folder", w.Folder)
	objectMap["type"] = "WranglingDataFlow"
	populate(objectMap, "typeProperties", w.TypeProperties)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type WranglingDataFlow.
func (w *WranglingDataFlow) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", w, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &w.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &w.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &w.Folder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &w.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &w.TypeProperties)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", w, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XMLDataset.
func (x XMLDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", x.Annotations)
	populate(objectMap, "description", x.Description)
	populate(objectMap, "folder", x.Folder)
	populate(objectMap, "linkedServiceName", x.LinkedServiceName)
	populate(objectMap, "parameters", x.Parameters)
	populate(objectMap, "schema", &x.Schema)
	populate(objectMap, "structure", &x.Structure)
	objectMap["type"] = "Xml"
	populate(objectMap, "typeProperties", x.TypeProperties)
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XMLDataset.
func (x *XMLDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &x.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &x.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &x.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &x.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &x.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &x.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &x.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &x.TypeProperties)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XMLDatasetTypeProperties.
func (x XMLDatasetTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compression", x.Compression)
	populate(objectMap, "encodingName", &x.EncodingName)
	populate(objectMap, "location", x.Location)
	populate(objectMap, "nullValue", &x.NullValue)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XMLDatasetTypeProperties.
func (x *XMLDatasetTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compression":
			err = unpopulate(val, "Compression", &x.Compression)
			delete(rawMsg, key)
		case "encodingName":
			err = unpopulate(val, "EncodingName", &x.EncodingName)
			delete(rawMsg, key)
		case "location":
			x.Location, err = unmarshalDatasetLocationClassification(val)
			delete(rawMsg, key)
		case "nullValue":
			err = unpopulate(val, "NullValue", &x.NullValue)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XMLReadSettings.
func (x XMLReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "compressionProperties", x.CompressionProperties)
	populate(objectMap, "detectDataType", &x.DetectDataType)
	populate(objectMap, "namespacePrefixes", &x.NamespacePrefixes)
	populate(objectMap, "namespaces", &x.Namespaces)
	objectMap["type"] = "XmlReadSettings"
	populate(objectMap, "validationMode", &x.ValidationMode)
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XMLReadSettings.
func (x *XMLReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "compressionProperties":
			x.CompressionProperties, err = unmarshalCompressionReadSettingsClassification(val)
			delete(rawMsg, key)
		case "detectDataType":
			err = unpopulate(val, "DetectDataType", &x.DetectDataType)
			delete(rawMsg, key)
		case "namespacePrefixes":
			err = unpopulate(val, "NamespacePrefixes", &x.NamespacePrefixes)
			delete(rawMsg, key)
		case "namespaces":
			err = unpopulate(val, "Namespaces", &x.Namespaces)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		case "validationMode":
			err = unpopulate(val, "ValidationMode", &x.ValidationMode)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XMLSource.
func (x XMLSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &x.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &x.DisableMetricsCollection)
	populate(objectMap, "formatSettings", x.FormatSettings)
	populate(objectMap, "maxConcurrentConnections", &x.MaxConcurrentConnections)
	populate(objectMap, "sourceRetryCount", &x.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &x.SourceRetryWait)
	populate(objectMap, "storeSettings", x.StoreSettings)
	objectMap["type"] = "XmlSource"
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XMLSource.
func (x *XMLSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &x.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &x.DisableMetricsCollection)
			delete(rawMsg, key)
		case "formatSettings":
			err = unpopulate(val, "FormatSettings", &x.FormatSettings)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &x.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &x.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &x.SourceRetryWait)
			delete(rawMsg, key)
		case "storeSettings":
			x.StoreSettings, err = unmarshalStoreReadSettingsClassification(val)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XeroLinkedService.
func (x XeroLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", x.Annotations)
	populate(objectMap, "connectVia", x.ConnectVia)
	populate(objectMap, "description", x.Description)
	populate(objectMap, "parameters", x.Parameters)
	objectMap["type"] = "Xero"
	populate(objectMap, "typeProperties", x.TypeProperties)
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XeroLinkedService.
func (x *XeroLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &x.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &x.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &x.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &x.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &x.TypeProperties)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XeroLinkedServiceTypeProperties.
func (x XeroLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "connectionProperties", &x.ConnectionProperties)
	populate(objectMap, "consumerKey", x.ConsumerKey)
	populate(objectMap, "encryptedCredential", &x.EncryptedCredential)
	populate(objectMap, "host", &x.Host)
	populate(objectMap, "privateKey", x.PrivateKey)
	populate(objectMap, "useEncryptedEndpoints", &x.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &x.UseHostVerification)
	populate(objectMap, "usePeerVerification", &x.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XeroLinkedServiceTypeProperties.
func (x *XeroLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &x.ConnectionProperties)
			delete(rawMsg, key)
		case "consumerKey":
			x.ConsumerKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &x.EncryptedCredential)
			delete(rawMsg, key)
		case "host":
			err = unpopulate(val, "Host", &x.Host)
			delete(rawMsg, key)
		case "privateKey":
			x.PrivateKey, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &x.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &x.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &x.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XeroObjectDataset.
func (x XeroObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", x.Annotations)
	populate(objectMap, "description", x.Description)
	populate(objectMap, "folder", x.Folder)
	populate(objectMap, "linkedServiceName", x.LinkedServiceName)
	populate(objectMap, "parameters", x.Parameters)
	populate(objectMap, "schema", &x.Schema)
	populate(objectMap, "structure", &x.Structure)
	objectMap["type"] = "XeroObject"
	populate(objectMap, "typeProperties", x.TypeProperties)
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XeroObjectDataset.
func (x *XeroObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &x.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &x.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &x.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &x.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &x.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &x.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &x.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &x.TypeProperties)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type XeroSource.
func (x XeroSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &x.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &x.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &x.MaxConcurrentConnections)
	populate(objectMap, "query", &x.Query)
	populate(objectMap, "queryTimeout", &x.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &x.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &x.SourceRetryWait)
	objectMap["type"] = "XeroSource"
	if x.AdditionalProperties != nil {
		for key, val := range x.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type XeroSource.
func (x *XeroSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", x, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &x.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &x.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &x.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &x.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &x.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &x.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &x.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &x.Type)
			delete(rawMsg, key)
		default:
			if x.AdditionalProperties == nil {
				x.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				x.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", x, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZendeskLinkedService.
func (z ZendeskLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", z.Annotations)
	populate(objectMap, "connectVia", z.ConnectVia)
	populate(objectMap, "description", z.Description)
	populate(objectMap, "parameters", z.Parameters)
	objectMap["type"] = "Zendesk"
	populate(objectMap, "typeProperties", z.TypeProperties)
	if z.AdditionalProperties != nil {
		for key, val := range z.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZendeskLinkedService.
func (z *ZendeskLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &z.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &z.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &z.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &z.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &z.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &z.TypeProperties)
			delete(rawMsg, key)
		default:
			if z.AdditionalProperties == nil {
				z.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				z.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZendeskLinkedServiceTypeProperties.
func (z ZendeskLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "apiToken", z.APIToken)
	populate(objectMap, "authenticationType", z.AuthenticationType)
	populate(objectMap, "encryptedCredential", &z.EncryptedCredential)
	populate(objectMap, "password", z.Password)
	populate(objectMap, "url", &z.URL)
	populate(objectMap, "userName", &z.UserName)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZendeskLinkedServiceTypeProperties.
func (z *ZendeskLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "apiToken":
			z.APIToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "authenticationType":
			err = unpopulate(val, "AuthenticationType", &z.AuthenticationType)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &z.EncryptedCredential)
			delete(rawMsg, key)
		case "password":
			z.Password, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "url":
			err = unpopulate(val, "URL", &z.URL)
			delete(rawMsg, key)
		case "userName":
			err = unpopulate(val, "UserName", &z.UserName)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZipDeflateReadSettings.
func (z ZipDeflateReadSettings) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "preserveZipFileNameAsFolder", &z.PreserveZipFileNameAsFolder)
	objectMap["type"] = "ZipDeflateReadSettings"
	if z.AdditionalProperties != nil {
		for key, val := range z.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZipDeflateReadSettings.
func (z *ZipDeflateReadSettings) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "preserveZipFileNameAsFolder":
			err = unpopulate(val, "PreserveZipFileNameAsFolder", &z.PreserveZipFileNameAsFolder)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &z.Type)
			delete(rawMsg, key)
		default:
			if z.AdditionalProperties == nil {
				z.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				z.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZohoLinkedService.
func (z ZohoLinkedService) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", z.Annotations)
	populate(objectMap, "connectVia", z.ConnectVia)
	populate(objectMap, "description", z.Description)
	populate(objectMap, "parameters", z.Parameters)
	objectMap["type"] = "Zoho"
	populate(objectMap, "typeProperties", z.TypeProperties)
	if z.AdditionalProperties != nil {
		for key, val := range z.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZohoLinkedService.
func (z *ZohoLinkedService) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &z.Annotations)
			delete(rawMsg, key)
		case "connectVia":
			err = unpopulate(val, "ConnectVia", &z.ConnectVia)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &z.Description)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &z.Parameters)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &z.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &z.TypeProperties)
			delete(rawMsg, key)
		default:
			if z.AdditionalProperties == nil {
				z.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				z.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZohoLinkedServiceTypeProperties.
func (z ZohoLinkedServiceTypeProperties) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "accessToken", z.AccessToken)
	populate(objectMap, "connectionProperties", &z.ConnectionProperties)
	populate(objectMap, "encryptedCredential", &z.EncryptedCredential)
	populate(objectMap, "endpoint", &z.Endpoint)
	populate(objectMap, "useEncryptedEndpoints", &z.UseEncryptedEndpoints)
	populate(objectMap, "useHostVerification", &z.UseHostVerification)
	populate(objectMap, "usePeerVerification", &z.UsePeerVerification)
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZohoLinkedServiceTypeProperties.
func (z *ZohoLinkedServiceTypeProperties) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "accessToken":
			z.AccessToken, err = unmarshalSecretBaseClassification(val)
			delete(rawMsg, key)
		case "connectionProperties":
			err = unpopulate(val, "ConnectionProperties", &z.ConnectionProperties)
			delete(rawMsg, key)
		case "encryptedCredential":
			err = unpopulate(val, "EncryptedCredential", &z.EncryptedCredential)
			delete(rawMsg, key)
		case "endpoint":
			err = unpopulate(val, "Endpoint", &z.Endpoint)
			delete(rawMsg, key)
		case "useEncryptedEndpoints":
			err = unpopulate(val, "UseEncryptedEndpoints", &z.UseEncryptedEndpoints)
			delete(rawMsg, key)
		case "useHostVerification":
			err = unpopulate(val, "UseHostVerification", &z.UseHostVerification)
			delete(rawMsg, key)
		case "usePeerVerification":
			err = unpopulate(val, "UsePeerVerification", &z.UsePeerVerification)
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZohoObjectDataset.
func (z ZohoObjectDataset) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "annotations", z.Annotations)
	populate(objectMap, "description", z.Description)
	populate(objectMap, "folder", z.Folder)
	populate(objectMap, "linkedServiceName", z.LinkedServiceName)
	populate(objectMap, "parameters", z.Parameters)
	populate(objectMap, "schema", &z.Schema)
	populate(objectMap, "structure", &z.Structure)
	objectMap["type"] = "ZohoObject"
	populate(objectMap, "typeProperties", z.TypeProperties)
	if z.AdditionalProperties != nil {
		for key, val := range z.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZohoObjectDataset.
func (z *ZohoObjectDataset) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "annotations":
			err = unpopulate(val, "Annotations", &z.Annotations)
			delete(rawMsg, key)
		case "description":
			err = unpopulate(val, "Description", &z.Description)
			delete(rawMsg, key)
		case "folder":
			err = unpopulate(val, "Folder", &z.Folder)
			delete(rawMsg, key)
		case "linkedServiceName":
			err = unpopulate(val, "LinkedServiceName", &z.LinkedServiceName)
			delete(rawMsg, key)
		case "parameters":
			err = unpopulate(val, "Parameters", &z.Parameters)
			delete(rawMsg, key)
		case "schema":
			err = unpopulate(val, "Schema", &z.Schema)
			delete(rawMsg, key)
		case "structure":
			err = unpopulate(val, "Structure", &z.Structure)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &z.Type)
			delete(rawMsg, key)
		case "typeProperties":
			err = unpopulate(val, "TypeProperties", &z.TypeProperties)
			delete(rawMsg, key)
		default:
			if z.AdditionalProperties == nil {
				z.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				z.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

// MarshalJSON implements the json.Marshaller interface for type ZohoSource.
func (z ZohoSource) MarshalJSON() ([]byte, error) {
	objectMap := make(map[string]interface{})
	populate(objectMap, "additionalColumns", &z.AdditionalColumns)
	populate(objectMap, "disableMetricsCollection", &z.DisableMetricsCollection)
	populate(objectMap, "maxConcurrentConnections", &z.MaxConcurrentConnections)
	populate(objectMap, "query", &z.Query)
	populate(objectMap, "queryTimeout", &z.QueryTimeout)
	populate(objectMap, "sourceRetryCount", &z.SourceRetryCount)
	populate(objectMap, "sourceRetryWait", &z.SourceRetryWait)
	objectMap["type"] = "ZohoSource"
	if z.AdditionalProperties != nil {
		for key, val := range z.AdditionalProperties {
			objectMap[key] = val
		}
	}
	return json.Marshal(objectMap)
}

// UnmarshalJSON implements the json.Unmarshaller interface for type ZohoSource.
func (z *ZohoSource) UnmarshalJSON(data []byte) error {
	var rawMsg map[string]json.RawMessage
	if err := json.Unmarshal(data, &rawMsg); err != nil {
		return fmt.Errorf("unmarshalling type %T: %v", z, err)
	}
	for key, val := range rawMsg {
		var err error
		switch key {
		case "additionalColumns":
			err = unpopulate(val, "AdditionalColumns", &z.AdditionalColumns)
			delete(rawMsg, key)
		case "disableMetricsCollection":
			err = unpopulate(val, "DisableMetricsCollection", &z.DisableMetricsCollection)
			delete(rawMsg, key)
		case "maxConcurrentConnections":
			err = unpopulate(val, "MaxConcurrentConnections", &z.MaxConcurrentConnections)
			delete(rawMsg, key)
		case "query":
			err = unpopulate(val, "Query", &z.Query)
			delete(rawMsg, key)
		case "queryTimeout":
			err = unpopulate(val, "QueryTimeout", &z.QueryTimeout)
			delete(rawMsg, key)
		case "sourceRetryCount":
			err = unpopulate(val, "SourceRetryCount", &z.SourceRetryCount)
			delete(rawMsg, key)
		case "sourceRetryWait":
			err = unpopulate(val, "SourceRetryWait", &z.SourceRetryWait)
			delete(rawMsg, key)
		case "type":
			err = unpopulate(val, "Type", &z.Type)
			delete(rawMsg, key)
		default:
			if z.AdditionalProperties == nil {
				z.AdditionalProperties = map[string]interface{}{}
			}
			if val != nil {
				var aux interface{}
				err = json.Unmarshal(val, &aux)
				z.AdditionalProperties[key] = aux
			}
			delete(rawMsg, key)
		}
		if err != nil {
			return fmt.Errorf("unmarshalling type %T: %v", z, err)
		}
	}
	return nil
}

func populate(m map[string]interface{}, k string, v interface{}) {
	if v == nil {
		return
	} else if azcore.IsNullValue(v) {
		m[k] = nil
	} else if !reflect.ValueOf(v).IsNil() {
		m[k] = v
	}
}

func unpopulate(data json.RawMessage, fn string, v interface{}) error {
	if data == nil {
		return nil
	}
	if err := json.Unmarshal(data, v); err != nil {
		return fmt.Errorf("struct field %s: %v", fn, err)
	}
	return nil
}
