// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.

package armworkloadorchestration

import "encoding/json"

func unmarshalJobParameterBaseClassification(rawMsg json.RawMessage) (JobParameterBaseClassification, error) {
	if rawMsg == nil || string(rawMsg) == "null" {
		return nil, nil
	}
	var m map[string]any
	if err := json.Unmarshal(rawMsg, &m); err != nil {
		return nil, err
	}
	var b JobParameterBaseClassification
	switch m["jobType"] {
	case string(JobTypeDeploy):
		b = &DeployJobParameter{}
	default:
		b = &JobParameterBase{}
	}
	if err := json.Unmarshal(rawMsg, b); err != nil {
		return nil, err
	}
	return b, nil
}

func unmarshalJobStepStatisticsBaseClassification(rawMsg json.RawMessage) (JobStepStatisticsBaseClassification, error) {
	if rawMsg == nil || string(rawMsg) == "null" {
		return nil, nil
	}
	var m map[string]any
	if err := json.Unmarshal(rawMsg, &m); err != nil {
		return nil, err
	}
	var b JobStepStatisticsBaseClassification
	switch m["statisticsType"] {
	case string(JobTypeDeploy):
		b = &DeployJobStepStatistics{}
	default:
		b = &JobStepStatisticsBase{}
	}
	if err := json.Unmarshal(rawMsg, b); err != nil {
		return nil, err
	}
	return b, nil
}
