sdk/resourcemanager/cognitiveservices/armcognitiveservices/models_serde.go (4,468 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 armcognitiveservices
import (
"encoding/json"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"reflect"
)
// MarshalJSON implements the json.Marshaller interface for type APIKeys.
func (a APIKeys) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "key1", a.Key1)
populate(objectMap, "key2", a.Key2)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeys.
func (a *APIKeys) UnmarshalJSON(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 "key1":
err = unpopulate(val, "Key1", &a.Key1)
delete(rawMsg, key)
case "key2":
err = unpopulate(val, "Key2", &a.Key2)
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 APIProperties.
func (a APIProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "aadClientId", a.AADClientID)
populate(objectMap, "aadTenantId", a.AADTenantID)
populate(objectMap, "eventHubConnectionString", a.EventHubConnectionString)
populate(objectMap, "qnaAzureSearchEndpointId", a.QnaAzureSearchEndpointID)
populate(objectMap, "qnaAzureSearchEndpointKey", a.QnaAzureSearchEndpointKey)
populate(objectMap, "qnaRuntimeEndpoint", a.QnaRuntimeEndpoint)
populate(objectMap, "statisticsEnabled", a.StatisticsEnabled)
populate(objectMap, "storageAccountConnectionString", a.StorageAccountConnectionString)
populate(objectMap, "superUser", a.SuperUser)
populate(objectMap, "websiteName", a.WebsiteName)
if a.AdditionalProperties != nil {
for key, val := range a.AdditionalProperties {
objectMap[key] = val
}
}
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type APIProperties.
func (a *APIProperties) UnmarshalJSON(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 "aadClientId":
err = unpopulate(val, "AADClientID", &a.AADClientID)
delete(rawMsg, key)
case "aadTenantId":
err = unpopulate(val, "AADTenantID", &a.AADTenantID)
delete(rawMsg, key)
case "eventHubConnectionString":
err = unpopulate(val, "EventHubConnectionString", &a.EventHubConnectionString)
delete(rawMsg, key)
case "qnaAzureSearchEndpointId":
err = unpopulate(val, "QnaAzureSearchEndpointID", &a.QnaAzureSearchEndpointID)
delete(rawMsg, key)
case "qnaAzureSearchEndpointKey":
err = unpopulate(val, "QnaAzureSearchEndpointKey", &a.QnaAzureSearchEndpointKey)
delete(rawMsg, key)
case "qnaRuntimeEndpoint":
err = unpopulate(val, "QnaRuntimeEndpoint", &a.QnaRuntimeEndpoint)
delete(rawMsg, key)
case "statisticsEnabled":
err = unpopulate(val, "StatisticsEnabled", &a.StatisticsEnabled)
delete(rawMsg, key)
case "storageAccountConnectionString":
err = unpopulate(val, "StorageAccountConnectionString", &a.StorageAccountConnectionString)
delete(rawMsg, key)
case "superUser":
err = unpopulate(val, "SuperUser", &a.SuperUser)
delete(rawMsg, key)
case "websiteName":
err = unpopulate(val, "WebsiteName", &a.WebsiteName)
delete(rawMsg, key)
default:
if a.AdditionalProperties == nil {
a.AdditionalProperties = map[string]any{}
}
if val != nil {
var aux any
err = json.Unmarshal(val, &aux)
a.AdditionalProperties[key] = aux
}
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AbusePenalty.
func (a AbusePenalty) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "action", a.Action)
populateDateTimeRFC3339(objectMap, "expiration", a.Expiration)
populate(objectMap, "rateLimitPercentage", a.RateLimitPercentage)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AbusePenalty.
func (a *AbusePenalty) UnmarshalJSON(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 "action":
err = unpopulate(val, "Action", &a.Action)
delete(rawMsg, key)
case "expiration":
err = unpopulateDateTimeRFC3339(val, "Expiration", &a.Expiration)
delete(rawMsg, key)
case "rateLimitPercentage":
err = unpopulate(val, "RateLimitPercentage", &a.RateLimitPercentage)
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 Account.
func (a Account) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", a.Etag)
populate(objectMap, "id", a.ID)
populate(objectMap, "identity", a.Identity)
populate(objectMap, "kind", a.Kind)
populate(objectMap, "location", a.Location)
populate(objectMap, "name", a.Name)
populate(objectMap, "properties", a.Properties)
populate(objectMap, "sku", a.SKU)
populate(objectMap, "systemData", a.SystemData)
populate(objectMap, "tags", a.Tags)
populate(objectMap, "type", a.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Account.
func (a *Account) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &a.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &a.ID)
delete(rawMsg, key)
case "identity":
err = unpopulate(val, "Identity", &a.Identity)
delete(rawMsg, key)
case "kind":
err = unpopulate(val, "Kind", &a.Kind)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &a.Location)
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 "sku":
err = unpopulate(val, "SKU", &a.SKU)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &a.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &a.Tags)
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 AccountListResult.
func (a AccountListResult) 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 AccountListResult.
func (a *AccountListResult) UnmarshalJSON(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 AccountModel.
func (a AccountModel) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseModel", a.BaseModel)
populate(objectMap, "callRateLimit", a.CallRateLimit)
populate(objectMap, "capabilities", a.Capabilities)
populate(objectMap, "deprecation", a.Deprecation)
populate(objectMap, "finetuneCapabilities", a.FinetuneCapabilities)
populate(objectMap, "format", a.Format)
populate(objectMap, "isDefaultVersion", a.IsDefaultVersion)
populate(objectMap, "lifecycleStatus", a.LifecycleStatus)
populate(objectMap, "maxCapacity", a.MaxCapacity)
populate(objectMap, "name", a.Name)
populate(objectMap, "publisher", a.Publisher)
populate(objectMap, "skus", a.SKUs)
populate(objectMap, "source", a.Source)
populate(objectMap, "sourceAccount", a.SourceAccount)
populate(objectMap, "systemData", a.SystemData)
populate(objectMap, "version", a.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountModel.
func (a *AccountModel) UnmarshalJSON(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 "baseModel":
err = unpopulate(val, "BaseModel", &a.BaseModel)
delete(rawMsg, key)
case "callRateLimit":
err = unpopulate(val, "CallRateLimit", &a.CallRateLimit)
delete(rawMsg, key)
case "capabilities":
err = unpopulate(val, "Capabilities", &a.Capabilities)
delete(rawMsg, key)
case "deprecation":
err = unpopulate(val, "Deprecation", &a.Deprecation)
delete(rawMsg, key)
case "finetuneCapabilities":
err = unpopulate(val, "FinetuneCapabilities", &a.FinetuneCapabilities)
delete(rawMsg, key)
case "format":
err = unpopulate(val, "Format", &a.Format)
delete(rawMsg, key)
case "isDefaultVersion":
err = unpopulate(val, "IsDefaultVersion", &a.IsDefaultVersion)
delete(rawMsg, key)
case "lifecycleStatus":
err = unpopulate(val, "LifecycleStatus", &a.LifecycleStatus)
delete(rawMsg, key)
case "maxCapacity":
err = unpopulate(val, "MaxCapacity", &a.MaxCapacity)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "publisher":
err = unpopulate(val, "Publisher", &a.Publisher)
delete(rawMsg, key)
case "skus":
err = unpopulate(val, "SKUs", &a.SKUs)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &a.Source)
delete(rawMsg, key)
case "sourceAccount":
err = unpopulate(val, "SourceAccount", &a.SourceAccount)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &a.SystemData)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &a.Version)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AccountModelListResult.
func (a AccountModelListResult) 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 AccountModelListResult.
func (a *AccountModelListResult) UnmarshalJSON(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 AccountProperties.
func (a AccountProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "apiProperties", a.APIProperties)
populate(objectMap, "abusePenalty", a.AbusePenalty)
populate(objectMap, "allowedFqdnList", a.AllowedFqdnList)
populate(objectMap, "amlWorkspace", a.AmlWorkspace)
populate(objectMap, "callRateLimit", a.CallRateLimit)
populate(objectMap, "capabilities", a.Capabilities)
populate(objectMap, "commitmentPlanAssociations", a.CommitmentPlanAssociations)
populate(objectMap, "customSubDomainName", a.CustomSubDomainName)
populate(objectMap, "dateCreated", a.DateCreated)
populate(objectMap, "deletionDate", a.DeletionDate)
populate(objectMap, "disableLocalAuth", a.DisableLocalAuth)
populate(objectMap, "dynamicThrottlingEnabled", a.DynamicThrottlingEnabled)
populate(objectMap, "encryption", a.Encryption)
populate(objectMap, "endpoint", a.Endpoint)
populate(objectMap, "endpoints", a.Endpoints)
populate(objectMap, "internalId", a.InternalID)
populate(objectMap, "isMigrated", a.IsMigrated)
populate(objectMap, "locations", a.Locations)
populate(objectMap, "migrationToken", a.MigrationToken)
populate(objectMap, "networkAcls", a.NetworkACLs)
populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections)
populate(objectMap, "provisioningState", a.ProvisioningState)
populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess)
populate(objectMap, "quotaLimit", a.QuotaLimit)
populate(objectMap, "raiMonitorConfig", a.RaiMonitorConfig)
populate(objectMap, "restore", a.Restore)
populate(objectMap, "restrictOutboundNetworkAccess", a.RestrictOutboundNetworkAccess)
populate(objectMap, "skuChangeInfo", a.SKUChangeInfo)
populate(objectMap, "scheduledPurgeDate", a.ScheduledPurgeDate)
populate(objectMap, "userOwnedStorage", a.UserOwnedStorage)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountProperties.
func (a *AccountProperties) UnmarshalJSON(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 "apiProperties":
err = unpopulate(val, "APIProperties", &a.APIProperties)
delete(rawMsg, key)
case "abusePenalty":
err = unpopulate(val, "AbusePenalty", &a.AbusePenalty)
delete(rawMsg, key)
case "allowedFqdnList":
err = unpopulate(val, "AllowedFqdnList", &a.AllowedFqdnList)
delete(rawMsg, key)
case "amlWorkspace":
err = unpopulate(val, "AmlWorkspace", &a.AmlWorkspace)
delete(rawMsg, key)
case "callRateLimit":
err = unpopulate(val, "CallRateLimit", &a.CallRateLimit)
delete(rawMsg, key)
case "capabilities":
err = unpopulate(val, "Capabilities", &a.Capabilities)
delete(rawMsg, key)
case "commitmentPlanAssociations":
err = unpopulate(val, "CommitmentPlanAssociations", &a.CommitmentPlanAssociations)
delete(rawMsg, key)
case "customSubDomainName":
err = unpopulate(val, "CustomSubDomainName", &a.CustomSubDomainName)
delete(rawMsg, key)
case "dateCreated":
err = unpopulate(val, "DateCreated", &a.DateCreated)
delete(rawMsg, key)
case "deletionDate":
err = unpopulate(val, "DeletionDate", &a.DeletionDate)
delete(rawMsg, key)
case "disableLocalAuth":
err = unpopulate(val, "DisableLocalAuth", &a.DisableLocalAuth)
delete(rawMsg, key)
case "dynamicThrottlingEnabled":
err = unpopulate(val, "DynamicThrottlingEnabled", &a.DynamicThrottlingEnabled)
delete(rawMsg, key)
case "encryption":
err = unpopulate(val, "Encryption", &a.Encryption)
delete(rawMsg, key)
case "endpoint":
err = unpopulate(val, "Endpoint", &a.Endpoint)
delete(rawMsg, key)
case "endpoints":
err = unpopulate(val, "Endpoints", &a.Endpoints)
delete(rawMsg, key)
case "internalId":
err = unpopulate(val, "InternalID", &a.InternalID)
delete(rawMsg, key)
case "isMigrated":
err = unpopulate(val, "IsMigrated", &a.IsMigrated)
delete(rawMsg, key)
case "locations":
err = unpopulate(val, "Locations", &a.Locations)
delete(rawMsg, key)
case "migrationToken":
err = unpopulate(val, "MigrationToken", &a.MigrationToken)
delete(rawMsg, key)
case "networkAcls":
err = unpopulate(val, "NetworkACLs", &a.NetworkACLs)
delete(rawMsg, key)
case "privateEndpointConnections":
err = unpopulate(val, "PrivateEndpointConnections", &a.PrivateEndpointConnections)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
delete(rawMsg, key)
case "publicNetworkAccess":
err = unpopulate(val, "PublicNetworkAccess", &a.PublicNetworkAccess)
delete(rawMsg, key)
case "quotaLimit":
err = unpopulate(val, "QuotaLimit", &a.QuotaLimit)
delete(rawMsg, key)
case "raiMonitorConfig":
err = unpopulate(val, "RaiMonitorConfig", &a.RaiMonitorConfig)
delete(rawMsg, key)
case "restore":
err = unpopulate(val, "Restore", &a.Restore)
delete(rawMsg, key)
case "restrictOutboundNetworkAccess":
err = unpopulate(val, "RestrictOutboundNetworkAccess", &a.RestrictOutboundNetworkAccess)
delete(rawMsg, key)
case "skuChangeInfo":
err = unpopulate(val, "SKUChangeInfo", &a.SKUChangeInfo)
delete(rawMsg, key)
case "scheduledPurgeDate":
err = unpopulate(val, "ScheduledPurgeDate", &a.ScheduledPurgeDate)
delete(rawMsg, key)
case "userOwnedStorage":
err = unpopulate(val, "UserOwnedStorage", &a.UserOwnedStorage)
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 AccountSKU.
func (a AccountSKU) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "resourceType", a.ResourceType)
populate(objectMap, "sku", a.SKU)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKU.
func (a *AccountSKU) UnmarshalJSON(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 "resourceType":
err = unpopulate(val, "ResourceType", &a.ResourceType)
delete(rawMsg, key)
case "sku":
err = unpopulate(val, "SKU", &a.SKU)
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 AccountSKUListResult.
func (a AccountSKUListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", a.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AccountSKUListResult.
func (a *AccountSKUListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "value":
err = unpopulate(val, "Value", &a.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AzureEntityResource.
func (a AzureEntityResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", a.Etag)
populate(objectMap, "id", a.ID)
populate(objectMap, "name", a.Name)
populate(objectMap, "type", a.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AzureEntityResource.
func (a *AzureEntityResource) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &a.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &a.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &a.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type BillingMeterInfo.
func (b BillingMeterInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "meterId", b.MeterID)
populate(objectMap, "name", b.Name)
populate(objectMap, "unit", b.Unit)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type BillingMeterInfo.
func (b *BillingMeterInfo) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", b, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "meterId":
err = unpopulate(val, "MeterID", &b.MeterID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &b.Name)
delete(rawMsg, key)
case "unit":
err = unpopulate(val, "Unit", &b.Unit)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", b, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type CalculateModelCapacityParameter.
func (c CalculateModelCapacityParameter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "model", c.Model)
populate(objectMap, "skuName", c.SKUName)
populate(objectMap, "workloads", c.Workloads)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CalculateModelCapacityParameter.
func (c *CalculateModelCapacityParameter) UnmarshalJSON(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 "model":
err = unpopulate(val, "Model", &c.Model)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &c.SKUName)
delete(rawMsg, key)
case "workloads":
err = unpopulate(val, "Workloads", &c.Workloads)
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 CalculateModelCapacityResult.
func (c CalculateModelCapacityResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "estimatedCapacity", c.EstimatedCapacity)
populate(objectMap, "model", c.Model)
populate(objectMap, "skuName", c.SKUName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CalculateModelCapacityResult.
func (c *CalculateModelCapacityResult) UnmarshalJSON(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 "estimatedCapacity":
err = unpopulate(val, "EstimatedCapacity", &c.EstimatedCapacity)
delete(rawMsg, key)
case "model":
err = unpopulate(val, "Model", &c.Model)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &c.SKUName)
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 CalculateModelCapacityResultEstimatedCapacity.
func (c CalculateModelCapacityResultEstimatedCapacity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "deployableValue", c.DeployableValue)
populate(objectMap, "value", c.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CalculateModelCapacityResultEstimatedCapacity.
func (c *CalculateModelCapacityResultEstimatedCapacity) UnmarshalJSON(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 "deployableValue":
err = unpopulate(val, "DeployableValue", &c.DeployableValue)
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 CallRateLimit.
func (c CallRateLimit) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", c.Count)
populate(objectMap, "renewalPeriod", c.RenewalPeriod)
populate(objectMap, "rules", c.Rules)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CallRateLimit.
func (c *CallRateLimit) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", c, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "count":
err = unpopulate(val, "Count", &c.Count)
delete(rawMsg, key)
case "renewalPeriod":
err = unpopulate(val, "RenewalPeriod", &c.RenewalPeriod)
delete(rawMsg, key)
case "rules":
err = unpopulate(val, "Rules", &c.Rules)
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 CapacityConfig.
func (c CapacityConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "allowedValues", c.AllowedValues)
populate(objectMap, "default", c.Default)
populate(objectMap, "maximum", c.Maximum)
populate(objectMap, "minimum", c.Minimum)
populate(objectMap, "step", c.Step)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CapacityConfig.
func (c *CapacityConfig) UnmarshalJSON(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 "allowedValues":
err = unpopulate(val, "AllowedValues", &c.AllowedValues)
delete(rawMsg, key)
case "default":
err = unpopulate(val, "Default", &c.Default)
delete(rawMsg, key)
case "maximum":
err = unpopulate(val, "Maximum", &c.Maximum)
delete(rawMsg, key)
case "minimum":
err = unpopulate(val, "Minimum", &c.Minimum)
delete(rawMsg, key)
case "step":
err = unpopulate(val, "Step", &c.Step)
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 CheckDomainAvailabilityParameter.
func (c CheckDomainAvailabilityParameter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "kind", c.Kind)
populate(objectMap, "subdomainName", c.SubdomainName)
populate(objectMap, "type", c.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CheckDomainAvailabilityParameter.
func (c *CheckDomainAvailabilityParameter) UnmarshalJSON(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 "kind":
err = unpopulate(val, "Kind", &c.Kind)
delete(rawMsg, key)
case "subdomainName":
err = unpopulate(val, "SubdomainName", &c.SubdomainName)
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 CheckSKUAvailabilityParameter.
func (c CheckSKUAvailabilityParameter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "kind", c.Kind)
populate(objectMap, "skus", c.SKUs)
populate(objectMap, "type", c.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CheckSKUAvailabilityParameter.
func (c *CheckSKUAvailabilityParameter) UnmarshalJSON(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 "kind":
err = unpopulate(val, "Kind", &c.Kind)
delete(rawMsg, key)
case "skus":
err = unpopulate(val, "SKUs", &c.SKUs)
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 CommitmentCost.
func (c CommitmentCost) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "commitmentMeterId", c.CommitmentMeterID)
populate(objectMap, "overageMeterId", c.OverageMeterID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentCost.
func (c *CommitmentCost) UnmarshalJSON(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 "commitmentMeterId":
err = unpopulate(val, "CommitmentMeterID", &c.CommitmentMeterID)
delete(rawMsg, key)
case "overageMeterId":
err = unpopulate(val, "OverageMeterID", &c.OverageMeterID)
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 CommitmentPeriod.
func (c CommitmentPeriod) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", c.Count)
populate(objectMap, "endDate", c.EndDate)
populate(objectMap, "quota", c.Quota)
populate(objectMap, "startDate", c.StartDate)
populate(objectMap, "tier", c.Tier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPeriod.
func (c *CommitmentPeriod) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", c, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "count":
err = unpopulate(val, "Count", &c.Count)
delete(rawMsg, key)
case "endDate":
err = unpopulate(val, "EndDate", &c.EndDate)
delete(rawMsg, key)
case "quota":
err = unpopulate(val, "Quota", &c.Quota)
delete(rawMsg, key)
case "startDate":
err = unpopulate(val, "StartDate", &c.StartDate)
delete(rawMsg, key)
case "tier":
err = unpopulate(val, "Tier", &c.Tier)
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 CommitmentPlan.
func (c CommitmentPlan) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", c.Etag)
populate(objectMap, "id", c.ID)
populate(objectMap, "kind", c.Kind)
populate(objectMap, "location", c.Location)
populate(objectMap, "name", c.Name)
populate(objectMap, "properties", c.Properties)
populate(objectMap, "sku", c.SKU)
populate(objectMap, "systemData", c.SystemData)
populate(objectMap, "tags", c.Tags)
populate(objectMap, "type", c.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlan.
func (c *CommitmentPlan) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &c.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &c.ID)
delete(rawMsg, key)
case "kind":
err = unpopulate(val, "Kind", &c.Kind)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &c.Location)
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 "sku":
err = unpopulate(val, "SKU", &c.SKU)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &c.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &c.Tags)
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 CommitmentPlanAccountAssociation.
func (c CommitmentPlanAccountAssociation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", c.Etag)
populate(objectMap, "id", c.ID)
populate(objectMap, "name", c.Name)
populate(objectMap, "properties", c.Properties)
populate(objectMap, "systemData", c.SystemData)
populate(objectMap, "tags", c.Tags)
populate(objectMap, "type", c.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAccountAssociation.
func (c *CommitmentPlanAccountAssociation) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &c.Etag)
delete(rawMsg, 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 "tags":
err = unpopulate(val, "Tags", &c.Tags)
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 CommitmentPlanAccountAssociationListResult.
func (c CommitmentPlanAccountAssociationListResult) 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 CommitmentPlanAccountAssociationListResult.
func (c *CommitmentPlanAccountAssociationListResult) UnmarshalJSON(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 CommitmentPlanAccountAssociationProperties.
func (c CommitmentPlanAccountAssociationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "accountId", c.AccountID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAccountAssociationProperties.
func (c *CommitmentPlanAccountAssociationProperties) UnmarshalJSON(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 "accountId":
err = unpopulate(val, "AccountID", &c.AccountID)
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 CommitmentPlanAssociation.
func (c CommitmentPlanAssociation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "commitmentPlanId", c.CommitmentPlanID)
populate(objectMap, "commitmentPlanLocation", c.CommitmentPlanLocation)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanAssociation.
func (c *CommitmentPlanAssociation) UnmarshalJSON(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 "commitmentPlanId":
err = unpopulate(val, "CommitmentPlanID", &c.CommitmentPlanID)
delete(rawMsg, key)
case "commitmentPlanLocation":
err = unpopulate(val, "CommitmentPlanLocation", &c.CommitmentPlanLocation)
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 CommitmentPlanListResult.
func (c CommitmentPlanListResult) 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 CommitmentPlanListResult.
func (c *CommitmentPlanListResult) UnmarshalJSON(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 CommitmentPlanProperties.
func (c CommitmentPlanProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "autoRenew", c.AutoRenew)
populate(objectMap, "commitmentPlanGuid", c.CommitmentPlanGUID)
populate(objectMap, "current", c.Current)
populate(objectMap, "hostingModel", c.HostingModel)
populate(objectMap, "last", c.Last)
populate(objectMap, "next", c.Next)
populate(objectMap, "planType", c.PlanType)
populate(objectMap, "provisioningIssues", c.ProvisioningIssues)
populate(objectMap, "provisioningState", c.ProvisioningState)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentPlanProperties.
func (c *CommitmentPlanProperties) UnmarshalJSON(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 "autoRenew":
err = unpopulate(val, "AutoRenew", &c.AutoRenew)
delete(rawMsg, key)
case "commitmentPlanGuid":
err = unpopulate(val, "CommitmentPlanGUID", &c.CommitmentPlanGUID)
delete(rawMsg, key)
case "current":
err = unpopulate(val, "Current", &c.Current)
delete(rawMsg, key)
case "hostingModel":
err = unpopulate(val, "HostingModel", &c.HostingModel)
delete(rawMsg, key)
case "last":
err = unpopulate(val, "Last", &c.Last)
delete(rawMsg, key)
case "next":
err = unpopulate(val, "Next", &c.Next)
delete(rawMsg, key)
case "planType":
err = unpopulate(val, "PlanType", &c.PlanType)
delete(rawMsg, key)
case "provisioningIssues":
err = unpopulate(val, "ProvisioningIssues", &c.ProvisioningIssues)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
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 CommitmentQuota.
func (c CommitmentQuota) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "quantity", c.Quantity)
populate(objectMap, "unit", c.Unit)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentQuota.
func (c *CommitmentQuota) UnmarshalJSON(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 "quantity":
err = unpopulate(val, "Quantity", &c.Quantity)
delete(rawMsg, key)
case "unit":
err = unpopulate(val, "Unit", &c.Unit)
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 CommitmentTier.
func (c CommitmentTier) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "cost", c.Cost)
populate(objectMap, "hostingModel", c.HostingModel)
populate(objectMap, "kind", c.Kind)
populate(objectMap, "maxCount", c.MaxCount)
populate(objectMap, "planType", c.PlanType)
populate(objectMap, "quota", c.Quota)
populate(objectMap, "skuName", c.SKUName)
populate(objectMap, "tier", c.Tier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CommitmentTier.
func (c *CommitmentTier) UnmarshalJSON(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 "cost":
err = unpopulate(val, "Cost", &c.Cost)
delete(rawMsg, key)
case "hostingModel":
err = unpopulate(val, "HostingModel", &c.HostingModel)
delete(rawMsg, key)
case "kind":
err = unpopulate(val, "Kind", &c.Kind)
delete(rawMsg, key)
case "maxCount":
err = unpopulate(val, "MaxCount", &c.MaxCount)
delete(rawMsg, key)
case "planType":
err = unpopulate(val, "PlanType", &c.PlanType)
delete(rawMsg, key)
case "quota":
err = unpopulate(val, "Quota", &c.Quota)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &c.SKUName)
delete(rawMsg, key)
case "tier":
err = unpopulate(val, "Tier", &c.Tier)
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 CommitmentTierListResult.
func (c CommitmentTierListResult) 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 CommitmentTierListResult.
func (c *CommitmentTierListResult) UnmarshalJSON(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 CustomBlocklistConfig.
func (c CustomBlocklistConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "blocking", c.Blocking)
populate(objectMap, "blocklistName", c.BlocklistName)
populate(objectMap, "source", c.Source)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CustomBlocklistConfig.
func (c *CustomBlocklistConfig) UnmarshalJSON(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 "blocking":
err = unpopulate(val, "Blocking", &c.Blocking)
delete(rawMsg, key)
case "blocklistName":
err = unpopulate(val, "BlocklistName", &c.BlocklistName)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &c.Source)
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 DefenderForAISetting.
func (d DefenderForAISetting) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", d.Etag)
populate(objectMap, "id", d.ID)
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 DefenderForAISetting.
func (d *DefenderForAISetting) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", d, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "etag":
err = unpopulate(val, "Etag", &d.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &d.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &d.Name)
delete(rawMsg, key)
case "properties":
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 DefenderForAISettingProperties.
func (d DefenderForAISettingProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "state", d.State)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForAISettingProperties.
func (d *DefenderForAISettingProperties) UnmarshalJSON(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 "state":
err = unpopulate(val, "State", &d.State)
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 DefenderForAISettingResult.
func (d DefenderForAISettingResult) 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 DefenderForAISettingResult.
func (d *DefenderForAISettingResult) UnmarshalJSON(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 Deployment.
func (d Deployment) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", d.Etag)
populate(objectMap, "id", d.ID)
populate(objectMap, "name", d.Name)
populate(objectMap, "properties", d.Properties)
populate(objectMap, "sku", d.SKU)
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 Deployment.
func (d *Deployment) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", d, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "etag":
err = unpopulate(val, "Etag", &d.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &d.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &d.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &d.Properties)
delete(rawMsg, key)
case "sku":
err = unpopulate(val, "SKU", &d.SKU)
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 DeploymentCapacitySettings.
func (d DeploymentCapacitySettings) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "designatedCapacity", d.DesignatedCapacity)
populate(objectMap, "priority", d.Priority)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentCapacitySettings.
func (d *DeploymentCapacitySettings) UnmarshalJSON(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 "designatedCapacity":
err = unpopulate(val, "DesignatedCapacity", &d.DesignatedCapacity)
delete(rawMsg, key)
case "priority":
err = unpopulate(val, "Priority", &d.Priority)
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 DeploymentListResult.
func (d DeploymentListResult) 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 DeploymentListResult.
func (d *DeploymentListResult) UnmarshalJSON(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 DeploymentModel.
func (d DeploymentModel) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "callRateLimit", d.CallRateLimit)
populate(objectMap, "format", d.Format)
populate(objectMap, "name", d.Name)
populate(objectMap, "publisher", d.Publisher)
populate(objectMap, "source", d.Source)
populate(objectMap, "sourceAccount", d.SourceAccount)
populate(objectMap, "version", d.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentModel.
func (d *DeploymentModel) UnmarshalJSON(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 "callRateLimit":
err = unpopulate(val, "CallRateLimit", &d.CallRateLimit)
delete(rawMsg, key)
case "format":
err = unpopulate(val, "Format", &d.Format)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &d.Name)
delete(rawMsg, key)
case "publisher":
err = unpopulate(val, "Publisher", &d.Publisher)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &d.Source)
delete(rawMsg, key)
case "sourceAccount":
err = unpopulate(val, "SourceAccount", &d.SourceAccount)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &d.Version)
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 DeploymentProperties.
func (d DeploymentProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "callRateLimit", d.CallRateLimit)
populate(objectMap, "capabilities", d.Capabilities)
populate(objectMap, "capacitySettings", d.CapacitySettings)
populate(objectMap, "currentCapacity", d.CurrentCapacity)
populate(objectMap, "dynamicThrottlingEnabled", d.DynamicThrottlingEnabled)
populate(objectMap, "model", d.Model)
populate(objectMap, "parentDeploymentName", d.ParentDeploymentName)
populate(objectMap, "provisioningState", d.ProvisioningState)
populate(objectMap, "raiPolicyName", d.RaiPolicyName)
populate(objectMap, "rateLimits", d.RateLimits)
populate(objectMap, "scaleSettings", d.ScaleSettings)
populate(objectMap, "versionUpgradeOption", d.VersionUpgradeOption)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.
func (d *DeploymentProperties) UnmarshalJSON(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 "callRateLimit":
err = unpopulate(val, "CallRateLimit", &d.CallRateLimit)
delete(rawMsg, key)
case "capabilities":
err = unpopulate(val, "Capabilities", &d.Capabilities)
delete(rawMsg, key)
case "capacitySettings":
err = unpopulate(val, "CapacitySettings", &d.CapacitySettings)
delete(rawMsg, key)
case "currentCapacity":
err = unpopulate(val, "CurrentCapacity", &d.CurrentCapacity)
delete(rawMsg, key)
case "dynamicThrottlingEnabled":
err = unpopulate(val, "DynamicThrottlingEnabled", &d.DynamicThrottlingEnabled)
delete(rawMsg, key)
case "model":
err = unpopulate(val, "Model", &d.Model)
delete(rawMsg, key)
case "parentDeploymentName":
err = unpopulate(val, "ParentDeploymentName", &d.ParentDeploymentName)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &d.ProvisioningState)
delete(rawMsg, key)
case "raiPolicyName":
err = unpopulate(val, "RaiPolicyName", &d.RaiPolicyName)
delete(rawMsg, key)
case "rateLimits":
err = unpopulate(val, "RateLimits", &d.RateLimits)
delete(rawMsg, key)
case "scaleSettings":
err = unpopulate(val, "ScaleSettings", &d.ScaleSettings)
delete(rawMsg, key)
case "versionUpgradeOption":
err = unpopulate(val, "VersionUpgradeOption", &d.VersionUpgradeOption)
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 DeploymentSKUListResult.
func (d DeploymentSKUListResult) 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 DeploymentSKUListResult.
func (d *DeploymentSKUListResult) UnmarshalJSON(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 DeploymentScaleSettings.
func (d DeploymentScaleSettings) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "activeCapacity", d.ActiveCapacity)
populate(objectMap, "capacity", d.Capacity)
populate(objectMap, "scaleType", d.ScaleType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentScaleSettings.
func (d *DeploymentScaleSettings) UnmarshalJSON(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 "activeCapacity":
err = unpopulate(val, "ActiveCapacity", &d.ActiveCapacity)
delete(rawMsg, key)
case "capacity":
err = unpopulate(val, "Capacity", &d.Capacity)
delete(rawMsg, key)
case "scaleType":
err = unpopulate(val, "ScaleType", &d.ScaleType)
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 DomainAvailability.
func (d DomainAvailability) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isSubdomainAvailable", d.IsSubdomainAvailable)
populate(objectMap, "kind", d.Kind)
populate(objectMap, "reason", d.Reason)
populate(objectMap, "subdomainName", d.SubdomainName)
populate(objectMap, "type", d.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DomainAvailability.
func (d *DomainAvailability) UnmarshalJSON(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 "isSubdomainAvailable":
err = unpopulate(val, "IsSubdomainAvailable", &d.IsSubdomainAvailable)
delete(rawMsg, key)
case "kind":
err = unpopulate(val, "Kind", &d.Kind)
delete(rawMsg, key)
case "reason":
err = unpopulate(val, "Reason", &d.Reason)
delete(rawMsg, key)
case "subdomainName":
err = unpopulate(val, "SubdomainName", &d.SubdomainName)
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, "keySource", e.KeySource)
populate(objectMap, "keyVaultProperties", e.KeyVaultProperties)
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 "keySource":
err = unpopulate(val, "KeySource", &e.KeySource)
delete(rawMsg, key)
case "keyVaultProperties":
err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
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 EncryptionScope.
func (e EncryptionScope) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", e.Etag)
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 EncryptionScope.
func (e *EncryptionScope) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &e.Etag)
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 "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 EncryptionScopeListResult.
func (e EncryptionScopeListResult) 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 EncryptionScopeListResult.
func (e *EncryptionScopeListResult) UnmarshalJSON(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 EncryptionScopeProperties.
func (e EncryptionScopeProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "keySource", e.KeySource)
populate(objectMap, "keyVaultProperties", e.KeyVaultProperties)
populate(objectMap, "provisioningState", e.ProvisioningState)
populate(objectMap, "state", e.State)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionScopeProperties.
func (e *EncryptionScopeProperties) UnmarshalJSON(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 "keySource":
err = unpopulate(val, "KeySource", &e.KeySource)
delete(rawMsg, key)
case "keyVaultProperties":
err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &e.ProvisioningState)
delete(rawMsg, key)
case "state":
err = unpopulate(val, "State", &e.State)
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 ErrorResponse.
func (e ErrorResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "error", e.Error)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
func (e *ErrorResponse) UnmarshalJSON(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 "error":
err = unpopulate(val, "Error", &e.Error)
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 IPRule.
func (i IPRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", i.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.
func (i *IPRule) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "value":
err = unpopulate(val, "Value", &i.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Identity.
func (i Identity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "principalId", i.PrincipalID)
populate(objectMap, "tenantId", i.TenantID)
populate(objectMap, "type", i.Type)
populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Identity.
func (i *Identity) UnmarshalJSON(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 "principalId":
err = unpopulate(val, "PrincipalID", &i.PrincipalID)
delete(rawMsg, key)
case "tenantId":
err = unpopulate(val, "TenantID", &i.TenantID)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &i.Type)
delete(rawMsg, key)
case "userAssignedIdentities":
err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities)
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 KeyVaultProperties.
func (k KeyVaultProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identityClientId", k.IdentityClientID)
populate(objectMap, "keyName", k.KeyName)
populate(objectMap, "keyVaultUri", k.KeyVaultURI)
populate(objectMap, "keyVersion", k.KeyVersion)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties.
func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", k, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "identityClientId":
err = unpopulate(val, "IdentityClientID", &k.IdentityClientID)
delete(rawMsg, key)
case "keyName":
err = unpopulate(val, "KeyName", &k.KeyName)
delete(rawMsg, key)
case "keyVaultUri":
err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI)
delete(rawMsg, key)
case "keyVersion":
err = unpopulate(val, "KeyVersion", &k.KeyVersion)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", k, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type MetricName.
func (m MetricName) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "localizedValue", m.LocalizedValue)
populate(objectMap, "value", m.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type MetricName.
func (m *MetricName) UnmarshalJSON(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 "localizedValue":
err = unpopulate(val, "LocalizedValue", &m.LocalizedValue)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &m.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Model.
func (m Model) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "description", m.Description)
populate(objectMap, "kind", m.Kind)
populate(objectMap, "model", m.Model)
populate(objectMap, "skuName", m.SKUName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Model.
func (m *Model) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "description":
err = unpopulate(val, "Description", &m.Description)
delete(rawMsg, key)
case "kind":
err = unpopulate(val, "Kind", &m.Kind)
delete(rawMsg, key)
case "model":
err = unpopulate(val, "Model", &m.Model)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &m.SKUName)
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 ModelCapacityCalculatorWorkload.
func (m ModelCapacityCalculatorWorkload) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "requestParameters", m.RequestParameters)
populate(objectMap, "requestPerMinute", m.RequestPerMinute)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelCapacityCalculatorWorkload.
func (m *ModelCapacityCalculatorWorkload) UnmarshalJSON(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 "requestParameters":
err = unpopulate(val, "RequestParameters", &m.RequestParameters)
delete(rawMsg, key)
case "requestPerMinute":
err = unpopulate(val, "RequestPerMinute", &m.RequestPerMinute)
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 ModelCapacityCalculatorWorkloadRequestParam.
func (m ModelCapacityCalculatorWorkloadRequestParam) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "avgGeneratedTokens", m.AvgGeneratedTokens)
populate(objectMap, "avgPromptTokens", m.AvgPromptTokens)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelCapacityCalculatorWorkloadRequestParam.
func (m *ModelCapacityCalculatorWorkloadRequestParam) UnmarshalJSON(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 "avgGeneratedTokens":
err = unpopulate(val, "AvgGeneratedTokens", &m.AvgGeneratedTokens)
delete(rawMsg, key)
case "avgPromptTokens":
err = unpopulate(val, "AvgPromptTokens", &m.AvgPromptTokens)
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 ModelCapacityListResult.
func (m ModelCapacityListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", m.NextLink)
populate(objectMap, "value", m.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelCapacityListResult.
func (m *ModelCapacityListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &m.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &m.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ModelCapacityListResultValueItem.
func (m ModelCapacityListResultValueItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", m.ID)
populate(objectMap, "location", m.Location)
populate(objectMap, "name", m.Name)
populate(objectMap, "properties", m.Properties)
populate(objectMap, "type", m.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelCapacityListResultValueItem.
func (m *ModelCapacityListResultValueItem) UnmarshalJSON(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 "id":
err = unpopulate(val, "ID", &m.ID)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &m.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &m.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &m.Properties)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &m.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ModelDeprecationInfo.
func (m ModelDeprecationInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "fineTune", m.FineTune)
populate(objectMap, "inference", m.Inference)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelDeprecationInfo.
func (m *ModelDeprecationInfo) UnmarshalJSON(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 "fineTune":
err = unpopulate(val, "FineTune", &m.FineTune)
delete(rawMsg, key)
case "inference":
err = unpopulate(val, "Inference", &m.Inference)
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 ModelListResult.
func (m ModelListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", m.NextLink)
populate(objectMap, "value", m.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelListResult.
func (m *ModelListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &m.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &m.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", m, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ModelSKU.
func (m ModelSKU) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "capacity", m.Capacity)
populate(objectMap, "cost", m.Cost)
populateDateTimeRFC3339(objectMap, "deprecationDate", m.DeprecationDate)
populate(objectMap, "name", m.Name)
populate(objectMap, "rateLimits", m.RateLimits)
populate(objectMap, "usageName", m.UsageName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelSKU.
func (m *ModelSKU) UnmarshalJSON(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 "capacity":
err = unpopulate(val, "Capacity", &m.Capacity)
delete(rawMsg, key)
case "cost":
err = unpopulate(val, "Cost", &m.Cost)
delete(rawMsg, key)
case "deprecationDate":
err = unpopulateDateTimeRFC3339(val, "DeprecationDate", &m.DeprecationDate)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &m.Name)
delete(rawMsg, key)
case "rateLimits":
err = unpopulate(val, "RateLimits", &m.RateLimits)
delete(rawMsg, key)
case "usageName":
err = unpopulate(val, "UsageName", &m.UsageName)
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 ModelSKUCapacityProperties.
func (m ModelSKUCapacityProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "availableCapacity", m.AvailableCapacity)
populate(objectMap, "availableFinetuneCapacity", m.AvailableFinetuneCapacity)
populate(objectMap, "model", m.Model)
populate(objectMap, "skuName", m.SKUName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ModelSKUCapacityProperties.
func (m *ModelSKUCapacityProperties) UnmarshalJSON(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 "availableCapacity":
err = unpopulate(val, "AvailableCapacity", &m.AvailableCapacity)
delete(rawMsg, key)
case "availableFinetuneCapacity":
err = unpopulate(val, "AvailableFinetuneCapacity", &m.AvailableFinetuneCapacity)
delete(rawMsg, key)
case "model":
err = unpopulate(val, "Model", &m.Model)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &m.SKUName)
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 MultiRegionSettings.
func (m MultiRegionSettings) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "regions", m.Regions)
populate(objectMap, "routingMethod", m.RoutingMethod)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type MultiRegionSettings.
func (m *MultiRegionSettings) UnmarshalJSON(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 "regions":
err = unpopulate(val, "Regions", &m.Regions)
delete(rawMsg, key)
case "routingMethod":
err = unpopulate(val, "RoutingMethod", &m.RoutingMethod)
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 NetworkRuleSet.
func (n NetworkRuleSet) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "bypass", n.Bypass)
populate(objectMap, "defaultAction", n.DefaultAction)
populate(objectMap, "ipRules", n.IPRules)
populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.
func (n *NetworkRuleSet) UnmarshalJSON(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 "bypass":
err = unpopulate(val, "Bypass", &n.Bypass)
delete(rawMsg, key)
case "defaultAction":
err = unpopulate(val, "DefaultAction", &n.DefaultAction)
delete(rawMsg, key)
case "ipRules":
err = unpopulate(val, "IPRules", &n.IPRules)
delete(rawMsg, key)
case "virtualNetworkRules":
err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules)
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 NetworkSecurityPerimeter.
func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", n.ID)
populate(objectMap, "location", n.Location)
populate(objectMap, "perimeterGuid", n.PerimeterGUID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter.
func (n *NetworkSecurityPerimeter) UnmarshalJSON(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 "perimeterGuid":
err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID)
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 NetworkSecurityPerimeterAccessRule.
func (n NetworkSecurityPerimeterAccessRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", n.Name)
populate(objectMap, "properties", n.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterAccessRule.
func (n *NetworkSecurityPerimeterAccessRule) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &n.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &n.Properties)
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 NetworkSecurityPerimeterAccessRuleProperties.
func (n NetworkSecurityPerimeterAccessRuleProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "addressPrefixes", n.AddressPrefixes)
populate(objectMap, "direction", n.Direction)
populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames)
populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters)
populate(objectMap, "subscriptions", n.Subscriptions)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterAccessRuleProperties.
func (n *NetworkSecurityPerimeterAccessRuleProperties) UnmarshalJSON(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 "addressPrefixes":
err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes)
delete(rawMsg, key)
case "direction":
err = unpopulate(val, "Direction", &n.Direction)
delete(rawMsg, key)
case "fullyQualifiedDomainNames":
err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames)
delete(rawMsg, key)
case "networkSecurityPerimeters":
err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters)
delete(rawMsg, key)
case "subscriptions":
err = unpopulate(val, "Subscriptions", &n.Subscriptions)
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 NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.
func (n NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", n.ID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.
func (n *NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem) UnmarshalJSON(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)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", n, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration.
func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", n.ID)
populate(objectMap, "name", n.Name)
populate(objectMap, "properties", n.Properties)
populate(objectMap, "type", n.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration.
func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &n.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &n.Properties)
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 NetworkSecurityPerimeterConfigurationAssociationInfo.
func (n NetworkSecurityPerimeterConfigurationAssociationInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "accessMode", n.AccessMode)
populate(objectMap, "name", n.Name)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationAssociationInfo.
func (n *NetworkSecurityPerimeterConfigurationAssociationInfo) UnmarshalJSON(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 "accessMode":
err = unpopulate(val, "AccessMode", &n.AccessMode)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &n.Name)
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 NetworkSecurityPerimeterConfigurationList.
func (n NetworkSecurityPerimeterConfigurationList) 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 NetworkSecurityPerimeterConfigurationList.
func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(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 NetworkSecurityPerimeterConfigurationProperties.
func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter)
populate(objectMap, "profile", n.Profile)
populate(objectMap, "provisioningIssues", n.ProvisioningIssues)
populate(objectMap, "provisioningState", n.ProvisioningState)
populate(objectMap, "resourceAssociation", n.ResourceAssociation)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties.
func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(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 "networkSecurityPerimeter":
err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter)
delete(rawMsg, key)
case "profile":
err = unpopulate(val, "Profile", &n.Profile)
delete(rawMsg, key)
case "provisioningIssues":
err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &n.ProvisioningState)
delete(rawMsg, key)
case "resourceAssociation":
err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation)
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 NetworkSecurityPerimeterProfileInfo.
func (n NetworkSecurityPerimeterProfileInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "accessRules", n.AccessRules)
populate(objectMap, "accessRulesVersion", n.AccessRulesVersion)
populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion)
populate(objectMap, "enabledLogCategories", n.EnabledLogCategories)
populate(objectMap, "name", n.Name)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterProfileInfo.
func (n *NetworkSecurityPerimeterProfileInfo) UnmarshalJSON(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 "accessRules":
err = unpopulate(val, "AccessRules", &n.AccessRules)
delete(rawMsg, key)
case "accessRulesVersion":
err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion)
delete(rawMsg, key)
case "diagnosticSettingsVersion":
err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion)
delete(rawMsg, key)
case "enabledLogCategories":
err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &n.Name)
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 PatchResourceTags.
func (p PatchResourceTags) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "tags", p.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceTags.
func (p *PatchResourceTags) UnmarshalJSON(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 "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 PatchResourceTagsAndSKU.
func (p PatchResourceTagsAndSKU) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "sku", p.SKU)
populate(objectMap, "tags", p.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PatchResourceTagsAndSKU.
func (p *PatchResourceTagsAndSKU) UnmarshalJSON(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 "sku":
err = unpopulate(val, "SKU", &p.SKU)
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 PrivateEndpoint.
func (p PrivateEndpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", p.ID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.
func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &p.ID)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.
func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", p.Etag)
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, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "etag":
err = unpopulate(val, "Etag", &p.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &p.ID)
delete(rawMsg, key)
case "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 "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 PrivateEndpointConnectionListResult.
func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", p.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.
func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "value":
err = unpopulate(val, "Value", &p.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.
func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "groupIds", p.GroupIDs)
populate(objectMap, "privateEndpoint", p.PrivateEndpoint)
populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState)
populate(objectMap, "provisioningState", p.ProvisioningState)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.
func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(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 "groupIds":
err = unpopulate(val, "GroupIDs", &p.GroupIDs)
delete(rawMsg, key)
case "privateEndpoint":
err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint)
delete(rawMsg, key)
case "privateLinkServiceConnectionState":
err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState)
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 PrivateLinkResource.
func (p PrivateLinkResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", p.ID)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &p.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &p.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &p.Properties)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &p.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", p.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "value":
err = unpopulate(val, "Value", &p.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.
func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "displayName", p.DisplayName)
populate(objectMap, "groupId", p.GroupID)
populate(objectMap, "requiredMembers", p.RequiredMembers)
populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "displayName":
err = unpopulate(val, "DisplayName", &p.DisplayName)
delete(rawMsg, key)
case "groupId":
err = unpopulate(val, "GroupID", &p.GroupID)
delete(rawMsg, key)
case "requiredMembers":
err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
delete(rawMsg, key)
case "requiredZoneNames":
err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actionsRequired", p.ActionsRequired)
populate(objectMap, "description", p.Description)
populate(objectMap, "status", p.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "actionsRequired":
err = unpopulate(val, "ActionsRequired", &p.ActionsRequired)
delete(rawMsg, key)
case "description":
err = unpopulate(val, "Description", &p.Description)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &p.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue.
func (p ProvisioningIssue) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue.
func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &p.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &p.Properties)
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 ProvisioningIssueProperties.
func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "description", p.Description)
populate(objectMap, "issueType", p.IssueType)
populate(objectMap, "severity", p.Severity)
populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules)
populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties.
func (p *ProvisioningIssueProperties) UnmarshalJSON(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 "description":
err = unpopulate(val, "Description", &p.Description)
delete(rawMsg, key)
case "issueType":
err = unpopulate(val, "IssueType", &p.IssueType)
delete(rawMsg, key)
case "severity":
err = unpopulate(val, "Severity", &p.Severity)
delete(rawMsg, key)
case "suggestedAccessRules":
err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules)
delete(rawMsg, key)
case "suggestedResourceIds":
err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs)
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 ProxyResource.
func (p ProxyResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", p.ID)
populate(objectMap, "name", p.Name)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
func (p *ProxyResource) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &p.Name)
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 QuotaLimit.
func (q QuotaLimit) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", q.Count)
populate(objectMap, "renewalPeriod", q.RenewalPeriod)
populate(objectMap, "rules", q.Rules)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaLimit.
func (q *QuotaLimit) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", q, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "count":
err = unpopulate(val, "Count", &q.Count)
delete(rawMsg, key)
case "renewalPeriod":
err = unpopulate(val, "RenewalPeriod", &q.RenewalPeriod)
delete(rawMsg, key)
case "rules":
err = unpopulate(val, "Rules", &q.Rules)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", q, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RaiBlockListItemsResult.
func (r RaiBlockListItemsResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlockListItemsResult.
func (r *RaiBlockListItemsResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 RaiBlockListResult.
func (r RaiBlockListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlockListResult.
func (r *RaiBlockListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 RaiBlocklist.
func (r RaiBlocklist) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", r.Etag)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "tags", r.Tags)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklist.
func (r *RaiBlocklist) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &r.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 RaiBlocklistConfig.
func (r RaiBlocklistConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "blocking", r.Blocking)
populate(objectMap, "blocklistName", r.BlocklistName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklistConfig.
func (r *RaiBlocklistConfig) UnmarshalJSON(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 "blocking":
err = unpopulate(val, "Blocking", &r.Blocking)
delete(rawMsg, key)
case "blocklistName":
err = unpopulate(val, "BlocklistName", &r.BlocklistName)
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 RaiBlocklistItem.
func (r RaiBlocklistItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", r.Etag)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "tags", r.Tags)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklistItem.
func (r *RaiBlocklistItem) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &r.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 RaiBlocklistItemBulkRequest.
func (r RaiBlocklistItemBulkRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklistItemBulkRequest.
func (r *RaiBlocklistItemBulkRequest) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
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 RaiBlocklistItemProperties.
func (r RaiBlocklistItemProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isRegex", r.IsRegex)
populate(objectMap, "pattern", r.Pattern)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklistItemProperties.
func (r *RaiBlocklistItemProperties) UnmarshalJSON(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 "isRegex":
err = unpopulate(val, "IsRegex", &r.IsRegex)
delete(rawMsg, key)
case "pattern":
err = unpopulate(val, "Pattern", &r.Pattern)
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 RaiBlocklistProperties.
func (r RaiBlocklistProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "description", r.Description)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiBlocklistProperties.
func (r *RaiBlocklistProperties) UnmarshalJSON(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 "description":
err = unpopulate(val, "Description", &r.Description)
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 RaiContentFilter.
func (r RaiContentFilter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiContentFilter.
func (r *RaiContentFilter) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 RaiContentFilterListResult.
func (r RaiContentFilterListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiContentFilterListResult.
func (r *RaiContentFilterListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 RaiContentFilterProperties.
func (r RaiContentFilterProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isMultiLevelFilter", r.IsMultiLevelFilter)
populate(objectMap, "name", r.Name)
populate(objectMap, "source", r.Source)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiContentFilterProperties.
func (r *RaiContentFilterProperties) UnmarshalJSON(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 "isMultiLevelFilter":
err = unpopulate(val, "IsMultiLevelFilter", &r.IsMultiLevelFilter)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &r.Source)
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 RaiMonitorConfig.
func (r RaiMonitorConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "adxStorageResourceId", r.AdxStorageResourceID)
populate(objectMap, "identityClientId", r.IdentityClientID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiMonitorConfig.
func (r *RaiMonitorConfig) UnmarshalJSON(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 "adxStorageResourceId":
err = unpopulate(val, "AdxStorageResourceID", &r.AdxStorageResourceID)
delete(rawMsg, key)
case "identityClientId":
err = unpopulate(val, "IdentityClientID", &r.IdentityClientID)
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 RaiPolicy.
func (r RaiPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "etag", r.Etag)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "tags", r.Tags)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiPolicy.
func (r *RaiPolicy) UnmarshalJSON(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 "etag":
err = unpopulate(val, "Etag", &r.Etag)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 RaiPolicyContentFilter.
func (r RaiPolicyContentFilter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "blocking", r.Blocking)
populate(objectMap, "enabled", r.Enabled)
populate(objectMap, "name", r.Name)
populate(objectMap, "severityThreshold", r.SeverityThreshold)
populate(objectMap, "source", r.Source)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiPolicyContentFilter.
func (r *RaiPolicyContentFilter) UnmarshalJSON(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 "blocking":
err = unpopulate(val, "Blocking", &r.Blocking)
delete(rawMsg, key)
case "enabled":
err = unpopulate(val, "Enabled", &r.Enabled)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "severityThreshold":
err = unpopulate(val, "SeverityThreshold", &r.SeverityThreshold)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &r.Source)
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 RaiPolicyListResult.
func (r RaiPolicyListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiPolicyListResult.
func (r *RaiPolicyListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 RaiPolicyProperties.
func (r RaiPolicyProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "basePolicyName", r.BasePolicyName)
populate(objectMap, "contentFilters", r.ContentFilters)
populate(objectMap, "customBlocklists", r.CustomBlocklists)
populate(objectMap, "mode", r.Mode)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RaiPolicyProperties.
func (r *RaiPolicyProperties) UnmarshalJSON(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 "basePolicyName":
err = unpopulate(val, "BasePolicyName", &r.BasePolicyName)
delete(rawMsg, key)
case "contentFilters":
err = unpopulate(val, "ContentFilters", &r.ContentFilters)
delete(rawMsg, key)
case "customBlocklists":
err = unpopulate(val, "CustomBlocklists", &r.CustomBlocklists)
delete(rawMsg, key)
case "mode":
err = unpopulate(val, "Mode", &r.Mode)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 RegenerateKeyParameters.
func (r RegenerateKeyParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "keyName", r.KeyName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateKeyParameters.
func (r *RegenerateKeyParameters) UnmarshalJSON(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 "keyName":
err = unpopulate(val, "KeyName", &r.KeyName)
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 RegionSetting.
func (r RegionSetting) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "customsubdomain", r.Customsubdomain)
populate(objectMap, "name", r.Name)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegionSetting.
func (r *RegionSetting) UnmarshalJSON(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 "customsubdomain":
err = unpopulate(val, "Customsubdomain", &r.Customsubdomain)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 RequestMatchPattern.
func (r RequestMatchPattern) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "method", r.Method)
populate(objectMap, "path", r.Path)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RequestMatchPattern.
func (r *RequestMatchPattern) UnmarshalJSON(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 "method":
err = unpopulate(val, "Method", &r.Method)
delete(rawMsg, key)
case "path":
err = unpopulate(val, "Path", &r.Path)
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 Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
func (r *Resource) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
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 ResourceSKU.
func (r ResourceSKU) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "kind", r.Kind)
populate(objectMap, "locations", r.Locations)
populate(objectMap, "name", r.Name)
populate(objectMap, "resourceType", r.ResourceType)
populate(objectMap, "restrictions", r.Restrictions)
populate(objectMap, "tier", r.Tier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU.
func (r *ResourceSKU) UnmarshalJSON(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 "kind":
err = unpopulate(val, "Kind", &r.Kind)
delete(rawMsg, key)
case "locations":
err = unpopulate(val, "Locations", &r.Locations)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "resourceType":
err = unpopulate(val, "ResourceType", &r.ResourceType)
delete(rawMsg, key)
case "restrictions":
err = unpopulate(val, "Restrictions", &r.Restrictions)
delete(rawMsg, key)
case "tier":
err = unpopulate(val, "Tier", &r.Tier)
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 ResourceSKUListResult.
func (r ResourceSKUListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUListResult.
func (r *ResourceSKUListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
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 ResourceSKURestrictionInfo.
func (r ResourceSKURestrictionInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "locations", r.Locations)
populate(objectMap, "zones", r.Zones)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictionInfo.
func (r *ResourceSKURestrictionInfo) UnmarshalJSON(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 "locations":
err = unpopulate(val, "Locations", &r.Locations)
delete(rawMsg, key)
case "zones":
err = unpopulate(val, "Zones", &r.Zones)
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 ResourceSKURestrictions.
func (r ResourceSKURestrictions) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "reasonCode", r.ReasonCode)
populate(objectMap, "restrictionInfo", r.RestrictionInfo)
populate(objectMap, "type", r.Type)
populate(objectMap, "values", r.Values)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKURestrictions.
func (r *ResourceSKURestrictions) UnmarshalJSON(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 "reasonCode":
err = unpopulate(val, "ReasonCode", &r.ReasonCode)
delete(rawMsg, key)
case "restrictionInfo":
err = unpopulate(val, "RestrictionInfo", &r.RestrictionInfo)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &r.Values)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type 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 SKUAvailability.
func (s SKUAvailability) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "kind", s.Kind)
populate(objectMap, "message", s.Message)
populate(objectMap, "reason", s.Reason)
populate(objectMap, "skuAvailable", s.SKUAvailable)
populate(objectMap, "skuName", s.SKUName)
populate(objectMap, "type", s.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKUAvailability.
func (s *SKUAvailability) UnmarshalJSON(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 "kind":
err = unpopulate(val, "Kind", &s.Kind)
delete(rawMsg, key)
case "message":
err = unpopulate(val, "Message", &s.Message)
delete(rawMsg, key)
case "reason":
err = unpopulate(val, "Reason", &s.Reason)
delete(rawMsg, key)
case "skuAvailable":
err = unpopulate(val, "SKUAvailable", &s.SKUAvailable)
delete(rawMsg, key)
case "skuName":
err = unpopulate(val, "SKUName", &s.SKUName)
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 SKUAvailabilityListResult.
func (s SKUAvailabilityListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", s.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKUAvailabilityListResult.
func (s *SKUAvailabilityListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "value":
err = unpopulate(val, "Value", &s.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SKUCapability.
func (s SKUCapability) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", s.Name)
populate(objectMap, "value", s.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapability.
func (s *SKUCapability) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &s.Name)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &s.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SKUChangeInfo.
func (s SKUChangeInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "countOfDowngrades", s.CountOfDowngrades)
populate(objectMap, "countOfUpgradesAfterDowngrades", s.CountOfUpgradesAfterDowngrades)
populate(objectMap, "lastChangeDate", s.LastChangeDate)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKUChangeInfo.
func (s *SKUChangeInfo) UnmarshalJSON(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 "countOfDowngrades":
err = unpopulate(val, "CountOfDowngrades", &s.CountOfDowngrades)
delete(rawMsg, key)
case "countOfUpgradesAfterDowngrades":
err = unpopulate(val, "CountOfUpgradesAfterDowngrades", &s.CountOfUpgradesAfterDowngrades)
delete(rawMsg, key)
case "lastChangeDate":
err = unpopulate(val, "LastChangeDate", &s.LastChangeDate)
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 SKUResource.
func (s SKUResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "capacity", s.Capacity)
populate(objectMap, "resourceType", s.ResourceType)
populate(objectMap, "sku", s.SKU)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKUResource.
func (s *SKUResource) UnmarshalJSON(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 "resourceType":
err = unpopulate(val, "ResourceType", &s.ResourceType)
delete(rawMsg, key)
case "sku":
err = unpopulate(val, "SKU", &s.SKU)
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 ThrottlingRule.
func (t ThrottlingRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", t.Count)
populate(objectMap, "dynamicThrottlingEnabled", t.DynamicThrottlingEnabled)
populate(objectMap, "key", t.Key)
populate(objectMap, "matchPatterns", t.MatchPatterns)
populate(objectMap, "minCount", t.MinCount)
populate(objectMap, "renewalPeriod", t.RenewalPeriod)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottlingRule.
func (t *ThrottlingRule) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", t, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "count":
err = unpopulate(val, "Count", &t.Count)
delete(rawMsg, key)
case "dynamicThrottlingEnabled":
err = unpopulate(val, "DynamicThrottlingEnabled", &t.DynamicThrottlingEnabled)
delete(rawMsg, key)
case "key":
err = unpopulate(val, "Key", &t.Key)
delete(rawMsg, key)
case "matchPatterns":
err = unpopulate(val, "MatchPatterns", &t.MatchPatterns)
delete(rawMsg, key)
case "minCount":
err = unpopulate(val, "MinCount", &t.MinCount)
delete(rawMsg, key)
case "renewalPeriod":
err = unpopulate(val, "RenewalPeriod", &t.RenewalPeriod)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", t, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Usage.
func (u Usage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "currentValue", u.CurrentValue)
populate(objectMap, "limit", u.Limit)
populate(objectMap, "name", u.Name)
populate(objectMap, "nextResetTime", u.NextResetTime)
populate(objectMap, "quotaPeriod", u.QuotaPeriod)
populate(objectMap, "status", u.Status)
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 "limit":
err = unpopulate(val, "Limit", &u.Limit)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &u.Name)
delete(rawMsg, key)
case "nextResetTime":
err = unpopulate(val, "NextResetTime", &u.NextResetTime)
delete(rawMsg, key)
case "quotaPeriod":
err = unpopulate(val, "QuotaPeriod", &u.QuotaPeriod)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &u.Status)
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 UsageListResult.
func (u UsageListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", u.NextLink)
populate(objectMap, "value", u.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult.
func (u *UsageListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &u.NextLink)
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 UserOwnedAmlWorkspace.
func (u UserOwnedAmlWorkspace) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identityClientId", u.IdentityClientID)
populate(objectMap, "resourceId", u.ResourceID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type UserOwnedAmlWorkspace.
func (u *UserOwnedAmlWorkspace) UnmarshalJSON(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 "identityClientId":
err = unpopulate(val, "IdentityClientID", &u.IdentityClientID)
delete(rawMsg, key)
case "resourceId":
err = unpopulate(val, "ResourceID", &u.ResourceID)
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 UserOwnedStorage.
func (u UserOwnedStorage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identityClientId", u.IdentityClientID)
populate(objectMap, "resourceId", u.ResourceID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type UserOwnedStorage.
func (u *UserOwnedStorage) UnmarshalJSON(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 "identityClientId":
err = unpopulate(val, "IdentityClientID", &u.IdentityClientID)
delete(rawMsg, key)
case "resourceId":
err = unpopulate(val, "ResourceID", &u.ResourceID)
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 VirtualNetworkRule.
func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", v.ID)
populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint)
populate(objectMap, "state", v.State)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule.
func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", v, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &v.ID)
delete(rawMsg, key)
case "ignoreMissingVnetServiceEndpoint":
err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint)
delete(rawMsg, key)
case "state":
err = unpopulate(val, "State", &v.State)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", v, 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
}