sdk/resourcemanager/eventgrid/armeventgrid/models_serde.go (7,075 lines of code) (raw):

// 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 armeventgrid import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) // MarshalJSON implements the json.Marshaller interface for type AdvancedFilter. func (a AdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", a.Key) objectMap["operatorType"] = a.OperatorType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedFilter. func (a *AdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &a.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &a.OperatorType) 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 AzureFunctionEventSubscriptionDestination. func (a AzureFunctionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeAzureFunction populate(objectMap, "properties", a.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionEventSubscriptionDestination. func (a *AzureFunctionEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &a.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &a.Properties) 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 AzureFunctionEventSubscriptionDestinationProperties. func (a AzureFunctionEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryAttributeMappings", a.DeliveryAttributeMappings) populate(objectMap, "maxEventsPerBatch", a.MaxEventsPerBatch) populate(objectMap, "preferredBatchSizeInKilobytes", a.PreferredBatchSizeInKilobytes) populate(objectMap, "resourceId", a.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type AzureFunctionEventSubscriptionDestinationProperties. func (a *AzureFunctionEventSubscriptionDestinationProperties) UnmarshalJSON(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 "deliveryAttributeMappings": a.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "maxEventsPerBatch": err = unpopulate(val, "MaxEventsPerBatch", &a.MaxEventsPerBatch) delete(rawMsg, key) case "preferredBatchSizeInKilobytes": err = unpopulate(val, "PreferredBatchSizeInKilobytes", &a.PreferredBatchSizeInKilobytes) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &a.ResourceID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type BoolEqualsAdvancedFilter. func (b BoolEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", b.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeBoolEquals populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type BoolEqualsAdvancedFilter. func (b *BoolEqualsAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &b.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &b.OperatorType) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &b.Value) 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 BoolEqualsFilter. func (b BoolEqualsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", b.Key) objectMap["operatorType"] = FilterOperatorTypeBoolEquals populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type BoolEqualsFilter. func (b *BoolEqualsFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &b.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &b.OperatorType) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &b.Value) 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 CaCertificate. func (c CaCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CaCertificate. func (c *CaCertificate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CaCertificateProperties. func (c CaCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "encodedCertificate", c.EncodedCertificate) populateDateTimeRFC3339(objectMap, "expiryTimeInUtc", c.ExpiryTimeInUTC) populateDateTimeRFC3339(objectMap, "issueTimeInUtc", c.IssueTimeInUTC) populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CaCertificateProperties. func (c *CaCertificateProperties) UnmarshalJSON(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 "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "encodedCertificate": err = unpopulate(val, "EncodedCertificate", &c.EncodedCertificate) delete(rawMsg, key) case "expiryTimeInUtc": err = unpopulateDateTimeRFC3339(val, "ExpiryTimeInUTC", &c.ExpiryTimeInUTC) delete(rawMsg, key) case "issueTimeInUtc": err = unpopulateDateTimeRFC3339(val, "IssueTimeInUTC", &c.IssueTimeInUTC) 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 CaCertificatesListResult. func (c CaCertificatesListResult) 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 CaCertificatesListResult. func (c *CaCertificatesListResult) UnmarshalJSON(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 Channel. func (c Channel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Channel. func (c *Channel) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ChannelProperties. func (c ChannelProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "channelType", c.ChannelType) populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) populate(objectMap, "messageForActivation", c.MessageForActivation) populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "readinessState", c.ReadinessState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ChannelProperties. func (c *ChannelProperties) UnmarshalJSON(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 "channelType": err = unpopulate(val, "ChannelType", &c.ChannelType) delete(rawMsg, key) case "expirationTimeIfNotActivatedUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &c.ExpirationTimeIfNotActivatedUTC) delete(rawMsg, key) case "messageForActivation": err = unpopulate(val, "MessageForActivation", &c.MessageForActivation) delete(rawMsg, key) case "partnerTopicInfo": err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) case "readinessState": err = unpopulate(val, "ReadinessState", &c.ReadinessState) 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 ChannelUpdateParameters. func (c ChannelUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ChannelUpdateParameters. func (c *ChannelUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ChannelUpdateParametersProperties. func (c ChannelUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ChannelUpdateParametersProperties. func (c *ChannelUpdateParametersProperties) UnmarshalJSON(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 "expirationTimeIfNotActivatedUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &c.ExpirationTimeIfNotActivatedUTC) delete(rawMsg, key) case "partnerTopicInfo": err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) 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 ChannelsListResult. func (c ChannelsListResult) 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 ChannelsListResult. func (c *ChannelsListResult) UnmarshalJSON(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 Client. func (c Client) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Client. func (c *Client) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClientCertificateAuthentication. func (c ClientCertificateAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allowedThumbprints", c.AllowedThumbprints) populate(objectMap, "validationScheme", c.ValidationScheme) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClientCertificateAuthentication. func (c *ClientCertificateAuthentication) UnmarshalJSON(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 "allowedThumbprints": err = unpopulate(val, "AllowedThumbprints", &c.AllowedThumbprints) delete(rawMsg, key) case "validationScheme": err = unpopulate(val, "ValidationScheme", &c.ValidationScheme) 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 ClientGroup. func (c ClientGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "systemData", c.SystemData) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClientGroup. func (c *ClientGroup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ClientGroupProperties. func (c ClientGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "query", c.Query) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClientGroupProperties. func (c *ClientGroupProperties) UnmarshalJSON(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 "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) case "query": err = unpopulate(val, "Query", &c.Query) 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 ClientGroupsListResult. func (c ClientGroupsListResult) 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 ClientGroupsListResult. func (c *ClientGroupsListResult) UnmarshalJSON(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 ClientProperties. func (c ClientProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "attributes", c.Attributes) populate(objectMap, "authenticationName", c.AuthenticationName) populate(objectMap, "clientCertificateAuthentication", c.ClientCertificateAuthentication) populate(objectMap, "description", c.Description) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "state", c.State) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ClientProperties. func (c *ClientProperties) UnmarshalJSON(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 "attributes": err = unpopulate(val, "Attributes", &c.Attributes) delete(rawMsg, key) case "authenticationName": err = unpopulate(val, "AuthenticationName", &c.AuthenticationName) delete(rawMsg, key) case "clientCertificateAuthentication": err = unpopulate(val, "ClientCertificateAuthentication", &c.ClientCertificateAuthentication) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &c.State) 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 ClientsListResult. func (c ClientsListResult) 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 ClientsListResult. func (c *ClientsListResult) UnmarshalJSON(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 ConnectionState. func (c ConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "actionsRequired", c.ActionsRequired) populate(objectMap, "description", c.Description) populate(objectMap, "status", c.Status) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionState. func (c *ConnectionState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "actionsRequired": err = unpopulate(val, "ActionsRequired", &c.ActionsRequired) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CustomDomainConfiguration. func (c CustomDomainConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "certificateUrl", c.CertificateURL) populate(objectMap, "expectedTxtRecordName", c.ExpectedTxtRecordName) populate(objectMap, "expectedTxtRecordValue", c.ExpectedTxtRecordValue) populate(objectMap, "fullyQualifiedDomainName", c.FullyQualifiedDomainName) populate(objectMap, "identity", c.Identity) populate(objectMap, "validationState", c.ValidationState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainConfiguration. func (c *CustomDomainConfiguration) UnmarshalJSON(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 "certificateUrl": err = unpopulate(val, "CertificateURL", &c.CertificateURL) delete(rawMsg, key) case "expectedTxtRecordName": err = unpopulate(val, "ExpectedTxtRecordName", &c.ExpectedTxtRecordName) delete(rawMsg, key) case "expectedTxtRecordValue": err = unpopulate(val, "ExpectedTxtRecordValue", &c.ExpectedTxtRecordValue) delete(rawMsg, key) case "fullyQualifiedDomainName": err = unpopulate(val, "FullyQualifiedDomainName", &c.FullyQualifiedDomainName) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) case "validationState": err = unpopulate(val, "ValidationState", &c.ValidationState) 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 CustomDomainIdentity. func (c CustomDomainIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "type", c.Type) populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainIdentity. func (c *CustomDomainIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) case "userAssignedIdentity": err = unpopulate(val, "UserAssignedIdentity", &c.UserAssignedIdentity) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type CustomDomainOwnershipValidationResult. func (c CustomDomainOwnershipValidationResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customDomainsForTopicSpacesConfiguration", c.CustomDomainsForTopicSpacesConfiguration) populate(objectMap, "customDomainsForTopicsConfiguration", c.CustomDomainsForTopicsConfiguration) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainOwnershipValidationResult. func (c *CustomDomainOwnershipValidationResult) UnmarshalJSON(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 "customDomainsForTopicSpacesConfiguration": err = unpopulate(val, "CustomDomainsForTopicSpacesConfiguration", &c.CustomDomainsForTopicSpacesConfiguration) delete(rawMsg, key) case "customDomainsForTopicsConfiguration": err = unpopulate(val, "CustomDomainsForTopicsConfiguration", &c.CustomDomainsForTopicsConfiguration) 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 DeadLetterDestination. func (d DeadLetterDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = d.EndpointType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterDestination. func (d *DeadLetterDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &d.EndpointType) 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 DeadLetterWithResourceIdentity. func (d DeadLetterWithResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deadLetterDestination", d.DeadLetterDestination) populate(objectMap, "identity", d.Identity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeadLetterWithResourceIdentity. func (d *DeadLetterWithResourceIdentity) UnmarshalJSON(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 "deadLetterDestination": d.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &d.Identity) 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 DeliveryAttributeListResult. func (d DeliveryAttributeListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeListResult. func (d *DeliveryAttributeListResult) UnmarshalJSON(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 "value": d.Value, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DeliveryAttributeMapping. func (d DeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", d.Name) objectMap["type"] = d.Type return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryAttributeMapping. func (d *DeliveryAttributeMapping) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "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 DeliveryConfiguration. func (d DeliveryConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryMode", d.DeliveryMode) populate(objectMap, "push", d.Push) populate(objectMap, "queue", d.Queue) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryConfiguration. func (d *DeliveryConfiguration) UnmarshalJSON(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 "deliveryMode": err = unpopulate(val, "DeliveryMode", &d.DeliveryMode) delete(rawMsg, key) case "push": err = unpopulate(val, "Push", &d.Push) delete(rawMsg, key) case "queue": err = unpopulate(val, "Queue", &d.Queue) 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 DeliveryWithResourceIdentity. func (d DeliveryWithResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "destination", d.Destination) populate(objectMap, "identity", d.Identity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DeliveryWithResourceIdentity. func (d *DeliveryWithResourceIdentity) UnmarshalJSON(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 "destination": d.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &d.Identity) 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 Domain. func (d Domain) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "identity", d.Identity) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Domain. func (d *Domain) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DomainProperties. func (d DomainProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "endpoint", d.Endpoint) populate(objectMap, "eventTypeInfo", d.EventTypeInfo) populate(objectMap, "inboundIpRules", d.InboundIPRules) populate(objectMap, "inputSchema", d.InputSchema) populate(objectMap, "inputSchemaMapping", d.InputSchemaMapping) populate(objectMap, "metricResourceId", d.MetricResourceID) populate(objectMap, "minimumTlsVersionAllowed", d.MinimumTLSVersionAllowed) populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainProperties. func (d *DomainProperties) UnmarshalJSON(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 "autoCreateTopicWithFirstSubscription": err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) delete(rawMsg, key) case "autoDeleteTopicWithLastSubscription": err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) delete(rawMsg, key) case "dataResidencyBoundary": err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) case "endpoint": err = unpopulate(val, "Endpoint", &d.Endpoint) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &d.EventTypeInfo) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) delete(rawMsg, key) case "inputSchema": err = unpopulate(val, "InputSchema", &d.InputSchema) delete(rawMsg, key) case "inputSchemaMapping": d.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) delete(rawMsg, key) case "metricResourceId": err = unpopulate(val, "MetricResourceID", &d.MetricResourceID) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &d.MinimumTLSVersionAllowed) delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) 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 DomainRegenerateKeyRequest. func (d DomainRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyName", d.KeyName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainRegenerateKeyRequest. func (d *DomainRegenerateKeyRequest) UnmarshalJSON(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 "keyName": err = unpopulate(val, "KeyName", &d.KeyName) 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 DomainSharedAccessKeys. func (d DomainSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key1", d.Key1) populate(objectMap, "key2", d.Key2) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainSharedAccessKeys. func (d *DomainSharedAccessKeys) UnmarshalJSON(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 "key1": err = unpopulate(val, "Key1", &d.Key1) delete(rawMsg, key) case "key2": err = unpopulate(val, "Key2", &d.Key2) 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 DomainTopic. func (d DomainTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopic. func (d *DomainTopic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "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 "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 DomainTopicProperties. func (d DomainTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "provisioningState", d.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainTopicProperties. func (d *DomainTopicProperties) UnmarshalJSON(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 "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) 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 DomainTopicsListResult. func (d DomainTopicsListResult) 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 DomainTopicsListResult. func (d *DomainTopicsListResult) UnmarshalJSON(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 DomainUpdateParameterProperties. func (d DomainUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "eventTypeInfo", d.EventTypeInfo) populate(objectMap, "inboundIpRules", d.InboundIPRules) populate(objectMap, "minimumTlsVersionAllowed", d.MinimumTLSVersionAllowed) populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameterProperties. func (d *DomainUpdateParameterProperties) UnmarshalJSON(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 "autoCreateTopicWithFirstSubscription": err = unpopulate(val, "AutoCreateTopicWithFirstSubscription", &d.AutoCreateTopicWithFirstSubscription) delete(rawMsg, key) case "autoDeleteTopicWithLastSubscription": err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) delete(rawMsg, key) case "dataResidencyBoundary": err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &d.EventTypeInfo) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &d.InboundIPRules) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &d.MinimumTLSVersionAllowed) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &d.PublicNetworkAccess) 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 DomainUpdateParameters. func (d DomainUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", d.Identity) populate(objectMap, "properties", d.Properties) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DomainUpdateParameters. func (d *DomainUpdateParameters) UnmarshalJSON(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 "identity": err = unpopulate(val, "Identity", &d.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &d.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type DomainsListResult. func (d DomainsListResult) 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 DomainsListResult. func (d *DomainsListResult) UnmarshalJSON(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 DynamicDeliveryAttributeMapping. func (d DynamicDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) objectMap["type"] = DeliveryAttributeMappingTypeDynamic return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMapping. func (d *DynamicDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &d.Properties) 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 DynamicDeliveryAttributeMappingProperties. func (d DynamicDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "sourceField", d.SourceField) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DynamicDeliveryAttributeMappingProperties. func (d *DynamicDeliveryAttributeMappingProperties) UnmarshalJSON(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 "sourceField": err = unpopulate(val, "SourceField", &d.SourceField) 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 DynamicRoutingEnrichment. func (d DynamicRoutingEnrichment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", d.Key) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DynamicRoutingEnrichment. func (d *DynamicRoutingEnrichment) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &d.Key) 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 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 EventHubEventSubscriptionDestination. func (e EventHubEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeEventHub populate(objectMap, "properties", e.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestination. func (e *EventHubEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &e.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) 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 EventHubEventSubscriptionDestinationProperties. func (e EventHubEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryAttributeMappings", e.DeliveryAttributeMappings) populate(objectMap, "resourceId", e.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventHubEventSubscriptionDestinationProperties. func (e *EventHubEventSubscriptionDestinationProperties) UnmarshalJSON(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 "deliveryAttributeMappings": e.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &e.ResourceID) 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 EventSubscription. func (e EventSubscription) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) populate(objectMap, "systemData", e.SystemData) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscription. func (e *EventSubscription) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type EventSubscriptionDestination. func (e EventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = e.EndpointType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionDestination. func (e *EventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &e.EndpointType) 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 EventSubscriptionFilter. func (e EventSubscriptionFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "advancedFilters", e.AdvancedFilters) populate(objectMap, "enableAdvancedFilteringOnArrays", e.EnableAdvancedFilteringOnArrays) populate(objectMap, "includedEventTypes", e.IncludedEventTypes) populate(objectMap, "isSubjectCaseSensitive", e.IsSubjectCaseSensitive) populate(objectMap, "subjectBeginsWith", e.SubjectBeginsWith) populate(objectMap, "subjectEndsWith", e.SubjectEndsWith) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFilter. func (e *EventSubscriptionFilter) UnmarshalJSON(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 "advancedFilters": e.AdvancedFilters, err = unmarshalAdvancedFilterClassificationArray(val) delete(rawMsg, key) case "enableAdvancedFilteringOnArrays": err = unpopulate(val, "EnableAdvancedFilteringOnArrays", &e.EnableAdvancedFilteringOnArrays) delete(rawMsg, key) case "includedEventTypes": err = unpopulate(val, "IncludedEventTypes", &e.IncludedEventTypes) delete(rawMsg, key) case "isSubjectCaseSensitive": err = unpopulate(val, "IsSubjectCaseSensitive", &e.IsSubjectCaseSensitive) delete(rawMsg, key) case "subjectBeginsWith": err = unpopulate(val, "SubjectBeginsWith", &e.SubjectBeginsWith) delete(rawMsg, key) case "subjectEndsWith": err = unpopulate(val, "SubjectEndsWith", &e.SubjectEndsWith) 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 EventSubscriptionFullURL. func (e EventSubscriptionFullURL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "endpointUrl", e.EndpointURL) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionFullURL. func (e *EventSubscriptionFullURL) UnmarshalJSON(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 "endpointUrl": err = unpopulate(val, "EndpointURL", &e.EndpointURL) 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 EventSubscriptionIdentity. func (e EventSubscriptionIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "type", e.Type) populate(objectMap, "userAssignedIdentity", e.UserAssignedIdentity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionIdentity. func (e *EventSubscriptionIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) case "userAssignedIdentity": err = unpopulate(val, "UserAssignedIdentity", &e.UserAssignedIdentity) 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 EventSubscriptionProperties. func (e EventSubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) populate(objectMap, "destination", e.Destination) populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) populateDateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) populate(objectMap, "filter", e.Filter) populate(objectMap, "labels", e.Labels) populate(objectMap, "provisioningState", e.ProvisioningState) populate(objectMap, "retryPolicy", e.RetryPolicy) populate(objectMap, "topic", e.Topic) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionProperties. func (e *EventSubscriptionProperties) UnmarshalJSON(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 "deadLetterDestination": e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) delete(rawMsg, key) case "deadLetterWithResourceIdentity": err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) delete(rawMsg, key) case "deliveryWithResourceIdentity": err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) delete(rawMsg, key) case "destination": e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) delete(rawMsg, key) case "eventDeliverySchema": err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) delete(rawMsg, key) case "expirationTimeUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) delete(rawMsg, key) case "filter": err = unpopulate(val, "Filter", &e.Filter) delete(rawMsg, key) case "labels": err = unpopulate(val, "Labels", &e.Labels) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) delete(rawMsg, key) case "retryPolicy": err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) delete(rawMsg, key) case "topic": err = unpopulate(val, "Topic", &e.Topic) 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 EventSubscriptionUpdateParameters. func (e EventSubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deadLetterDestination", e.DeadLetterDestination) populate(objectMap, "deadLetterWithResourceIdentity", e.DeadLetterWithResourceIdentity) populate(objectMap, "deliveryWithResourceIdentity", e.DeliveryWithResourceIdentity) populate(objectMap, "destination", e.Destination) populate(objectMap, "eventDeliverySchema", e.EventDeliverySchema) populateDateTimeRFC3339(objectMap, "expirationTimeUtc", e.ExpirationTimeUTC) populate(objectMap, "filter", e.Filter) populate(objectMap, "labels", e.Labels) populate(objectMap, "retryPolicy", e.RetryPolicy) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventSubscriptionUpdateParameters. func (e *EventSubscriptionUpdateParameters) UnmarshalJSON(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 "deadLetterDestination": e.DeadLetterDestination, err = unmarshalDeadLetterDestinationClassification(val) delete(rawMsg, key) case "deadLetterWithResourceIdentity": err = unpopulate(val, "DeadLetterWithResourceIdentity", &e.DeadLetterWithResourceIdentity) delete(rawMsg, key) case "deliveryWithResourceIdentity": err = unpopulate(val, "DeliveryWithResourceIdentity", &e.DeliveryWithResourceIdentity) delete(rawMsg, key) case "destination": e.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) delete(rawMsg, key) case "eventDeliverySchema": err = unpopulate(val, "EventDeliverySchema", &e.EventDeliverySchema) delete(rawMsg, key) case "expirationTimeUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeUTC", &e.ExpirationTimeUTC) delete(rawMsg, key) case "filter": err = unpopulate(val, "Filter", &e.Filter) delete(rawMsg, key) case "labels": err = unpopulate(val, "Labels", &e.Labels) delete(rawMsg, key) case "retryPolicy": err = unpopulate(val, "RetryPolicy", &e.RetryPolicy) 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 EventSubscriptionsListResult. func (e EventSubscriptionsListResult) 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 EventSubscriptionsListResult. func (e *EventSubscriptionsListResult) UnmarshalJSON(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 EventType. func (e EventType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventType. func (e *EventType) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "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 EventTypeInfo. func (e EventTypeInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "inlineEventTypes", e.InlineEventTypes) populate(objectMap, "kind", e.Kind) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeInfo. func (e *EventTypeInfo) UnmarshalJSON(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 "inlineEventTypes": err = unpopulate(val, "InlineEventTypes", &e.InlineEventTypes) delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &e.Kind) 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 EventTypeProperties. func (e EventTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "displayName", e.DisplayName) populate(objectMap, "isInDefaultSet", e.IsInDefaultSet) populate(objectMap, "schemaUrl", e.SchemaURL) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventTypeProperties. func (e *EventTypeProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &e.DisplayName) delete(rawMsg, key) case "isInDefaultSet": err = unpopulate(val, "IsInDefaultSet", &e.IsInDefaultSet) delete(rawMsg, key) case "schemaUrl": err = unpopulate(val, "SchemaURL", &e.SchemaURL) 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 EventTypesListResult. func (e EventTypesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type EventTypesListResult. func (e *EventTypesListResult) UnmarshalJSON(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 "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 ExtensionTopic. func (e ExtensionTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "name", e.Name) populate(objectMap, "properties", e.Properties) populate(objectMap, "systemData", e.SystemData) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionTopic. func (e *ExtensionTopic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ExtensionTopicProperties. func (e ExtensionTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", e.Description) populate(objectMap, "systemTopic", e.SystemTopic) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ExtensionTopicProperties. func (e *ExtensionTopicProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { case "description": err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) case "systemTopic": err = unpopulate(val, "SystemTopic", &e.SystemTopic) 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 Filter. func (f Filter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", f.Key) objectMap["operatorType"] = f.OperatorType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Filter. func (f *Filter) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { case "key": err = unpopulate(val, "Key", &f.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &f.OperatorType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type FiltersConfiguration. func (f FiltersConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "filters", f.Filters) populate(objectMap, "includedEventTypes", f.IncludedEventTypes) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type FiltersConfiguration. func (f *FiltersConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { case "filters": f.Filters, err = unmarshalFilterClassificationArray(val) delete(rawMsg, key) case "includedEventTypes": err = unpopulate(val, "IncludedEventTypes", &f.IncludedEventTypes) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestination. func (h HybridConnectionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeHybridConnection populate(objectMap, "properties", h.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionEventSubscriptionDestination. func (h *HybridConnectionEventSubscriptionDestination) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "endpointType": err = unpopulate(val, "EndpointType", &h.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &h.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestinationProperties. func (h HybridConnectionEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryAttributeMappings", h.DeliveryAttributeMappings) populate(objectMap, "resourceId", h.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionEventSubscriptionDestinationProperties. func (h *HybridConnectionEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { case "deliveryAttributeMappings": h.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &h.ResourceID) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type IdentityInfo. func (i IdentityInfo) 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 IdentityInfo. func (i *IdentityInfo) UnmarshalJSON(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 InboundIPRule. func (i InboundIPRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "action", i.Action) populate(objectMap, "ipMask", i.IPMask) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type InboundIPRule. func (i *InboundIPRule) UnmarshalJSON(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 "action": err = unpopulate(val, "Action", &i.Action) delete(rawMsg, key) case "ipMask": err = unpopulate(val, "IPMask", &i.IPMask) 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 InlineEventProperties. func (i InlineEventProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataSchemaUrl", i.DataSchemaURL) populate(objectMap, "description", i.Description) populate(objectMap, "displayName", i.DisplayName) populate(objectMap, "documentationUrl", i.DocumentationURL) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type InlineEventProperties. func (i *InlineEventProperties) UnmarshalJSON(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 "dataSchemaUrl": err = unpopulate(val, "DataSchemaURL", &i.DataSchemaURL) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &i.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &i.DisplayName) delete(rawMsg, key) case "documentationUrl": err = unpopulate(val, "DocumentationURL", &i.DocumentationURL) 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 InputSchemaMapping. func (i InputSchemaMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["inputSchemaMappingType"] = i.InputSchemaMappingType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type InputSchemaMapping. func (i *InputSchemaMapping) UnmarshalJSON(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 "inputSchemaMappingType": err = unpopulate(val, "InputSchemaMappingType", &i.InputSchemaMappingType) 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 IsNotNullAdvancedFilter. func (i IsNotNullAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", i.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNotNull return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type IsNotNullAdvancedFilter. func (i *IsNotNullAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &i.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &i.OperatorType) 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 IsNotNullFilter. func (i IsNotNullFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", i.Key) objectMap["operatorType"] = FilterOperatorTypeIsNotNull return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type IsNotNullFilter. func (i *IsNotNullFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &i.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &i.OperatorType) 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 IsNullOrUndefinedAdvancedFilter. func (i IsNullOrUndefinedAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", i.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeIsNullOrUndefined return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type IsNullOrUndefinedAdvancedFilter. func (i *IsNullOrUndefinedAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &i.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &i.OperatorType) 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 IsNullOrUndefinedFilter. func (i IsNullOrUndefinedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", i.Key) objectMap["operatorType"] = FilterOperatorTypeIsNullOrUndefined return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type IsNullOrUndefinedFilter. func (i *IsNullOrUndefinedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &i.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &i.OperatorType) 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 JSONField. func (j JSONField) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "sourceField", j.SourceField) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type JSONField. func (j *JSONField) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { case "sourceField": err = unpopulate(val, "SourceField", &j.SourceField) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type JSONFieldWithDefault. func (j JSONFieldWithDefault) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "defaultValue", j.DefaultValue) populate(objectMap, "sourceField", j.SourceField) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type JSONFieldWithDefault. func (j *JSONFieldWithDefault) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { case "defaultValue": err = unpopulate(val, "DefaultValue", &j.DefaultValue) delete(rawMsg, key) case "sourceField": err = unpopulate(val, "SourceField", &j.SourceField) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMapping. func (j JSONInputSchemaMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["inputSchemaMappingType"] = InputSchemaMappingTypeJSON populate(objectMap, "properties", j.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMapping. func (j *JSONInputSchemaMapping) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { case "inputSchemaMappingType": err = unpopulate(val, "InputSchemaMappingType", &j.InputSchemaMappingType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type JSONInputSchemaMappingProperties. func (j JSONInputSchemaMappingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataVersion", j.DataVersion) populate(objectMap, "eventTime", j.EventTime) populate(objectMap, "eventType", j.EventType) populate(objectMap, "id", j.ID) populate(objectMap, "subject", j.Subject) populate(objectMap, "topic", j.Topic) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type JSONInputSchemaMappingProperties. func (j *JSONInputSchemaMappingProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { case "dataVersion": err = unpopulate(val, "DataVersion", &j.DataVersion) delete(rawMsg, key) case "eventTime": err = unpopulate(val, "EventTime", &j.EventTime) delete(rawMsg, key) case "eventType": err = unpopulate(val, "EventType", &j.EventType) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) case "subject": err = unpopulate(val, "Subject", &j.Subject) delete(rawMsg, key) case "topic": err = unpopulate(val, "Topic", &j.Topic) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type MonitorAlertEventSubscriptionDestination. func (m MonitorAlertEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeMonitorAlert populate(objectMap, "properties", m.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type MonitorAlertEventSubscriptionDestination. func (m *MonitorAlertEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &m.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &m.Properties) 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 MonitorAlertEventSubscriptionDestinationProperties. func (m MonitorAlertEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "actionGroups", m.ActionGroups) populate(objectMap, "description", m.Description) populate(objectMap, "severity", m.Severity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type MonitorAlertEventSubscriptionDestinationProperties. func (m *MonitorAlertEventSubscriptionDestinationProperties) UnmarshalJSON(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 "actionGroups": err = unpopulate(val, "ActionGroups", &m.ActionGroups) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &m.Description) delete(rawMsg, key) case "severity": err = unpopulate(val, "Severity", &m.Severity) 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 Namespace. func (n Namespace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", n.ID) populate(objectMap, "identity", n.Identity) populate(objectMap, "location", n.Location) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) populate(objectMap, "sku", n.SKU) populate(objectMap, "systemData", n.SystemData) populate(objectMap, "tags", n.Tags) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Namespace. func (n *Namespace) UnmarshalJSON(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 "identity": err = unpopulate(val, "Identity", &n.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &n.SKU) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NamespaceProperties. func (n NamespaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "inboundIpRules", n.InboundIPRules) populate(objectMap, "isZoneRedundant", n.IsZoneRedundant) populate(objectMap, "minimumTlsVersionAllowed", n.MinimumTLSVersionAllowed) populate(objectMap, "privateEndpointConnections", n.PrivateEndpointConnections) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) populate(objectMap, "topicSpacesConfiguration", n.TopicSpacesConfiguration) populate(objectMap, "topicsConfiguration", n.TopicsConfiguration) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceProperties. func (n *NamespaceProperties) UnmarshalJSON(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 "inboundIpRules": err = unpopulate(val, "InboundIPRules", &n.InboundIPRules) delete(rawMsg, key) case "isZoneRedundant": err = unpopulate(val, "IsZoneRedundant", &n.IsZoneRedundant) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &n.MinimumTLSVersionAllowed) delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &n.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) delete(rawMsg, key) case "topicSpacesConfiguration": err = unpopulate(val, "TopicSpacesConfiguration", &n.TopicSpacesConfiguration) delete(rawMsg, key) case "topicsConfiguration": err = unpopulate(val, "TopicsConfiguration", &n.TopicsConfiguration) 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 NamespaceRegenerateKeyRequest. func (n NamespaceRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyName", n.KeyName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceRegenerateKeyRequest. func (n *NamespaceRegenerateKeyRequest) UnmarshalJSON(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 "keyName": err = unpopulate(val, "KeyName", &n.KeyName) 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 NamespaceSKU. func (n NamespaceSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacity", n.Capacity) populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceSKU. func (n *NamespaceSKU) UnmarshalJSON(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 "capacity": err = unpopulate(val, "Capacity", &n.Capacity) 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 NamespaceSharedAccessKeys. func (n NamespaceSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key1", n.Key1) populate(objectMap, "key2", n.Key2) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceSharedAccessKeys. func (n *NamespaceSharedAccessKeys) UnmarshalJSON(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 "key1": err = unpopulate(val, "Key1", &n.Key1) delete(rawMsg, key) case "key2": err = unpopulate(val, "Key2", &n.Key2) 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 NamespaceTopic. func (n NamespaceTopic) 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, "systemData", n.SystemData) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopic. func (n *NamespaceTopic) UnmarshalJSON(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 "systemData": err = unpopulate(val, "SystemData", &n.SystemData) 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 NamespaceTopicEventSubscriptionDestination. func (n NamespaceTopicEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeNamespaceTopic populate(objectMap, "properties", n.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicEventSubscriptionDestination. func (n *NamespaceTopicEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &n.EndpointType) 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 NamespaceTopicEventSubscriptionDestinationProperties. func (n NamespaceTopicEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "resourceId", n.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicEventSubscriptionDestinationProperties. func (n *NamespaceTopicEventSubscriptionDestinationProperties) UnmarshalJSON(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 "resourceId": err = unpopulate(val, "ResourceID", &n.ResourceID) 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 NamespaceTopicProperties. func (n NamespaceTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eventRetentionInDays", n.EventRetentionInDays) populate(objectMap, "inputSchema", n.InputSchema) populate(objectMap, "provisioningState", n.ProvisioningState) populate(objectMap, "publisherType", n.PublisherType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicProperties. func (n *NamespaceTopicProperties) UnmarshalJSON(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 "eventRetentionInDays": err = unpopulate(val, "EventRetentionInDays", &n.EventRetentionInDays) delete(rawMsg, key) case "inputSchema": err = unpopulate(val, "InputSchema", &n.InputSchema) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) case "publisherType": err = unpopulate(val, "PublisherType", &n.PublisherType) 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 NamespaceTopicUpdateParameterProperties. func (n NamespaceTopicUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eventRetentionInDays", n.EventRetentionInDays) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicUpdateParameterProperties. func (n *NamespaceTopicUpdateParameterProperties) UnmarshalJSON(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 "eventRetentionInDays": err = unpopulate(val, "EventRetentionInDays", &n.EventRetentionInDays) 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 NamespaceTopicUpdateParameters. func (n NamespaceTopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", n.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceTopicUpdateParameters. func (n *NamespaceTopicUpdateParameters) UnmarshalJSON(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 "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 NamespaceTopicsListResult. func (n NamespaceTopicsListResult) 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 NamespaceTopicsListResult. func (n *NamespaceTopicsListResult) UnmarshalJSON(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 NamespaceUpdateParameterProperties. func (n NamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "inboundIpRules", n.InboundIPRules) populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) populate(objectMap, "topicSpacesConfiguration", n.TopicSpacesConfiguration) populate(objectMap, "topicsConfiguration", n.TopicsConfiguration) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceUpdateParameterProperties. func (n *NamespaceUpdateParameterProperties) UnmarshalJSON(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 "inboundIpRules": err = unpopulate(val, "InboundIPRules", &n.InboundIPRules) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) delete(rawMsg, key) case "topicSpacesConfiguration": err = unpopulate(val, "TopicSpacesConfiguration", &n.TopicSpacesConfiguration) delete(rawMsg, key) case "topicsConfiguration": err = unpopulate(val, "TopicsConfiguration", &n.TopicsConfiguration) 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 NamespaceUpdateParameters. func (n NamespaceUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", n.Identity) populate(objectMap, "properties", n.Properties) populate(objectMap, "sku", n.SKU) populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceUpdateParameters. func (n *NamespaceUpdateParameters) UnmarshalJSON(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 "identity": err = unpopulate(val, "Identity", &n.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "sku": err = unpopulate(val, "SKU", &n.SKU) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type NamespacesListResult. func (n NamespacesListResult) 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 NamespacesListResult. func (n *NamespacesListResult) UnmarshalJSON(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 NumberGreaterThanAdvancedFilter. func (n NumberGreaterThanAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThan populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanAdvancedFilter. func (n *NumberGreaterThanAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberGreaterThanFilter. func (n NumberGreaterThanFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberGreaterThan populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanFilter. func (n *NumberGreaterThanFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberGreaterThanOrEqualsAdvancedFilter. func (n NumberGreaterThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberGreaterThanOrEquals populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanOrEqualsAdvancedFilter. func (n *NumberGreaterThanOrEqualsAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberGreaterThanOrEqualsFilter. func (n NumberGreaterThanOrEqualsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberGreaterThanOrEquals populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberGreaterThanOrEqualsFilter. func (n *NumberGreaterThanOrEqualsFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberInAdvancedFilter. func (n NumberInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberIn populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberInAdvancedFilter. func (n *NumberInAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberInFilter. func (n NumberInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberIn populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberInFilter. func (n *NumberInFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberInRangeAdvancedFilter. func (n NumberInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberInRange populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberInRangeAdvancedFilter. func (n *NumberInRangeAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberInRangeFilter. func (n NumberInRangeFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberInRange populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberInRangeFilter. func (n *NumberInRangeFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberLessThanAdvancedFilter. func (n NumberLessThanAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThan populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanAdvancedFilter. func (n *NumberLessThanAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberLessThanFilter. func (n NumberLessThanFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberLessThan populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanFilter. func (n *NumberLessThanFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberLessThanOrEqualsAdvancedFilter. func (n NumberLessThanOrEqualsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberLessThanOrEquals populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanOrEqualsAdvancedFilter. func (n *NumberLessThanOrEqualsAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberLessThanOrEqualsFilter. func (n NumberLessThanOrEqualsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberLessThanOrEquals populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberLessThanOrEqualsFilter. func (n *NumberLessThanOrEqualsFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) 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 NumberNotInAdvancedFilter. func (n NumberNotInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotIn populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInAdvancedFilter. func (n *NumberNotInAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberNotInFilter. func (n NumberNotInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberNotIn populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInFilter. func (n *NumberNotInFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberNotInRangeAdvancedFilter. func (n NumberNotInRangeAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeNumberNotInRange populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInRangeAdvancedFilter. func (n *NumberNotInRangeAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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 NumberNotInRangeFilter. func (n NumberNotInRangeFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", n.Key) objectMap["operatorType"] = FilterOperatorTypeNumberNotInRange populate(objectMap, "values", n.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type NumberNotInRangeFilter. func (n *NumberNotInRangeFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &n.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &n.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &n.Values) 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, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) populateAny(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Operation. func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) case "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) case "properties": err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type OperationInfo. func (o OperationInfo) 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 OperationInfo. func (o *OperationInfo) UnmarshalJSON(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 OperationsListResult. func (o OperationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. func (o *OperationsListResult) UnmarshalJSON(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 "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 Partner. func (p Partner) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populateDateTimeRFC3339(objectMap, "authorizationExpirationTimeInUtc", p.AuthorizationExpirationTimeInUTC) populate(objectMap, "partnerName", p.PartnerName) populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Partner. func (p *Partner) UnmarshalJSON(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 "authorizationExpirationTimeInUtc": err = unpopulateDateTimeRFC3339(val, "AuthorizationExpirationTimeInUTC", &p.AuthorizationExpirationTimeInUTC) delete(rawMsg, key) case "partnerName": err = unpopulate(val, "PartnerName", &p.PartnerName) delete(rawMsg, key) case "partnerRegistrationImmutableId": err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) 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 PartnerAuthorization. func (p PartnerAuthorization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authorizedPartnersList", p.AuthorizedPartnersList) populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerAuthorization. func (p *PartnerAuthorization) UnmarshalJSON(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 "authorizedPartnersList": err = unpopulate(val, "AuthorizedPartnersList", &p.AuthorizedPartnersList) delete(rawMsg, key) case "defaultMaximumExpirationTimeInDays": err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) 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 PartnerConfiguration. func (p PartnerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfiguration. func (p *PartnerConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationProperties. func (p PartnerConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "partnerAuthorization", p.PartnerAuthorization) populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationProperties. func (p *PartnerConfigurationProperties) UnmarshalJSON(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 "partnerAuthorization": err = unpopulate(val, "PartnerAuthorization", &p.PartnerAuthorization) 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 PartnerConfigurationUpdateParameterProperties. func (p PartnerConfigurationUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameterProperties. func (p *PartnerConfigurationUpdateParameterProperties) UnmarshalJSON(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 "defaultMaximumExpirationTimeInDays": err = unpopulate(val, "DefaultMaximumExpirationTimeInDays", &p.DefaultMaximumExpirationTimeInDays) 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 PartnerConfigurationUpdateParameters. func (p PartnerConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationUpdateParameters. func (p *PartnerConfigurationUpdateParameters) UnmarshalJSON(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 "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationsListResult. func (p PartnerConfigurationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerConfigurationsListResult. func (p *PartnerConfigurationsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerDetails. func (p PartnerDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", p.Description) populate(objectMap, "longDescription", p.LongDescription) populate(objectMap, "setupUri", p.SetupURI) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDetails. func (p *PartnerDetails) UnmarshalJSON(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 "longDescription": err = unpopulate(val, "LongDescription", &p.LongDescription) delete(rawMsg, key) case "setupUri": err = unpopulate(val, "SetupURI", &p.SetupURI) 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 PartnerNamespace. func (p PartnerNamespace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespace. func (p *PartnerNamespace) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceProperties. func (p PartnerNamespaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) populate(objectMap, "endpoint", p.Endpoint) populate(objectMap, "inboundIpRules", p.InboundIPRules) populate(objectMap, "minimumTlsVersionAllowed", p.MinimumTLSVersionAllowed) populate(objectMap, "partnerRegistrationFullyQualifiedId", p.PartnerRegistrationFullyQualifiedID) populate(objectMap, "partnerTopicRoutingMode", p.PartnerTopicRoutingMode) populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceProperties. func (p *PartnerNamespaceProperties) UnmarshalJSON(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 "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) delete(rawMsg, key) case "endpoint": err = unpopulate(val, "Endpoint", &p.Endpoint) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &p.MinimumTLSVersionAllowed) delete(rawMsg, key) case "partnerRegistrationFullyQualifiedId": err = unpopulate(val, "PartnerRegistrationFullyQualifiedID", &p.PartnerRegistrationFullyQualifiedID) delete(rawMsg, key) case "partnerTopicRoutingMode": err = unpopulate(val, "PartnerTopicRoutingMode", &p.PartnerTopicRoutingMode) delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &p.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) 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 PartnerNamespaceRegenerateKeyRequest. func (p PartnerNamespaceRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyName", p.KeyName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceRegenerateKeyRequest. func (p *PartnerNamespaceRegenerateKeyRequest) UnmarshalJSON(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 "keyName": err = unpopulate(val, "KeyName", &p.KeyName) 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 PartnerNamespaceSharedAccessKeys. func (p PartnerNamespaceSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key1", p.Key1) populate(objectMap, "key2", p.Key2) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceSharedAccessKeys. func (p *PartnerNamespaceSharedAccessKeys) UnmarshalJSON(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 "key1": err = unpopulate(val, "Key1", &p.Key1) delete(rawMsg, key) case "key2": err = unpopulate(val, "Key2", &p.Key2) 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 PartnerNamespaceUpdateParameterProperties. func (p PartnerNamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) populate(objectMap, "inboundIpRules", p.InboundIPRules) populate(objectMap, "minimumTlsVersionAllowed", p.MinimumTLSVersionAllowed) populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceUpdateParameterProperties. func (p *PartnerNamespaceUpdateParameterProperties) UnmarshalJSON(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 "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &p.DisableLocalAuth) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &p.InboundIPRules) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &p.MinimumTLSVersionAllowed) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &p.PublicNetworkAccess) 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 PartnerNamespaceUpdateParameters. func (p PartnerNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", p.Properties) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespaceUpdateParameters. func (p *PartnerNamespaceUpdateParameters) UnmarshalJSON(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 "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerNamespacesListResult. func (p PartnerNamespacesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerNamespacesListResult. func (p *PartnerNamespacesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerRegistration. func (p PartnerRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistration. func (p *PartnerRegistration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationProperties. func (p PartnerRegistrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationProperties. func (p *PartnerRegistrationProperties) UnmarshalJSON(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 "partnerRegistrationImmutableId": err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) 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 PartnerRegistrationUpdateParameters. func (p PartnerRegistrationUpdateParameters) 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 PartnerRegistrationUpdateParameters. func (p *PartnerRegistrationUpdateParameters) UnmarshalJSON(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 PartnerRegistrationsListResult. func (p PartnerRegistrationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegistrationsListResult. func (p *PartnerRegistrationsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerTopic. func (p PartnerTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "identity", p.Identity) populate(objectMap, "location", p.Location) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "tags", p.Tags) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopic. func (p *PartnerTopic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &p.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &p.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &p.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerTopicInfo. func (p PartnerTopicInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "azureSubscriptionId", p.AzureSubscriptionID) populate(objectMap, "eventTypeInfo", p.EventTypeInfo) populate(objectMap, "name", p.Name) populate(objectMap, "resourceGroupName", p.ResourceGroupName) populate(objectMap, "source", p.Source) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicInfo. func (p *PartnerTopicInfo) UnmarshalJSON(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 "azureSubscriptionId": err = unpopulate(val, "AzureSubscriptionID", &p.AzureSubscriptionID) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "resourceGroupName": err = unpopulate(val, "ResourceGroupName", &p.ResourceGroupName) delete(rawMsg, key) case "source": err = unpopulate(val, "Source", &p.Source) 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 PartnerTopicProperties. func (p PartnerTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "activationState", p.ActivationState) populate(objectMap, "eventTypeInfo", p.EventTypeInfo) populateDateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) populate(objectMap, "messageForActivation", p.MessageForActivation) populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) populate(objectMap, "partnerTopicFriendlyDescription", p.PartnerTopicFriendlyDescription) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "source", p.Source) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicProperties. func (p *PartnerTopicProperties) UnmarshalJSON(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 "activationState": err = unpopulate(val, "ActivationState", &p.ActivationState) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) delete(rawMsg, key) case "expirationTimeIfNotActivatedUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &p.ExpirationTimeIfNotActivatedUTC) delete(rawMsg, key) case "messageForActivation": err = unpopulate(val, "MessageForActivation", &p.MessageForActivation) delete(rawMsg, key) case "partnerRegistrationImmutableId": err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) delete(rawMsg, key) case "partnerTopicFriendlyDescription": err = unpopulate(val, "PartnerTopicFriendlyDescription", &p.PartnerTopicFriendlyDescription) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "source": err = unpopulate(val, "Source", &p.Source) 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 PartnerTopicUpdateParameters. func (p PartnerTopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", p.Identity) populate(objectMap, "tags", p.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicUpdateParameters. func (p *PartnerTopicUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "identity": err = unpopulate(val, "Identity", &p.Identity) delete(rawMsg, key) case "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 PartnerTopicsListResult. func (p PartnerTopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicsListResult. func (p *PartnerTopicsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PartnerUpdateTopicInfo. func (p PartnerUpdateTopicInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eventTypeInfo", p.EventTypeInfo) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PartnerUpdateTopicInfo. func (p *PartnerUpdateTopicInfo) UnmarshalJSON(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 "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) 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 PermissionBinding. func (p PermissionBinding) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBinding. func (p *PermissionBinding) UnmarshalJSON(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 "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 PermissionBindingProperties. func (p PermissionBindingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientGroupName", p.ClientGroupName) populate(objectMap, "description", p.Description) populate(objectMap, "permission", p.Permission) populate(objectMap, "provisioningState", p.ProvisioningState) populate(objectMap, "topicSpaceName", p.TopicSpaceName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBindingProperties. func (p *PermissionBindingProperties) UnmarshalJSON(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 "clientGroupName": err = unpopulate(val, "ClientGroupName", &p.ClientGroupName) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) case "permission": err = unpopulate(val, "Permission", &p.Permission) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) case "topicSpaceName": err = unpopulate(val, "TopicSpaceName", &p.TopicSpaceName) 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 PermissionBindingsListResult. func (p PermissionBindingsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PermissionBindingsListResult. func (p *PermissionBindingsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type 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, "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 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 "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 PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type 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 "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type 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 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 PrivateLinkResourcesListResult. func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourcesListResult. func (p *PrivateLinkResourcesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type PushInfo. func (p PushInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deadLetterDestinationWithResourceIdentity", p.DeadLetterDestinationWithResourceIdentity) populate(objectMap, "deliveryWithResourceIdentity", p.DeliveryWithResourceIdentity) populate(objectMap, "destination", p.Destination) populate(objectMap, "eventTimeToLive", p.EventTimeToLive) populate(objectMap, "maxDeliveryCount", p.MaxDeliveryCount) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type PushInfo. func (p *PushInfo) UnmarshalJSON(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 "deadLetterDestinationWithResourceIdentity": err = unpopulate(val, "DeadLetterDestinationWithResourceIdentity", &p.DeadLetterDestinationWithResourceIdentity) delete(rawMsg, key) case "deliveryWithResourceIdentity": err = unpopulate(val, "DeliveryWithResourceIdentity", &p.DeliveryWithResourceIdentity) delete(rawMsg, key) case "destination": p.Destination, err = unmarshalEventSubscriptionDestinationClassification(val) delete(rawMsg, key) case "eventTimeToLive": err = unpopulate(val, "EventTimeToLive", &p.EventTimeToLive) delete(rawMsg, key) case "maxDeliveryCount": err = unpopulate(val, "MaxDeliveryCount", &p.MaxDeliveryCount) 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 QueueInfo. func (q QueueInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deadLetterDestinationWithResourceIdentity", q.DeadLetterDestinationWithResourceIdentity) populate(objectMap, "eventTimeToLive", q.EventTimeToLive) populate(objectMap, "maxDeliveryCount", q.MaxDeliveryCount) populate(objectMap, "receiveLockDurationInSeconds", q.ReceiveLockDurationInSeconds) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type QueueInfo. func (q *QueueInfo) UnmarshalJSON(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 "deadLetterDestinationWithResourceIdentity": err = unpopulate(val, "DeadLetterDestinationWithResourceIdentity", &q.DeadLetterDestinationWithResourceIdentity) delete(rawMsg, key) case "eventTimeToLive": err = unpopulate(val, "EventTimeToLive", &q.EventTimeToLive) delete(rawMsg, key) case "maxDeliveryCount": err = unpopulate(val, "MaxDeliveryCount", &q.MaxDeliveryCount) delete(rawMsg, key) case "receiveLockDurationInSeconds": err = unpopulate(val, "ReceiveLockDurationInSeconds", &q.ReceiveLockDurationInSeconds) 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 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 RetryPolicy. func (r RetryPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "eventTimeToLiveInMinutes", r.EventTimeToLiveInMinutes) populate(objectMap, "maxDeliveryAttempts", r.MaxDeliveryAttempts) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type RetryPolicy. func (r *RetryPolicy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "eventTimeToLiveInMinutes": err = unpopulate(val, "EventTimeToLiveInMinutes", &r.EventTimeToLiveInMinutes) delete(rawMsg, key) case "maxDeliveryAttempts": err = unpopulate(val, "MaxDeliveryAttempts", &r.MaxDeliveryAttempts) 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 RoutingEnrichments. func (r RoutingEnrichments) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dynamic", r.Dynamic) populate(objectMap, "static", r.Static) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type RoutingEnrichments. func (r *RoutingEnrichments) UnmarshalJSON(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 "dynamic": err = unpopulate(val, "Dynamic", &r.Dynamic) delete(rawMsg, key) case "static": r.Static, err = unmarshalStaticRoutingEnrichmentClassificationArray(val) 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 RoutingIdentityInfo. func (r RoutingIdentityInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "type", r.Type) populate(objectMap, "userAssignedIdentity", r.UserAssignedIdentity) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type RoutingIdentityInfo. func (r *RoutingIdentityInfo) UnmarshalJSON(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 "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) case "userAssignedIdentity": err = unpopulate(val, "UserAssignedIdentity", &r.UserAssignedIdentity) 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 ServiceBusQueueEventSubscriptionDestination. func (s ServiceBusQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeServiceBusQueue populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestination. func (s *ServiceBusQueueEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. func (s ServiceBusQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusQueueEventSubscriptionDestinationProperties. func (s *ServiceBusQueueEventSubscriptionDestinationProperties) UnmarshalJSON(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 "deliveryAttributeMappings": s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &s.ResourceID) 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 ServiceBusTopicEventSubscriptionDestination. func (s ServiceBusTopicEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeServiceBusTopic populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestination. func (s *ServiceBusTopicEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. func (s ServiceBusTopicEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryAttributeMappings", s.DeliveryAttributeMappings) populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBusTopicEventSubscriptionDestinationProperties. func (s *ServiceBusTopicEventSubscriptionDestinationProperties) UnmarshalJSON(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 "deliveryAttributeMappings": s.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &s.ResourceID) 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 StaticDeliveryAttributeMapping. func (s StaticDeliveryAttributeMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) objectMap["type"] = DeliveryAttributeMappingTypeStatic return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMapping. func (s *StaticDeliveryAttributeMapping) UnmarshalJSON(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 "properties": err = unpopulate(val, "Properties", &s.Properties) 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 StaticDeliveryAttributeMappingProperties. func (s StaticDeliveryAttributeMappingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "isSecret", s.IsSecret) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StaticDeliveryAttributeMappingProperties. func (s *StaticDeliveryAttributeMappingProperties) UnmarshalJSON(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 "isSecret": err = unpopulate(val, "IsSecret", &s.IsSecret) 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 StaticRoutingEnrichment. func (s StaticRoutingEnrichment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["valueType"] = s.ValueType return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StaticRoutingEnrichment. func (s *StaticRoutingEnrichment) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "valueType": err = unpopulate(val, "ValueType", &s.ValueType) 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 StaticStringRoutingEnrichment. func (s StaticStringRoutingEnrichment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) populate(objectMap, "value", s.Value) objectMap["valueType"] = StaticRoutingEnrichmentTypeString return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StaticStringRoutingEnrichment. func (s *StaticStringRoutingEnrichment) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) case "valueType": err = unpopulate(val, "ValueType", &s.ValueType) 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 StorageBlobDeadLetterDestination. func (s StorageBlobDeadLetterDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = DeadLetterEndPointTypeStorageBlob populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestination. func (s *StorageBlobDeadLetterDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageBlobDeadLetterDestinationProperties. func (s StorageBlobDeadLetterDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "blobContainerName", s.BlobContainerName) populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageBlobDeadLetterDestinationProperties. func (s *StorageBlobDeadLetterDestinationProperties) UnmarshalJSON(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 "blobContainerName": err = unpopulate(val, "BlobContainerName", &s.BlobContainerName) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &s.ResourceID) 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 StorageQueueEventSubscriptionDestination. func (s StorageQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeStorageQueue populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestination. func (s *StorageQueueEventSubscriptionDestination) UnmarshalJSON(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 "endpointType": err = unpopulate(val, "EndpointType", &s.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type StorageQueueEventSubscriptionDestinationProperties. func (s StorageQueueEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "queueMessageTimeToLiveInSeconds", s.QueueMessageTimeToLiveInSeconds) populate(objectMap, "queueName", s.QueueName) populate(objectMap, "resourceId", s.ResourceID) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StorageQueueEventSubscriptionDestinationProperties. func (s *StorageQueueEventSubscriptionDestinationProperties) UnmarshalJSON(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 "queueMessageTimeToLiveInSeconds": err = unpopulate(val, "QueueMessageTimeToLiveInSeconds", &s.QueueMessageTimeToLiveInSeconds) delete(rawMsg, key) case "queueName": err = unpopulate(val, "QueueName", &s.QueueName) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &s.ResourceID) 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 StringBeginsWithAdvancedFilter. func (s StringBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringBeginsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringBeginsWithAdvancedFilter. func (s *StringBeginsWithAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringBeginsWithFilter. func (s StringBeginsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringBeginsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringBeginsWithFilter. func (s *StringBeginsWithFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringContainsAdvancedFilter. func (s StringContainsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringContains populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringContainsAdvancedFilter. func (s *StringContainsAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringContainsFilter. func (s StringContainsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringContains populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringContainsFilter. func (s *StringContainsFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringEndsWithAdvancedFilter. func (s StringEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringEndsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringEndsWithAdvancedFilter. func (s *StringEndsWithAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringEndsWithFilter. func (s StringEndsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringEndsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringEndsWithFilter. func (s *StringEndsWithFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringInAdvancedFilter. func (s StringInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringInAdvancedFilter. func (s *StringInAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringInFilter. func (s StringInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringInFilter. func (s *StringInFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotBeginsWithAdvancedFilter. func (s StringNotBeginsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotBeginsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotBeginsWithAdvancedFilter. func (s *StringNotBeginsWithAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotBeginsWithFilter. func (s StringNotBeginsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringNotBeginsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotBeginsWithFilter. func (s *StringNotBeginsWithFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotContainsAdvancedFilter. func (s StringNotContainsAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotContains populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotContainsAdvancedFilter. func (s *StringNotContainsAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotContainsFilter. func (s StringNotContainsFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringNotContains populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotContainsFilter. func (s *StringNotContainsFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotEndsWithAdvancedFilter. func (s StringNotEndsWithAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotEndsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotEndsWithAdvancedFilter. func (s *StringNotEndsWithAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotEndsWithFilter. func (s StringNotEndsWithFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringNotEndsWith populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotEndsWithFilter. func (s *StringNotEndsWithFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotInAdvancedFilter. func (s StringNotInAdvancedFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = AdvancedFilterOperatorTypeStringNotIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotInAdvancedFilter. func (s *StringNotInAdvancedFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 StringNotInFilter. func (s StringNotInFilter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key", s.Key) objectMap["operatorType"] = FilterOperatorTypeStringNotIn populate(objectMap, "values", s.Values) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type StringNotInFilter. func (s *StringNotInFilter) UnmarshalJSON(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 "key": err = unpopulate(val, "Key", &s.Key) delete(rawMsg, key) case "operatorType": err = unpopulate(val, "OperatorType", &s.OperatorType) delete(rawMsg, key) case "values": err = unpopulate(val, "Values", &s.Values) 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 Subscription. func (s Subscription) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Subscription. func (s *Subscription) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SubscriptionFullURL. func (s SubscriptionFullURL) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "endpointUrl", s.EndpointURL) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionFullURL. func (s *SubscriptionFullURL) UnmarshalJSON(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 "endpointUrl": err = unpopulate(val, "EndpointURL", &s.EndpointURL) 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 SubscriptionProperties. func (s SubscriptionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryConfiguration", s.DeliveryConfiguration) populate(objectMap, "eventDeliverySchema", s.EventDeliverySchema) populateDateTimeRFC3339(objectMap, "expirationTimeUtc", s.ExpirationTimeUTC) populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) populate(objectMap, "provisioningState", s.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionProperties. func (s *SubscriptionProperties) UnmarshalJSON(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 "deliveryConfiguration": err = unpopulate(val, "DeliveryConfiguration", &s.DeliveryConfiguration) delete(rawMsg, key) case "eventDeliverySchema": err = unpopulate(val, "EventDeliverySchema", &s.EventDeliverySchema) delete(rawMsg, key) case "expirationTimeUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeUTC", &s.ExpirationTimeUTC) delete(rawMsg, key) case "filtersConfiguration": err = unpopulate(val, "FiltersConfiguration", &s.FiltersConfiguration) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) 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 SubscriptionUpdateParameters. func (s SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "properties", s.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameters. func (s *SubscriptionUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParametersProperties. func (s SubscriptionUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deliveryConfiguration", s.DeliveryConfiguration) populate(objectMap, "eventDeliverySchema", s.EventDeliverySchema) populateDateTimeRFC3339(objectMap, "expirationTimeUtc", s.ExpirationTimeUTC) populate(objectMap, "filtersConfiguration", s.FiltersConfiguration) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParametersProperties. func (s *SubscriptionUpdateParametersProperties) UnmarshalJSON(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 "deliveryConfiguration": err = unpopulate(val, "DeliveryConfiguration", &s.DeliveryConfiguration) delete(rawMsg, key) case "eventDeliverySchema": err = unpopulate(val, "EventDeliverySchema", &s.EventDeliverySchema) delete(rawMsg, key) case "expirationTimeUtc": err = unpopulateDateTimeRFC3339(val, "ExpirationTimeUTC", &s.ExpirationTimeUTC) delete(rawMsg, key) case "filtersConfiguration": err = unpopulate(val, "FiltersConfiguration", &s.FiltersConfiguration) 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 SubscriptionsListResult. func (s SubscriptionsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionsListResult. func (s *SubscriptionsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type 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 SystemTopic. func (s SystemTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopic. func (s *SystemTopic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) 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 SystemTopicProperties. func (s SystemTopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "metricResourceId", s.MetricResourceID) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "source", s.Source) populate(objectMap, "topicType", s.TopicType) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopicProperties. func (s *SystemTopicProperties) UnmarshalJSON(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 "metricResourceId": err = unpopulate(val, "MetricResourceID", &s.MetricResourceID) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) case "source": err = unpopulate(val, "Source", &s.Source) delete(rawMsg, key) case "topicType": err = unpopulate(val, "TopicType", &s.TopicType) 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 SystemTopicUpdateParameters. func (s SystemTopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", s.Identity) populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopicUpdateParameters. func (s *SystemTopicUpdateParameters) UnmarshalJSON(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 "identity": err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) 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 SystemTopicsListResult. func (s SystemTopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type SystemTopicsListResult. func (s *SystemTopicsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type Topic. func (t Topic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type Topic. func (t *Topic) UnmarshalJSON(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 "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "identity": err = unpopulate(val, "Identity", &t.Identity) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TopicProperties. func (t TopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) populate(objectMap, "endpoint", t.Endpoint) populate(objectMap, "eventTypeInfo", t.EventTypeInfo) populate(objectMap, "inboundIpRules", t.InboundIPRules) populate(objectMap, "inputSchema", t.InputSchema) populate(objectMap, "inputSchemaMapping", t.InputSchemaMapping) populate(objectMap, "metricResourceId", t.MetricResourceID) populate(objectMap, "minimumTlsVersionAllowed", t.MinimumTLSVersionAllowed) populate(objectMap, "privateEndpointConnections", t.PrivateEndpointConnections) populate(objectMap, "provisioningState", t.ProvisioningState) populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicProperties. func (t *TopicProperties) UnmarshalJSON(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 "dataResidencyBoundary": err = unpopulate(val, "DataResidencyBoundary", &t.DataResidencyBoundary) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) delete(rawMsg, key) case "endpoint": err = unpopulate(val, "Endpoint", &t.Endpoint) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &t.EventTypeInfo) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &t.InboundIPRules) delete(rawMsg, key) case "inputSchema": err = unpopulate(val, "InputSchema", &t.InputSchema) delete(rawMsg, key) case "inputSchemaMapping": t.InputSchemaMapping, err = unmarshalInputSchemaMappingClassification(val) delete(rawMsg, key) case "metricResourceId": err = unpopulate(val, "MetricResourceID", &t.MetricResourceID) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &t.MinimumTLSVersionAllowed) delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &t.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &t.PublicNetworkAccess) 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 TopicRegenerateKeyRequest. func (t TopicRegenerateKeyRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "keyName", t.KeyName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicRegenerateKeyRequest. func (t *TopicRegenerateKeyRequest) UnmarshalJSON(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 "keyName": err = unpopulate(val, "KeyName", &t.KeyName) 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 TopicSharedAccessKeys. func (t TopicSharedAccessKeys) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "key1", t.Key1) populate(objectMap, "key2", t.Key2) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicSharedAccessKeys. func (t *TopicSharedAccessKeys) UnmarshalJSON(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 "key1": err = unpopulate(val, "Key1", &t.Key1) delete(rawMsg, key) case "key2": err = unpopulate(val, "Key2", &t.Key2) 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 TopicSpace. func (t TopicSpace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpace. func (t *TopicSpace) UnmarshalJSON(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 "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &t.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TopicSpaceProperties. func (t TopicSpaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", t.Description) populate(objectMap, "provisioningState", t.ProvisioningState) populate(objectMap, "topicTemplates", t.TopicTemplates) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpaceProperties. func (t *TopicSpaceProperties) UnmarshalJSON(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 "description": err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) case "topicTemplates": err = unpopulate(val, "TopicTemplates", &t.TopicTemplates) 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 TopicSpacesConfiguration. func (t TopicSpacesConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customDomains", t.CustomDomains) populate(objectMap, "hostname", t.Hostname) populate(objectMap, "maximumClientSessionsPerAuthenticationName", t.MaximumClientSessionsPerAuthenticationName) populate(objectMap, "maximumSessionExpiryInHours", t.MaximumSessionExpiryInHours) populate(objectMap, "routeTopicResourceId", t.RouteTopicResourceID) populate(objectMap, "routingEnrichments", t.RoutingEnrichments) populate(objectMap, "routingIdentityInfo", t.RoutingIdentityInfo) populate(objectMap, "state", t.State) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpacesConfiguration. func (t *TopicSpacesConfiguration) UnmarshalJSON(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 "customDomains": err = unpopulate(val, "CustomDomains", &t.CustomDomains) delete(rawMsg, key) case "hostname": err = unpopulate(val, "Hostname", &t.Hostname) delete(rawMsg, key) case "maximumClientSessionsPerAuthenticationName": err = unpopulate(val, "MaximumClientSessionsPerAuthenticationName", &t.MaximumClientSessionsPerAuthenticationName) delete(rawMsg, key) case "maximumSessionExpiryInHours": err = unpopulate(val, "MaximumSessionExpiryInHours", &t.MaximumSessionExpiryInHours) delete(rawMsg, key) case "routeTopicResourceId": err = unpopulate(val, "RouteTopicResourceID", &t.RouteTopicResourceID) delete(rawMsg, key) case "routingEnrichments": err = unpopulate(val, "RoutingEnrichments", &t.RoutingEnrichments) delete(rawMsg, key) case "routingIdentityInfo": err = unpopulate(val, "RoutingIdentityInfo", &t.RoutingIdentityInfo) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &t.State) 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 TopicSpacesListResult. func (t TopicSpacesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", t.NextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicSpacesListResult. func (t *TopicSpacesListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TopicTypeAdditionalEnforcedPermission. func (t TopicTypeAdditionalEnforcedPermission) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "isDataAction", t.IsDataAction) populate(objectMap, "permissionName", t.PermissionName) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicTypeAdditionalEnforcedPermission. func (t *TopicTypeAdditionalEnforcedPermission) UnmarshalJSON(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 "isDataAction": err = unpopulate(val, "IsDataAction", &t.IsDataAction) delete(rawMsg, key) case "permissionName": err = unpopulate(val, "PermissionName", &t.PermissionName) 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 TopicTypeInfo. func (t TopicTypeInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicTypeInfo. func (t *TopicTypeInfo) UnmarshalJSON(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 "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TopicTypeProperties. func (t TopicTypeProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalEnforcedPermissions", t.AdditionalEnforcedPermissions) populate(objectMap, "areRegionalAndGlobalSourcesSupported", t.AreRegionalAndGlobalSourcesSupported) populate(objectMap, "description", t.Description) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "provider", t.Provider) populate(objectMap, "provisioningState", t.ProvisioningState) populate(objectMap, "resourceRegionType", t.ResourceRegionType) populate(objectMap, "sourceResourceFormat", t.SourceResourceFormat) populate(objectMap, "supportedLocations", t.SupportedLocations) populate(objectMap, "supportedScopesForSource", t.SupportedScopesForSource) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicTypeProperties. func (t *TopicTypeProperties) UnmarshalJSON(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 "additionalEnforcedPermissions": err = unpopulate(val, "AdditionalEnforcedPermissions", &t.AdditionalEnforcedPermissions) delete(rawMsg, key) case "areRegionalAndGlobalSourcesSupported": err = unpopulate(val, "AreRegionalAndGlobalSourcesSupported", &t.AreRegionalAndGlobalSourcesSupported) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &t.DisplayName) delete(rawMsg, key) case "provider": err = unpopulate(val, "Provider", &t.Provider) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) delete(rawMsg, key) case "resourceRegionType": err = unpopulate(val, "ResourceRegionType", &t.ResourceRegionType) delete(rawMsg, key) case "sourceResourceFormat": err = unpopulate(val, "SourceResourceFormat", &t.SourceResourceFormat) delete(rawMsg, key) case "supportedLocations": err = unpopulate(val, "SupportedLocations", &t.SupportedLocations) delete(rawMsg, key) case "supportedScopesForSource": err = unpopulate(val, "SupportedScopesForSource", &t.SupportedScopesForSource) 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 TopicTypesListResult. func (t TopicTypesListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicTypesListResult. func (t *TopicTypesListResult) UnmarshalJSON(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 "value": err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TopicUpdateParameterProperties. func (t TopicUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) populate(objectMap, "eventTypeInfo", t.EventTypeInfo) populate(objectMap, "inboundIpRules", t.InboundIPRules) populate(objectMap, "minimumTlsVersionAllowed", t.MinimumTLSVersionAllowed) populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicUpdateParameterProperties. func (t *TopicUpdateParameterProperties) UnmarshalJSON(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 "dataResidencyBoundary": err = unpopulate(val, "DataResidencyBoundary", &t.DataResidencyBoundary) delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) delete(rawMsg, key) case "eventTypeInfo": err = unpopulate(val, "EventTypeInfo", &t.EventTypeInfo) delete(rawMsg, key) case "inboundIpRules": err = unpopulate(val, "InboundIPRules", &t.InboundIPRules) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &t.MinimumTLSVersionAllowed) delete(rawMsg, key) case "publicNetworkAccess": err = unpopulate(val, "PublicNetworkAccess", &t.PublicNetworkAccess) 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 TopicUpdateParameters. func (t TopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", t.Identity) populate(objectMap, "properties", t.Properties) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicUpdateParameters. func (t *TopicUpdateParameters) UnmarshalJSON(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 "identity": err = unpopulate(val, "Identity", &t.Identity) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) 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 TopicsConfiguration. func (t TopicsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customDomains", t.CustomDomains) populate(objectMap, "hostname", t.Hostname) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicsConfiguration. func (t *TopicsConfiguration) UnmarshalJSON(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 "customDomains": err = unpopulate(val, "CustomDomains", &t.CustomDomains) delete(rawMsg, key) case "hostname": err = unpopulate(val, "Hostname", &t.Hostname) 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 TopicsListResult. func (t TopicsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", t.NextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TopicsListResult. func (t *TopicsListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": err = unpopulate(val, "NextLink", &t.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &t.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. func (t *TrackedResource) UnmarshalJSON(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 "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &t.Location) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type UpdateTopicSpacesConfigurationInfo. func (u UpdateTopicSpacesConfigurationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customDomains", u.CustomDomains) populate(objectMap, "maximumClientSessionsPerAuthenticationName", u.MaximumClientSessionsPerAuthenticationName) populate(objectMap, "maximumSessionExpiryInHours", u.MaximumSessionExpiryInHours) populate(objectMap, "routeTopicResourceId", u.RouteTopicResourceID) populate(objectMap, "routingEnrichments", u.RoutingEnrichments) populate(objectMap, "routingIdentityInfo", u.RoutingIdentityInfo) populate(objectMap, "state", u.State) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UpdateTopicSpacesConfigurationInfo. func (u *UpdateTopicSpacesConfigurationInfo) UnmarshalJSON(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 "customDomains": err = unpopulate(val, "CustomDomains", &u.CustomDomains) delete(rawMsg, key) case "maximumClientSessionsPerAuthenticationName": err = unpopulate(val, "MaximumClientSessionsPerAuthenticationName", &u.MaximumClientSessionsPerAuthenticationName) delete(rawMsg, key) case "maximumSessionExpiryInHours": err = unpopulate(val, "MaximumSessionExpiryInHours", &u.MaximumSessionExpiryInHours) delete(rawMsg, key) case "routeTopicResourceId": err = unpopulate(val, "RouteTopicResourceID", &u.RouteTopicResourceID) delete(rawMsg, key) case "routingEnrichments": err = unpopulate(val, "RoutingEnrichments", &u.RoutingEnrichments) delete(rawMsg, key) case "routingIdentityInfo": err = unpopulate(val, "RoutingIdentityInfo", &u.RoutingIdentityInfo) delete(rawMsg, key) case "state": err = unpopulate(val, "State", &u.State) 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 UpdateTopicsConfigurationInfo. func (u UpdateTopicsConfigurationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "customDomains", u.CustomDomains) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type UpdateTopicsConfigurationInfo. func (u *UpdateTopicsConfigurationInfo) UnmarshalJSON(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 "customDomains": err = unpopulate(val, "CustomDomains", &u.CustomDomains) 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 UserIdentityProperties. func (u UserIdentityProperties) 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 UserIdentityProperties. func (u *UserIdentityProperties) UnmarshalJSON(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 VerifiedPartner. func (v VerifiedPartner) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", v.ID) populate(objectMap, "name", v.Name) populate(objectMap, "properties", v.Properties) populate(objectMap, "systemData", v.SystemData) populate(objectMap, "type", v.Type) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type VerifiedPartner. func (v *VerifiedPartner) UnmarshalJSON(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 "name": err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &v.Properties) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &v.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type VerifiedPartnerProperties. func (v VerifiedPartnerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "organizationName", v.OrganizationName) populate(objectMap, "partnerDisplayName", v.PartnerDisplayName) populate(objectMap, "partnerRegistrationImmutableId", v.PartnerRegistrationImmutableID) populate(objectMap, "partnerTopicDetails", v.PartnerTopicDetails) populate(objectMap, "provisioningState", v.ProvisioningState) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type VerifiedPartnerProperties. func (v *VerifiedPartnerProperties) UnmarshalJSON(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 "organizationName": err = unpopulate(val, "OrganizationName", &v.OrganizationName) delete(rawMsg, key) case "partnerDisplayName": err = unpopulate(val, "PartnerDisplayName", &v.PartnerDisplayName) delete(rawMsg, key) case "partnerRegistrationImmutableId": err = unpopulate(val, "PartnerRegistrationImmutableID", &v.PartnerRegistrationImmutableID) delete(rawMsg, key) case "partnerTopicDetails": err = unpopulate(val, "PartnerTopicDetails", &v.PartnerTopicDetails) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &v.ProvisioningState) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type VerifiedPartnersListResult. func (v VerifiedPartnersListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type VerifiedPartnersListResult. func (v *VerifiedPartnersListResult) UnmarshalJSON(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 "nextLink": err = unpopulate(val, "NextLink", &v.NextLink) delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &v.Value) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WebHookEventSubscriptionDestination. func (w WebHookEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["endpointType"] = EndpointTypeWebHook populate(objectMap, "properties", w.Properties) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WebHookEventSubscriptionDestination. func (w *WebHookEventSubscriptionDestination) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "endpointType": err = unpopulate(val, "EndpointType", &w.EndpointType) delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &w.Properties) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } // MarshalJSON implements the json.Marshaller interface for type WebHookEventSubscriptionDestinationProperties. func (w WebHookEventSubscriptionDestinationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "azureActiveDirectoryApplicationIdOrUri", w.AzureActiveDirectoryApplicationIDOrURI) populate(objectMap, "azureActiveDirectoryTenantId", w.AzureActiveDirectoryTenantID) populate(objectMap, "deliveryAttributeMappings", w.DeliveryAttributeMappings) populate(objectMap, "endpointBaseUrl", w.EndpointBaseURL) populate(objectMap, "endpointUrl", w.EndpointURL) populate(objectMap, "maxEventsPerBatch", w.MaxEventsPerBatch) populate(objectMap, "minimumTlsVersionAllowed", w.MinimumTLSVersionAllowed) populate(objectMap, "preferredBatchSizeInKilobytes", w.PreferredBatchSizeInKilobytes) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type WebHookEventSubscriptionDestinationProperties. func (w *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "azureActiveDirectoryApplicationIdOrUri": err = unpopulate(val, "AzureActiveDirectoryApplicationIDOrURI", &w.AzureActiveDirectoryApplicationIDOrURI) delete(rawMsg, key) case "azureActiveDirectoryTenantId": err = unpopulate(val, "AzureActiveDirectoryTenantID", &w.AzureActiveDirectoryTenantID) delete(rawMsg, key) case "deliveryAttributeMappings": w.DeliveryAttributeMappings, err = unmarshalDeliveryAttributeMappingClassificationArray(val) delete(rawMsg, key) case "endpointBaseUrl": err = unpopulate(val, "EndpointBaseURL", &w.EndpointBaseURL) delete(rawMsg, key) case "endpointUrl": err = unpopulate(val, "EndpointURL", &w.EndpointURL) delete(rawMsg, key) case "maxEventsPerBatch": err = unpopulate(val, "MaxEventsPerBatch", &w.MaxEventsPerBatch) delete(rawMsg, key) case "minimumTlsVersionAllowed": err = unpopulate(val, "MinimumTLSVersionAllowed", &w.MinimumTLSVersionAllowed) delete(rawMsg, key) case "preferredBatchSizeInKilobytes": err = unpopulate(val, "PreferredBatchSizeInKilobytes", &w.PreferredBatchSizeInKilobytes) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", w, 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 }