sdk/resourcemanager/devcenter/armdevcenter/models_serde.go (3,949 lines of code) (raw):

//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armdevcenter import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) // MarshalJSON implements the json.Marshaller interface for type AllowedEnvironmentType. func (a AllowedEnvironmentType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentType. func (a *AllowedEnvironmentType) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AllowedEnvironmentTypeListResult. func (a AllowedEnvironmentTypeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentTypeListResult. func (a *AllowedEnvironmentTypeListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AllowedEnvironmentTypeProperties. func (a AllowedEnvironmentTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AllowedEnvironmentTypeProperties. func (a *AllowedEnvironmentTypeProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AttachedNetworkConnection. func (a AttachedNetworkConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkConnection. func (a *AttachedNetworkConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AttachedNetworkConnectionProperties. func (a AttachedNetworkConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "domainJoinType", a.DomainJoinType) populate(objectMap, "healthCheckStatus", a.HealthCheckStatus) populate(objectMap, "networkConnectionId", a.NetworkConnectionID) populate(objectMap, "networkConnectionLocation", a.NetworkConnectionLocation) populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkConnectionProperties. func (a *AttachedNetworkConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "domainJoinType": err = unpopulate(val, "DomainJoinType", &a.DomainJoinType) delete(rawMsg, key) case "healthCheckStatus": err = unpopulate(val, "HealthCheckStatus", &a.HealthCheckStatus) delete(rawMsg, key) case "networkConnectionId": err = unpopulate(val, "NetworkConnectionID", &a.NetworkConnectionID) delete(rawMsg, key) case "networkConnectionLocation": err = unpopulate(val, "NetworkConnectionLocation", &a.NetworkConnectionLocation) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type AttachedNetworkListResult. func (a AttachedNetworkListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AttachedNetworkListResult. func (a *AttachedNetworkListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Capability. func (c Capability) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Capability. func (c *Capability) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Catalog. func (c Catalog) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Catalog. func (c *Catalog) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogConflictError. func (c CatalogConflictError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "path", c.Path) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogConflictError. func (c *CatalogConflictError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "path": err = unpopulate(val, "Path", &c.Path) 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 CatalogErrorDetails. func (c CatalogErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "code", c.Code) populate(objectMap, "message", c.Message) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogErrorDetails. func (c *CatalogErrorDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "code": err = unpopulate(val, "Code", &c.Code) delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &c.Message) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogListResult. func (c CatalogListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogListResult. func (c *CatalogListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogProperties. func (c CatalogProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adoGit", c.AdoGit) populate(objectMap, "connectionState", c.ConnectionState) populate(objectMap, "gitHub", c.GitHub) populateDateTimeRFC3339(objectMap, "lastConnectionTime", c.LastConnectionTime) populate(objectMap, "lastSyncStats", c.LastSyncStats) populateDateTimeRFC3339(objectMap, "lastSyncTime", c.LastSyncTime) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "syncState", c.SyncState) populate(objectMap, "syncType", c.SyncType) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogProperties. func (c *CatalogProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "adoGit": err = unpopulate(val, "AdoGit", &c.AdoGit) delete(rawMsg, key) case "connectionState": err = unpopulate(val, "ConnectionState", &c.ConnectionState) delete(rawMsg, key) case "gitHub": err = unpopulate(val, "GitHub", &c.GitHub) delete(rawMsg, key) case "lastConnectionTime": err = unpopulateDateTimeRFC3339(val, "LastConnectionTime", &c.LastConnectionTime) delete(rawMsg, key) case "lastSyncStats": err = unpopulate(val, "LastSyncStats", &c.LastSyncStats) delete(rawMsg, key) case "lastSyncTime": err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &c.LastSyncTime) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) case "syncState": err = unpopulate(val, "SyncState", &c.SyncState) delete(rawMsg, key) case "syncType": err = unpopulate(val, "SyncType", &c.SyncType) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogResourceValidationErrorDetails. func (c CatalogResourceValidationErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "errors", c.Errors) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogResourceValidationErrorDetails. func (c *CatalogResourceValidationErrorDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "errors": err = unpopulate(val, "Errors", &c.Errors) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogSyncError. func (c CatalogSyncError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "errorDetails", c.ErrorDetails) populate(objectMap, "path", c.Path) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogSyncError. func (c *CatalogSyncError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "errorDetails": err = unpopulate(val, "ErrorDetails", &c.ErrorDetails) delete(rawMsg, key) case "path": err = unpopulate(val, "Path", &c.Path) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogUpdate. func (c CatalogUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogUpdate. func (c *CatalogUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CatalogUpdateProperties. func (c CatalogUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adoGit", c.AdoGit) populate(objectMap, "gitHub", c.GitHub) populate(objectMap, "syncType", c.SyncType) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CatalogUpdateProperties. func (c *CatalogUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "adoGit": err = unpopulate(val, "AdoGit", &c.AdoGit) delete(rawMsg, key) case "gitHub": err = unpopulate(val, "GitHub", &c.GitHub) delete(rawMsg, key) case "syncType": err = unpopulate(val, "SyncType", &c.SyncType) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "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 CheckNameAvailabilityResponse. func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "message", c.Message) populate(objectMap, "nameAvailable", c.NameAvailable) populate(objectMap, "reason", c.Reason) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "message": err = unpopulate(val, "Message", &c.Message) delete(rawMsg, key) case "nameAvailable": err = unpopulate(val, "NameAvailable", &c.NameAvailable) delete(rawMsg, key) case "reason": err = unpopulate(val, "Reason", &c.Reason) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CheckScopedNameAvailabilityRequest. func (c CheckScopedNameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "scope", c.Scope) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CheckScopedNameAvailabilityRequest. func (c *CheckScopedNameAvailabilityRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "scope": err = unpopulate(val, "Scope", &c.Scope) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryption. func (c CustomerManagedKeyEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyEncryptionKeyIdentity", c.KeyEncryptionKeyIdentity) populate(objectMap, "keyEncryptionKeyUrl", c.KeyEncryptionKeyURL) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryption. func (c *CustomerManagedKeyEncryption) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "keyEncryptionKeyIdentity": err = unpopulate(val, "KeyEncryptionKeyIdentity", &c.KeyEncryptionKeyIdentity) delete(rawMsg, key) case "keyEncryptionKeyUrl": err = unpopulate(val, "KeyEncryptionKeyURL", &c.KeyEncryptionKeyURL) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CustomerManagedKeyEncryptionKeyIdentity. func (c CustomerManagedKeyEncryptionKeyIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "delegatedIdentityClientId", c.DelegatedIdentityClientID) populate(objectMap, "identityType", c.IdentityType) populate(objectMap, "userAssignedIdentityResourceId", c.UserAssignedIdentityResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CustomerManagedKeyEncryptionKeyIdentity. func (c *CustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "delegatedIdentityClientId": err = unpopulate(val, "DelegatedIdentityClientID", &c.DelegatedIdentityClientID) delete(rawMsg, key) case "identityType": err = unpopulate(val, "IdentityType", &c.IdentityType) delete(rawMsg, key) case "userAssignedIdentityResourceId": err = unpopulate(val, "UserAssignedIdentityResourceID", &c.UserAssignedIdentityResourceID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DevBoxDefinition. func (d DevBoxDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinition. func (d *DevBoxDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionListResult. func (d DevBoxDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionListResult. func (d *DevBoxDefinitionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 DevBoxDefinitionProperties. func (d DevBoxDefinitionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "activeImageReference", d.ActiveImageReference) populate(objectMap, "hibernateSupport", d.HibernateSupport) populate(objectMap, "imageReference", d.ImageReference) populate(objectMap, "imageValidationErrorDetails", d.ImageValidationErrorDetails) populate(objectMap, "imageValidationStatus", d.ImageValidationStatus) populate(objectMap, "osStorageType", d.OSStorageType) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "sku", d.SKU) populate(objectMap, "validationStatus", d.ValidationStatus) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionProperties. func (d *DevBoxDefinitionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "activeImageReference": err = unpopulate(val, "ActiveImageReference", &d.ActiveImageReference) delete(rawMsg, key) case "hibernateSupport": err = unpopulate(val, "HibernateSupport", &d.HibernateSupport) delete(rawMsg, key) case "imageReference": err = unpopulate(val, "ImageReference", &d.ImageReference) delete(rawMsg, key) case "imageValidationErrorDetails": err = unpopulate(val, "ImageValidationErrorDetails", &d.ImageValidationErrorDetails) delete(rawMsg, key) case "imageValidationStatus": err = unpopulate(val, "ImageValidationStatus", &d.ImageValidationStatus) delete(rawMsg, key) case "osStorageType": err = unpopulate(val, "OSStorageType", &d.OSStorageType) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) case "validationStatus": err = unpopulate(val, "ValidationStatus", &d.ValidationStatus) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionUpdate. func (d DevBoxDefinitionUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "location", d.Location) populate(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionUpdate. func (d *DevBoxDefinitionUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "location": err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DevBoxDefinitionUpdateProperties. func (d DevBoxDefinitionUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "hibernateSupport", d.HibernateSupport) populate(objectMap, "imageReference", d.ImageReference) populate(objectMap, "osStorageType", d.OSStorageType) populate(objectMap, "sku", d.SKU) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevBoxDefinitionUpdateProperties. func (d *DevBoxDefinitionUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "hibernateSupport": err = unpopulate(val, "HibernateSupport", &d.HibernateSupport) delete(rawMsg, key) case "imageReference": err = unpopulate(val, "ImageReference", &d.ImageReference) delete(rawMsg, key) case "osStorageType": err = unpopulate(val, "OSStorageType", &d.OSStorageType) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &d.SKU) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DevCenter. func (d DevCenter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "identity", d.Identity) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DevCenter. func (d *DevCenter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Encryption. func (e Encryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customerManagedKeyEncryption", e.CustomerManagedKeyEncryption) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. func (e *Encryption) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "customerManagedKeyEncryption": err = unpopulate(val, "CustomerManagedKeyEncryption", &e.CustomerManagedKeyEncryption) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EndpointDependency. func (e EndpointDependency) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "domainName", e.DomainName) populate(objectMap, "endpointDetails", e.EndpointDetails) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. func (e *EndpointDependency) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "domainName": err = unpopulate(val, "DomainName", &e.DomainName) delete(rawMsg, key) case "endpointDetails": err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EndpointDetail. func (e EndpointDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "port", e.Port) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. func (e *EndpointDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "port": err = unpopulate(val, "Port", &e.Port) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinition. func (e EnvironmentDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) populate(objectMap, "systemData", e.SystemData) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinition. func (e *EnvironmentDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinitionListResult. func (e EnvironmentDefinitionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionListResult. func (e *EnvironmentDefinitionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinitionParameter. func (e EnvironmentDefinitionParameter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "readOnly", e.ReadOnly) populate(objectMap, "required", e.Required) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionParameter. func (e *EnvironmentDefinitionParameter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "readOnly": err = unpopulate(val, "ReadOnly", &e.ReadOnly) delete(rawMsg, key) case "required": err = unpopulate(val, "Required", &e.Required) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentDefinitionProperties. func (e EnvironmentDefinitionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "parameters", e.Parameters) populate(objectMap, "templatePath", e.TemplatePath) populate(objectMap, "validationStatus", e.ValidationStatus) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDefinitionProperties. func (e *EnvironmentDefinitionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "parameters": err = unpopulate(val, "Parameters", &e.Parameters) delete(rawMsg, key) case "templatePath": err = unpopulate(val, "TemplatePath", &e.TemplatePath) delete(rawMsg, key) case "validationStatus": err = unpopulate(val, "ValidationStatus", &e.ValidationStatus) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentRole. func (e EnvironmentRole) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "roleName", e.RoleName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentRole. func (e *EnvironmentRole) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "roleName": err = unpopulate(val, "RoleName", &e.RoleName) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentType. func (e EnvironmentType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) populate(objectMap, "systemData", e.SystemData) populate(objectMap, "tags", e.Tags) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentType. func (e *EnvironmentType) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeListResult. func (e EnvironmentTypeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeListResult. func (e *EnvironmentTypeListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &e.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeProperties. func (e EnvironmentTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", e.DisplayName) populate(objectMap, "provisioningState", e.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeProperties. func (e *EnvironmentTypeProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeUpdate. func (e EnvironmentTypeUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", e.Properties) populate(objectMap, "tags", e.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeUpdate. func (e *EnvironmentTypeUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EnvironmentTypeUpdateProperties. func (e EnvironmentTypeUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", e.DisplayName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentTypeUpdateProperties. func (e *EnvironmentTypeUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateAny(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "info": err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) populate(objectMap, "message", e.Message) populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "additionalInfo": err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) case "code": err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) case "details": err = unpopulate(val, "Details", &e.Details) delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) case "target": err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Gallery. func (g Gallery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) populate(objectMap, "systemData", g.SystemData) populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Gallery. func (g *Gallery) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type GalleryListResult. func (g GalleryListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type GalleryListResult. func (g *GalleryListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 GalleryProperties. func (g GalleryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "galleryResourceId", g.GalleryResourceID) populate(objectMap, "provisioningState", g.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type GalleryProperties. func (g *GalleryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "galleryResourceId": err = unpopulate(val, "GalleryResourceID", &g.GalleryResourceID) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type GitCatalog. func (g GitCatalog) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "branch", g.Branch) populate(objectMap, "path", g.Path) populate(objectMap, "secretIdentifier", g.SecretIdentifier) populate(objectMap, "uri", g.URI) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type GitCatalog. func (g *GitCatalog) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "branch": err = unpopulate(val, "Branch", &g.Branch) delete(rawMsg, key) case "path": err = unpopulate(val, "Path", &g.Path) delete(rawMsg, key) case "secretIdentifier": err = unpopulate(val, "SecretIdentifier", &g.SecretIdentifier) delete(rawMsg, key) case "uri": err = unpopulate(val, "URI", &g.URI) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HealthCheck. func (h HealthCheck) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalDetails", h.AdditionalDetails) populate(objectMap, "displayName", h.DisplayName) populateDateTimeRFC3339(objectMap, "endDateTime", h.EndDateTime) populate(objectMap, "errorType", h.ErrorType) populate(objectMap, "recommendedAction", h.RecommendedAction) populateDateTimeRFC3339(objectMap, "startDateTime", h.StartDateTime) populate(objectMap, "status", h.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheck. func (h *HealthCheck) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "additionalDetails": err = unpopulate(val, "AdditionalDetails", &h.AdditionalDetails) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &h.DisplayName) delete(rawMsg, key) case "endDateTime": err = unpopulateDateTimeRFC3339(val, "EndDateTime", &h.EndDateTime) delete(rawMsg, key) case "errorType": err = unpopulate(val, "ErrorType", &h.ErrorType) delete(rawMsg, key) case "recommendedAction": err = unpopulate(val, "RecommendedAction", &h.RecommendedAction) delete(rawMsg, key) case "startDateTime": err = unpopulateDateTimeRFC3339(val, "StartDateTime", &h.StartDateTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &h.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HealthCheckStatusDetails. func (h HealthCheckStatusDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", h.ID) populate(objectMap, "name", h.Name) populate(objectMap, "properties", h.Properties) populate(objectMap, "systemData", h.SystemData) populate(objectMap, "type", h.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetails. func (h *HealthCheckStatusDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &h.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &h.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &h.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &h.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HealthCheckStatusDetailsListResult. func (h HealthCheckStatusDetailsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", h.NextLink) populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetailsListResult. func (h *HealthCheckStatusDetailsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &h.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &h.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HealthCheckStatusDetailsProperties. func (h HealthCheckStatusDetailsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endDateTime", h.EndDateTime) populate(objectMap, "healthChecks", h.HealthChecks) populateDateTimeRFC3339(objectMap, "startDateTime", h.StartDateTime) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStatusDetailsProperties. func (h *HealthCheckStatusDetailsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "endDateTime": err = unpopulateDateTimeRFC3339(val, "EndDateTime", &h.EndDateTime) delete(rawMsg, key) case "healthChecks": err = unpopulate(val, "HealthChecks", &h.HealthChecks) delete(rawMsg, key) case "startDateTime": err = unpopulateDateTimeRFC3339(val, "StartDateTime", &h.StartDateTime) 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 HealthStatusDetail. func (h HealthStatusDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "code", h.Code) populate(objectMap, "message", h.Message) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HealthStatusDetail. func (h *HealthStatusDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "code": err = unpopulate(val, "Code", &h.Code) delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &h.Message) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Image. func (i Image) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) populate(objectMap, "systemData", i.SystemData) populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Image. func (i *Image) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &i.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ImageListResult. func (i ImageListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageListResult. func (i *ImageListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ImageProperties. func (i ImageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", i.Description) populate(objectMap, "hibernateSupport", i.HibernateSupport) populate(objectMap, "offer", i.Offer) populate(objectMap, "provisioningState", i.ProvisioningState) populate(objectMap, "publisher", i.Publisher) populate(objectMap, "recommendedMachineConfiguration", i.RecommendedMachineConfiguration) populate(objectMap, "sku", i.SKU) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageProperties. func (i *ImageProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 "hibernateSupport": err = unpopulate(val, "HibernateSupport", &i.HibernateSupport) delete(rawMsg, key) case "offer": err = unpopulate(val, "Offer", &i.Offer) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) case "publisher": err = unpopulate(val, "Publisher", &i.Publisher) delete(rawMsg, key) case "recommendedMachineConfiguration": err = unpopulate(val, "RecommendedMachineConfiguration", &i.RecommendedMachineConfiguration) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &i.SKU) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ImageReference. func (i ImageReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "exactVersion", i.ExactVersion) populate(objectMap, "id", i.ID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageReference. func (i *ImageReference) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "exactVersion": err = unpopulate(val, "ExactVersion", &i.ExactVersion) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ImageValidationErrorDetails. func (i ImageValidationErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "code", i.Code) populate(objectMap, "message", i.Message) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageValidationErrorDetails. func (i *ImageValidationErrorDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "code": err = unpopulate(val, "Code", &i.Code) delete(rawMsg, key) case "message": err = unpopulate(val, "Message", &i.Message) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ImageVersion. func (i ImageVersion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) populate(objectMap, "systemData", i.SystemData) populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersion. func (i *ImageVersion) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &i.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ImageVersionListResult. func (i ImageVersionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionListResult. func (i *ImageVersionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ImageVersionProperties. func (i ImageVersionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "excludeFromLatest", i.ExcludeFromLatest) populate(objectMap, "name", i.Name) populate(objectMap, "osDiskImageSizeInGb", i.OSDiskImageSizeInGb) populate(objectMap, "provisioningState", i.ProvisioningState) populateDateTimeRFC3339(objectMap, "publishedDate", i.PublishedDate) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ImageVersionProperties. func (i *ImageVersionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "excludeFromLatest": err = unpopulate(val, "ExcludeFromLatest", &i.ExcludeFromLatest) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "osDiskImageSizeInGb": err = unpopulate(val, "OSDiskImageSizeInGb", &i.OSDiskImageSizeInGb) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &i.ProvisioningState) delete(rawMsg, key) case "publishedDate": err = unpopulateDateTimeRFC3339(val, "PublishedDate", &i.PublishedDate) 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 ListResult. func (l ListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", l.NextLink) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ListResult. func (l *ListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ListUsagesResult. func (l ListUsagesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", l.NextLink) populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. func (l *ListUsagesResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ManagedServiceIdentity. func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "principalId", m.PrincipalID) populate(objectMap, "tenantId", m.TenantID) populate(objectMap, "type", m.Type) populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "principalId": err = unpopulate(val, "PrincipalID", &m.PrincipalID) delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &m.TenantID) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) case "userAssignedIdentities": err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NetworkConnection. func (n NetworkConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) populate(objectMap, "systemData", n.SystemData) populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnection. func (n *NetworkConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NetworkConnectionListResult. func (n NetworkConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", n.NextLink) populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionListResult. func (n *NetworkConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NetworkConnectionUpdate. func (n NetworkConnectionUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "location", n.Location) populate(objectMap, "properties", n.Properties) populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionUpdate. func (n *NetworkConnectionUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "location": err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NetworkConnectionUpdateProperties. func (n NetworkConnectionUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "domainName", n.DomainName) populate(objectMap, "domainPassword", n.DomainPassword) populate(objectMap, "domainUsername", n.DomainUsername) populate(objectMap, "organizationUnit", n.OrganizationUnit) populate(objectMap, "subnetId", n.SubnetID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NetworkConnectionUpdateProperties. func (n *NetworkConnectionUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "domainName": err = unpopulate(val, "DomainName", &n.DomainName) delete(rawMsg, key) case "domainPassword": err = unpopulate(val, "DomainPassword", &n.DomainPassword) delete(rawMsg, key) case "domainUsername": err = unpopulate(val, "DomainUsername", &n.DomainUsername) delete(rawMsg, key) case "organizationUnit": err = unpopulate(val, "OrganizationUnit", &n.OrganizationUnit) delete(rawMsg, key) case "subnetId": err = unpopulate(val, "SubnetID", &n.SubnetID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NetworkProperties. func (n NetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "domainJoinType", n.DomainJoinType) populate(objectMap, "domainName", n.DomainName) populate(objectMap, "domainPassword", n.DomainPassword) populate(objectMap, "domainUsername", n.DomainUsername) populate(objectMap, "healthCheckStatus", n.HealthCheckStatus) populate(objectMap, "networkingResourceGroupName", n.NetworkingResourceGroupName) populate(objectMap, "organizationUnit", n.OrganizationUnit) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "subnetId", n.SubnetID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProperties. func (n *NetworkProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "domainJoinType": err = unpopulate(val, "DomainJoinType", &n.DomainJoinType) delete(rawMsg, key) case "domainName": err = unpopulate(val, "DomainName", &n.DomainName) delete(rawMsg, key) case "domainPassword": err = unpopulate(val, "DomainPassword", &n.DomainPassword) delete(rawMsg, key) case "domainUsername": err = unpopulate(val, "DomainUsername", &n.DomainUsername) delete(rawMsg, key) case "healthCheckStatus": err = unpopulate(val, "HealthCheckStatus", &n.HealthCheckStatus) delete(rawMsg, key) case "networkingResourceGroupName": err = unpopulate(val, "NetworkingResourceGroupName", &n.NetworkingResourceGroupName) delete(rawMsg, key) case "organizationUnit": err = unpopulate(val, "OrganizationUnit", &n.OrganizationUnit) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) case "subnetId": err = unpopulate(val, "SubnetID", &n.SubnetID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Operation. func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "actionType": err = unpopulate(val, "ActionType", &o.ActionType) delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) case "isDataAction": err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "origin": err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. func (o *OperationDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) case "operation": err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) case "resource": err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationStatus. func (o OperationStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "operations", o.Operations) populate(objectMap, "percentComplete", o.PercentComplete) populateAny(objectMap, "properties", o.Properties) populate(objectMap, "resourceId", o.ResourceID) populateDateTimeRFC3339(objectMap, "startTime", o.StartTime) populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. func (o *OperationStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "endTime": err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) delete(rawMsg, key) case "error": err = unpopulate(val, "Error", &o.Error) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "operations": err = unpopulate(val, "Operations", &o.Operations) delete(rawMsg, key) case "percentComplete": err = unpopulate(val, "PercentComplete", &o.PercentComplete) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &o.ResourceID) delete(rawMsg, key) case "startTime": err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &o.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationStatusResult. func (o OperationStatusResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "endTime", o.EndTime) populate(objectMap, "error", o.Error) populate(objectMap, "id", o.ID) populate(objectMap, "name", o.Name) populate(objectMap, "operations", o.Operations) populate(objectMap, "percentComplete", o.PercentComplete) populate(objectMap, "resourceId", o.ResourceID) populateDateTimeRFC3339(objectMap, "startTime", o.StartTime) populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "endTime": err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) delete(rawMsg, key) case "error": err = unpopulate(val, "Error", &o.Error) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "operations": err = unpopulate(val, "Operations", &o.Operations) delete(rawMsg, key) case "percentComplete": err = unpopulate(val, "PercentComplete", &o.PercentComplete) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &o.ResourceID) delete(rawMsg, key) case "startTime": err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &o.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "category", o.Category) populate(objectMap, "endpoints", o.Endpoints) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "category": err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) case "endpoints": err = unpopulate(val, "Endpoints", &o.Endpoints) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection. func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 Pool. func (p Pool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Pool. func (p *Pool) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PoolListResult. func (p PoolListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PoolListResult. func (p *PoolListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 PoolProperties. func (p PoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "devBoxCount", p.DevBoxCount) populate(objectMap, "devBoxDefinitionName", p.DevBoxDefinitionName) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "healthStatus", p.HealthStatus) populate(objectMap, "healthStatusDetails", p.HealthStatusDetails) populate(objectMap, "licenseType", p.LicenseType) populate(objectMap, "localAdministrator", p.LocalAdministrator) populate(objectMap, "managedVirtualNetworkRegions", p.ManagedVirtualNetworkRegions) populate(objectMap, "networkConnectionName", p.NetworkConnectionName) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "singleSignOnStatus", p.SingleSignOnStatus) populate(objectMap, "stopOnDisconnect", p.StopOnDisconnect) populate(objectMap, "virtualNetworkType", p.VirtualNetworkType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PoolProperties. func (p *PoolProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "devBoxCount": err = unpopulate(val, "DevBoxCount", &p.DevBoxCount) delete(rawMsg, key) case "devBoxDefinitionName": err = unpopulate(val, "DevBoxDefinitionName", &p.DevBoxDefinitionName) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "healthStatus": err = unpopulate(val, "HealthStatus", &p.HealthStatus) delete(rawMsg, key) case "healthStatusDetails": err = unpopulate(val, "HealthStatusDetails", &p.HealthStatusDetails) delete(rawMsg, key) case "licenseType": err = unpopulate(val, "LicenseType", &p.LicenseType) delete(rawMsg, key) case "localAdministrator": err = unpopulate(val, "LocalAdministrator", &p.LocalAdministrator) delete(rawMsg, key) case "managedVirtualNetworkRegions": err = unpopulate(val, "ManagedVirtualNetworkRegions", &p.ManagedVirtualNetworkRegions) delete(rawMsg, key) case "networkConnectionName": err = unpopulate(val, "NetworkConnectionName", &p.NetworkConnectionName) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "singleSignOnStatus": err = unpopulate(val, "SingleSignOnStatus", &p.SingleSignOnStatus) delete(rawMsg, key) case "stopOnDisconnect": err = unpopulate(val, "StopOnDisconnect", &p.StopOnDisconnect) delete(rawMsg, key) case "virtualNetworkType": err = unpopulate(val, "VirtualNetworkType", &p.VirtualNetworkType) 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 PoolUpdate. func (p PoolUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "location", p.Location) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PoolUpdate. func (p *PoolUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PoolUpdateProperties. func (p PoolUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "devBoxDefinitionName", p.DevBoxDefinitionName) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "licenseType", p.LicenseType) populate(objectMap, "localAdministrator", p.LocalAdministrator) populate(objectMap, "managedVirtualNetworkRegions", p.ManagedVirtualNetworkRegions) populate(objectMap, "networkConnectionName", p.NetworkConnectionName) populate(objectMap, "singleSignOnStatus", p.SingleSignOnStatus) populate(objectMap, "stopOnDisconnect", p.StopOnDisconnect) populate(objectMap, "virtualNetworkType", p.VirtualNetworkType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PoolUpdateProperties. func (p *PoolUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "devBoxDefinitionName": err = unpopulate(val, "DevBoxDefinitionName", &p.DevBoxDefinitionName) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "licenseType": err = unpopulate(val, "LicenseType", &p.LicenseType) delete(rawMsg, key) case "localAdministrator": err = unpopulate(val, "LocalAdministrator", &p.LocalAdministrator) delete(rawMsg, key) case "managedVirtualNetworkRegions": err = unpopulate(val, "ManagedVirtualNetworkRegions", &p.ManagedVirtualNetworkRegions) delete(rawMsg, key) case "networkConnectionName": err = unpopulate(val, "NetworkConnectionName", &p.NetworkConnectionName) delete(rawMsg, key) case "singleSignOnStatus": err = unpopulate(val, "SingleSignOnStatus", &p.SingleSignOnStatus) delete(rawMsg, key) case "stopOnDisconnect": err = unpopulate(val, "StopOnDisconnect", &p.StopOnDisconnect) delete(rawMsg, key) case "virtualNetworkType": err = unpopulate(val, "VirtualNetworkType", &p.VirtualNetworkType) 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 Project. func (p Project) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Project. func (p *Project) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectCatalogSettings. func (p ProjectCatalogSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "catalogItemSyncTypes", p.CatalogItemSyncTypes) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCatalogSettings. func (p *ProjectCatalogSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "catalogItemSyncTypes": err = unpopulate(val, "CatalogItemSyncTypes", &p.CatalogItemSyncTypes) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectCatalogSettingsInfo. func (p ProjectCatalogSettingsInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "catalogItemSyncEnableStatus", p.CatalogItemSyncEnableStatus) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectCatalogSettingsInfo. func (p *ProjectCatalogSettingsInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "catalogItemSyncEnableStatus": err = unpopulate(val, "CatalogItemSyncEnableStatus", &p.CatalogItemSyncEnableStatus) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentType. func (p ProjectEnvironmentType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentType. func (p *ProjectEnvironmentType) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeListResult. func (p ProjectEnvironmentTypeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeListResult. func (p *ProjectEnvironmentTypeListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ProjectEnvironmentTypeProperties. func (p ProjectEnvironmentTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "creatorRoleAssignment", p.CreatorRoleAssignment) populate(objectMap, "deploymentTargetId", p.DeploymentTargetID) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "environmentCount", p.EnvironmentCount) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "status", p.Status) populate(objectMap, "userRoleAssignments", p.UserRoleAssignments) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeProperties. func (p *ProjectEnvironmentTypeProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "creatorRoleAssignment": err = unpopulate(val, "CreatorRoleAssignment", &p.CreatorRoleAssignment) delete(rawMsg, key) case "deploymentTargetId": err = unpopulate(val, "DeploymentTargetID", &p.DeploymentTargetID) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "environmentCount": err = unpopulate(val, "EnvironmentCount", &p.EnvironmentCount) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) case "userRoleAssignments": err = unpopulate(val, "UserRoleAssignments", &p.UserRoleAssignments) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdate. func (p ProjectEnvironmentTypeUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", p.Identity) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdate. func (p *ProjectEnvironmentTypeUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdateProperties. func (p ProjectEnvironmentTypeUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "creatorRoleAssignment", p.CreatorRoleAssignment) populate(objectMap, "deploymentTargetId", p.DeploymentTargetID) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "status", p.Status) populate(objectMap, "userRoleAssignments", p.UserRoleAssignments) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdateProperties. func (p *ProjectEnvironmentTypeUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "creatorRoleAssignment": err = unpopulate(val, "CreatorRoleAssignment", &p.CreatorRoleAssignment) delete(rawMsg, key) case "deploymentTargetId": err = unpopulate(val, "DeploymentTargetID", &p.DeploymentTargetID) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) case "userRoleAssignments": err = unpopulate(val, "UserRoleAssignments", &p.UserRoleAssignments) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment. func (p ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "roles", p.Roles) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment. func (p *ProjectEnvironmentTypeUpdatePropertiesCreatorRoleAssignment) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "roles": err = unpopulate(val, "Roles", &p.Roles) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectListResult. func (p ProjectListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectListResult. func (p *ProjectListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 ProjectProperties. func (p ProjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "catalogSettings", p.CatalogSettings) populate(objectMap, "description", p.Description) populate(objectMap, "devCenterId", p.DevCenterID) populate(objectMap, "devCenterUri", p.DevCenterURI) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "maxDevBoxesPerUser", p.MaxDevBoxesPerUser) populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectProperties. func (p *ProjectProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "catalogSettings": err = unpopulate(val, "CatalogSettings", &p.CatalogSettings) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) case "devCenterId": err = unpopulate(val, "DevCenterID", &p.DevCenterID) delete(rawMsg, key) case "devCenterUri": err = unpopulate(val, "DevCenterURI", &p.DevCenterURI) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "maxDevBoxesPerUser": err = unpopulate(val, "MaxDevBoxesPerUser", &p.MaxDevBoxesPerUser) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectUpdate. func (p ProjectUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", p.Identity) populate(objectMap, "location", p.Location) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectUpdate. func (p *ProjectUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ProjectUpdateProperties. func (p ProjectUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "catalogSettings", p.CatalogSettings) populate(objectMap, "description", p.Description) populate(objectMap, "devCenterId", p.DevCenterID) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "maxDevBoxesPerUser", p.MaxDevBoxesPerUser) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ProjectUpdateProperties. func (p *ProjectUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "catalogSettings": err = unpopulate(val, "CatalogSettings", &p.CatalogSettings) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) case "devCenterId": err = unpopulate(val, "DevCenterID", &p.DevCenterID) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "maxDevBoxesPerUser": err = unpopulate(val, "MaxDevBoxesPerUser", &p.MaxDevBoxesPerUser) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Properties. func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "devCenterUri", p.DevCenterURI) populate(objectMap, "displayName", p.DisplayName) populate(objectMap, "encryption", p.Encryption) populate(objectMap, "projectCatalogSettings", p.ProjectCatalogSettings) populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Properties. func (p *Properties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "devCenterUri": err = unpopulate(val, "DevCenterURI", &p.DevCenterURI) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &p.Encryption) delete(rawMsg, key) case "projectCatalogSettings": err = unpopulate(val, "ProjectCatalogSettings", &p.ProjectCatalogSettings) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type RecommendedMachineConfiguration. func (r RecommendedMachineConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "memory", r.Memory) populate(objectMap, "vCPUs", r.VCPUs) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedMachineConfiguration. func (r *RecommendedMachineConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "memory": err = unpopulate(val, "Memory", &r.Memory) delete(rawMsg, key) case "vCPUs": err = unpopulate(val, "VCPUs", &r.VCPUs) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ResourceRange. func (r ResourceRange) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "max", r.Max) populate(objectMap, "min", r.Min) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ResourceRange. func (r *ResourceRange) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "max": err = unpopulate(val, "Max", &r.Max) delete(rawMsg, key) case "min": err = unpopulate(val, "Min", &r.Min) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacity", s.Capacity) populate(objectMap, "family", s.Family) populate(objectMap, "name", s.Name) populate(objectMap, "size", s.Size) populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SKU. func (s *SKU) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "capacity": err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) case "family": err = unpopulate(val, "Family", &s.Family) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "size": err = unpopulate(val, "Size", &s.Size) delete(rawMsg, key) case "tier": err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SKUInfo. func (s SKUInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capabilities", s.Capabilities) populate(objectMap, "capacity", s.Capacity) populate(objectMap, "family", s.Family) populate(objectMap, "locations", s.Locations) populate(objectMap, "name", s.Name) populate(objectMap, "resourceType", s.ResourceType) populate(objectMap, "size", s.Size) populate(objectMap, "tier", s.Tier) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SKUInfo. func (s *SKUInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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 "capacity": err = unpopulate(val, "Capacity", &s.Capacity) delete(rawMsg, key) case "family": err = unpopulate(val, "Family", &s.Family) delete(rawMsg, key) case "locations": err = unpopulate(val, "Locations", &s.Locations) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "resourceType": err = unpopulate(val, "ResourceType", &s.ResourceType) delete(rawMsg, key) case "size": err = unpopulate(val, "Size", &s.Size) delete(rawMsg, key) case "tier": err = unpopulate(val, "Tier", &s.Tier) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SKUListResult. func (s SKUListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SKUListResult. func (s *SKUListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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": 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 Schedule. func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Schedule. func (s *Schedule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ScheduleListResult. func (s ScheduleListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleListResult. func (s *ScheduleListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %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": 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 ScheduleProperties. func (s ScheduleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "frequency", s.Frequency) populate(objectMap, "location", s.Location) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "state", s.State) populate(objectMap, "tags", s.Tags) populate(objectMap, "time", s.Time) populate(objectMap, "timeZone", s.TimeZone) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleProperties. func (s *ScheduleProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "frequency": err = unpopulate(val, "Frequency", &s.Frequency) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) case "time": err = unpopulate(val, "Time", &s.Time) delete(rawMsg, key) case "timeZone": err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ScheduleUpdate. func (s ScheduleUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleUpdate. func (s *ScheduleUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ScheduleUpdateProperties. func (s ScheduleUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "frequency", s.Frequency) populate(objectMap, "location", s.Location) populate(objectMap, "state", s.State) populate(objectMap, "tags", s.Tags) populate(objectMap, "time", s.Time) populate(objectMap, "timeZone", s.TimeZone) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleUpdateProperties. func (s *ScheduleUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "frequency": err = unpopulate(val, "Frequency", &s.Frequency) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &s.State) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) case "time": err = unpopulate(val, "Time", &s.Time) delete(rawMsg, key) case "timeZone": err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StopOnDisconnectConfiguration. func (s StopOnDisconnectConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "gracePeriodMinutes", s.GracePeriodMinutes) populate(objectMap, "status", s.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StopOnDisconnectConfiguration. func (s *StopOnDisconnectConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "gracePeriodMinutes": err = unpopulate(val, "GracePeriodMinutes", &s.GracePeriodMinutes) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SyncErrorDetails. func (s SyncErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "conflicts", s.Conflicts) populate(objectMap, "errors", s.Errors) populate(objectMap, "operationError", s.OperationError) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SyncErrorDetails. func (s *SyncErrorDetails) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "conflicts": err = unpopulate(val, "Conflicts", &s.Conflicts) delete(rawMsg, key) case "errors": err = unpopulate(val, "Errors", &s.Errors) delete(rawMsg, key) case "operationError": err = unpopulate(val, "OperationError", &s.OperationError) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SyncStats. func (s SyncStats) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "added", s.Added) populate(objectMap, "removed", s.Removed) populate(objectMap, "syncedCatalogItemTypes", s.SyncedCatalogItemTypes) populate(objectMap, "synchronizationErrors", s.SynchronizationErrors) populate(objectMap, "unchanged", s.Unchanged) populate(objectMap, "updated", s.Updated) populate(objectMap, "validationErrors", s.ValidationErrors) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SyncStats. func (s *SyncStats) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "added": err = unpopulate(val, "Added", &s.Added) delete(rawMsg, key) case "removed": err = unpopulate(val, "Removed", &s.Removed) delete(rawMsg, key) case "syncedCatalogItemTypes": err = unpopulate(val, "SyncedCatalogItemTypes", &s.SyncedCatalogItemTypes) delete(rawMsg, key) case "synchronizationErrors": err = unpopulate(val, "SynchronizationErrors", &s.SynchronizationErrors) delete(rawMsg, key) case "unchanged": err = unpopulate(val, "Unchanged", &s.Unchanged) delete(rawMsg, key) case "updated": err = unpopulate(val, "Updated", &s.Updated) delete(rawMsg, key) case "validationErrors": err = unpopulate(val, "ValidationErrors", &s.ValidationErrors) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Update. func (u Update) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", u.Identity) populate(objectMap, "location", u.Location) populate(objectMap, "properties", u.Properties) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Update. func (u *Update) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "identity": err = unpopulate(val, "Identity", &u.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &u.Location) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &u.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &u.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UpdateProperties. func (u UpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", u.DisplayName) populate(objectMap, "encryption", u.Encryption) populate(objectMap, "projectCatalogSettings", u.ProjectCatalogSettings) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UpdateProperties. func (u *UpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "displayName": err = unpopulate(val, "DisplayName", &u.DisplayName) delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &u.Encryption) delete(rawMsg, key) case "projectCatalogSettings": err = unpopulate(val, "ProjectCatalogSettings", &u.ProjectCatalogSettings) 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 Usage. func (u Usage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "currentValue", u.CurrentValue) populate(objectMap, "id", u.ID) populate(objectMap, "limit", u.Limit) populate(objectMap, "name", u.Name) populate(objectMap, "unit", u.Unit) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Usage. func (u *Usage) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "currentValue": err = unpopulate(val, "CurrentValue", &u.CurrentValue) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &u.ID) delete(rawMsg, key) case "limit": err = unpopulate(val, "Limit", &u.Limit) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &u.Name) delete(rawMsg, key) case "unit": err = unpopulate(val, "Unit", &u.Unit) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UsageName. func (u UsageName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "localizedValue", u.LocalizedValue) populate(objectMap, "value", u.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UsageName. func (u *UsageName) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "localizedValue": err = unpopulate(val, "LocalizedValue", &u.LocalizedValue) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &u.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "clientId": err = unpopulate(val, "ClientID", &u.ClientID) delete(rawMsg, key) case "principalId": err = unpopulate(val, "PrincipalID", &u.PrincipalID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UserRoleAssignmentValue. func (u UserRoleAssignmentValue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "roles", u.Roles) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UserRoleAssignmentValue. func (u *UserRoleAssignmentValue) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { case "roles": err = unpopulate(val, "Roles", &u.Roles) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil } else if !reflect.ValueOf(v).IsNil() { m[k] = v } } func populateAny(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { m[k] = nil } else { m[k] = v } } func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { return fmt.Errorf("struct field %s: %v", fn, err) } return nil }