sdk/resourcemanager/containerregistry/armcontainerregistry/models_serde.go (7,026 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 armcontainerregistry
import (
"encoding/json"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"reflect"
)
// MarshalJSON implements the json.Marshaller interface for type ActivationProperties.
func (a ActivationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", a.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ActivationProperties.
func (a *ActivationProperties) UnmarshalJSON(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 "status":
err = unpopulate(val, "Status", &a.Status)
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 Actor.
func (a Actor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", a.Name)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Actor.
func (a *Actor) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &a.Name)
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 AgentPool.
func (a AgentPool) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", a.ID)
populate(objectMap, "location", a.Location)
populate(objectMap, "name", a.Name)
populate(objectMap, "properties", a.Properties)
populate(objectMap, "systemData", a.SystemData)
populate(objectMap, "tags", a.Tags)
populate(objectMap, "type", a.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPool.
func (a *AgentPool) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &a.ID)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &a.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &a.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &a.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &a.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &a.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult.
func (a AgentPoolListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", a.NextLink)
populate(objectMap, "value", a.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolListResult.
func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &a.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &a.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AgentPoolProperties.
func (a AgentPoolProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", a.Count)
populate(objectMap, "os", a.OS)
populate(objectMap, "provisioningState", a.ProvisioningState)
populate(objectMap, "tier", a.Tier)
populate(objectMap, "virtualNetworkSubnetResourceId", a.VirtualNetworkSubnetResourceID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolProperties.
func (a *AgentPoolProperties) UnmarshalJSON(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 "count":
err = unpopulate(val, "Count", &a.Count)
delete(rawMsg, key)
case "os":
err = unpopulate(val, "OS", &a.OS)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
delete(rawMsg, key)
case "tier":
err = unpopulate(val, "Tier", &a.Tier)
delete(rawMsg, key)
case "virtualNetworkSubnetResourceId":
err = unpopulate(val, "VirtualNetworkSubnetResourceID", &a.VirtualNetworkSubnetResourceID)
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 AgentPoolPropertiesUpdateParameters.
func (a AgentPoolPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", a.Count)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolPropertiesUpdateParameters.
func (a *AgentPoolPropertiesUpdateParameters) UnmarshalJSON(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 "count":
err = unpopulate(val, "Count", &a.Count)
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 AgentPoolQueueStatus.
func (a AgentPoolQueueStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "count", a.Count)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolQueueStatus.
func (a *AgentPoolQueueStatus) UnmarshalJSON(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 "count":
err = unpopulate(val, "Count", &a.Count)
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 AgentPoolUpdateParameters.
func (a AgentPoolUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "properties", a.Properties)
populate(objectMap, "tags", a.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolUpdateParameters.
func (a *AgentPoolUpdateParameters) UnmarshalJSON(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 "properties":
err = unpopulate(val, "Properties", &a.Properties)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &a.Tags)
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 AgentProperties.
func (a AgentProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "cpu", a.CPU)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AgentProperties.
func (a *AgentProperties) UnmarshalJSON(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 "cpu":
err = unpopulate(val, "CPU", &a.CPU)
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 Archive.
func (a Archive) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", a.ID)
populate(objectMap, "name", a.Name)
populate(objectMap, "properties", a.Properties)
populate(objectMap, "systemData", a.SystemData)
populate(objectMap, "type", a.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Archive.
func (a *Archive) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &a.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &a.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &a.SystemData)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &a.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ArchiveListResult.
func (a ArchiveListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", a.NextLink)
populate(objectMap, "value", a.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveListResult.
func (a *ArchiveListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &a.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &a.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ArchivePackageSourceProperties.
func (a ArchivePackageSourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "type", a.Type)
populate(objectMap, "url", a.URL)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchivePackageSourceProperties.
func (a *ArchivePackageSourceProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "type":
err = unpopulate(val, "Type", &a.Type)
delete(rawMsg, key)
case "url":
err = unpopulate(val, "URL", &a.URL)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ArchiveProperties.
func (a ArchiveProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "packageSource", a.PackageSource)
populate(objectMap, "provisioningState", a.ProvisioningState)
populate(objectMap, "publishedVersion", a.PublishedVersion)
populate(objectMap, "repositoryEndpoint", a.RepositoryEndpoint)
populate(objectMap, "repositoryEndpointPrefix", a.RepositoryEndpointPrefix)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveProperties.
func (a *ArchiveProperties) UnmarshalJSON(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 "packageSource":
err = unpopulate(val, "PackageSource", &a.PackageSource)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
delete(rawMsg, key)
case "publishedVersion":
err = unpopulate(val, "PublishedVersion", &a.PublishedVersion)
delete(rawMsg, key)
case "repositoryEndpoint":
err = unpopulate(val, "RepositoryEndpoint", &a.RepositoryEndpoint)
delete(rawMsg, key)
case "repositoryEndpointPrefix":
err = unpopulate(val, "RepositoryEndpointPrefix", &a.RepositoryEndpointPrefix)
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 ArchiveUpdateParameters.
func (a ArchiveUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "properties", a.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveUpdateParameters.
func (a *ArchiveUpdateParameters) UnmarshalJSON(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 "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 ArchiveUpdateProperties.
func (a ArchiveUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "publishedVersion", a.PublishedVersion)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveUpdateProperties.
func (a *ArchiveUpdateProperties) UnmarshalJSON(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 "publishedVersion":
err = unpopulate(val, "PublishedVersion", &a.PublishedVersion)
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 ArchiveVersion.
func (a ArchiveVersion) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", a.ID)
populate(objectMap, "name", a.Name)
populate(objectMap, "properties", a.Properties)
populate(objectMap, "systemData", a.SystemData)
populate(objectMap, "type", a.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveVersion.
func (a *ArchiveVersion) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &a.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &a.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &a.SystemData)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &a.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ArchiveVersionListResult.
func (a ArchiveVersionListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", a.NextLink)
populate(objectMap, "value", a.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveVersionListResult.
func (a *ArchiveVersionListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &a.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &a.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ArchiveVersionProperties.
func (a ArchiveVersionProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "archiveVersionErrorMessage", a.ArchiveVersionErrorMessage)
populate(objectMap, "provisioningState", a.ProvisioningState)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ArchiveVersionProperties.
func (a *ArchiveVersionProperties) UnmarshalJSON(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 "archiveVersionErrorMessage":
err = unpopulate(val, "ArchiveVersionErrorMessage", &a.ArchiveVersionErrorMessage)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &a.ProvisioningState)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Argument.
func (a Argument) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isSecret", a.IsSecret)
populate(objectMap, "name", a.Name)
populate(objectMap, "value", a.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Argument.
func (a *Argument) UnmarshalJSON(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 "isSecret":
err = unpopulate(val, "IsSecret", &a.IsSecret)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &a.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", a, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type AuthCredential.
func (a AuthCredential) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "credentialHealth", a.CredentialHealth)
populate(objectMap, "name", a.Name)
populate(objectMap, "passwordSecretIdentifier", a.PasswordSecretIdentifier)
populate(objectMap, "usernameSecretIdentifier", a.UsernameSecretIdentifier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AuthCredential.
func (a *AuthCredential) UnmarshalJSON(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 "credentialHealth":
err = unpopulate(val, "CredentialHealth", &a.CredentialHealth)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &a.Name)
delete(rawMsg, key)
case "passwordSecretIdentifier":
err = unpopulate(val, "PasswordSecretIdentifier", &a.PasswordSecretIdentifier)
delete(rawMsg, key)
case "usernameSecretIdentifier":
err = unpopulate(val, "UsernameSecretIdentifier", &a.UsernameSecretIdentifier)
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 AuthInfo.
func (a AuthInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "expiresIn", a.ExpiresIn)
populate(objectMap, "refreshToken", a.RefreshToken)
populate(objectMap, "scope", a.Scope)
populate(objectMap, "token", a.Token)
populate(objectMap, "tokenType", a.TokenType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfo.
func (a *AuthInfo) UnmarshalJSON(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 "expiresIn":
err = unpopulate(val, "ExpiresIn", &a.ExpiresIn)
delete(rawMsg, key)
case "refreshToken":
err = unpopulate(val, "RefreshToken", &a.RefreshToken)
delete(rawMsg, key)
case "scope":
err = unpopulate(val, "Scope", &a.Scope)
delete(rawMsg, key)
case "token":
err = unpopulate(val, "Token", &a.Token)
delete(rawMsg, key)
case "tokenType":
err = unpopulate(val, "TokenType", &a.TokenType)
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 AuthInfoUpdateParameters.
func (a AuthInfoUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "expiresIn", a.ExpiresIn)
populate(objectMap, "refreshToken", a.RefreshToken)
populate(objectMap, "scope", a.Scope)
populate(objectMap, "token", a.Token)
populate(objectMap, "tokenType", a.TokenType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfoUpdateParameters.
func (a *AuthInfoUpdateParameters) UnmarshalJSON(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 "expiresIn":
err = unpopulate(val, "ExpiresIn", &a.ExpiresIn)
delete(rawMsg, key)
case "refreshToken":
err = unpopulate(val, "RefreshToken", &a.RefreshToken)
delete(rawMsg, key)
case "scope":
err = unpopulate(val, "Scope", &a.Scope)
delete(rawMsg, key)
case "token":
err = unpopulate(val, "Token", &a.Token)
delete(rawMsg, key)
case "tokenType":
err = unpopulate(val, "TokenType", &a.TokenType)
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 AzureADAuthenticationAsArmPolicy.
func (a AzureADAuthenticationAsArmPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", a.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADAuthenticationAsArmPolicy.
func (a *AzureADAuthenticationAsArmPolicy) UnmarshalJSON(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 "status":
err = unpopulate(val, "Status", &a.Status)
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 BaseImageDependency.
func (b BaseImageDependency) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "digest", b.Digest)
populate(objectMap, "registry", b.Registry)
populate(objectMap, "repository", b.Repository)
populate(objectMap, "tag", b.Tag)
populate(objectMap, "type", b.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageDependency.
func (b *BaseImageDependency) UnmarshalJSON(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 "digest":
err = unpopulate(val, "Digest", &b.Digest)
delete(rawMsg, key)
case "registry":
err = unpopulate(val, "Registry", &b.Registry)
delete(rawMsg, key)
case "repository":
err = unpopulate(val, "Repository", &b.Repository)
delete(rawMsg, key)
case "tag":
err = unpopulate(val, "Tag", &b.Tag)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &b.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", b, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type BaseImageTrigger.
func (b BaseImageTrigger) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageTriggerType", b.BaseImageTriggerType)
populate(objectMap, "name", b.Name)
populate(objectMap, "status", b.Status)
populate(objectMap, "updateTriggerEndpoint", b.UpdateTriggerEndpoint)
populate(objectMap, "updateTriggerPayloadType", b.UpdateTriggerPayloadType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTrigger.
func (b *BaseImageTrigger) UnmarshalJSON(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 "baseImageTriggerType":
err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &b.Name)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &b.Status)
delete(rawMsg, key)
case "updateTriggerEndpoint":
err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint)
delete(rawMsg, key)
case "updateTriggerPayloadType":
err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType)
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 BaseImageTriggerUpdateParameters.
func (b BaseImageTriggerUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageTriggerType", b.BaseImageTriggerType)
populate(objectMap, "name", b.Name)
populate(objectMap, "status", b.Status)
populate(objectMap, "updateTriggerEndpoint", b.UpdateTriggerEndpoint)
populate(objectMap, "updateTriggerPayloadType", b.UpdateTriggerPayloadType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTriggerUpdateParameters.
func (b *BaseImageTriggerUpdateParameters) UnmarshalJSON(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 "baseImageTriggerType":
err = unpopulate(val, "BaseImageTriggerType", &b.BaseImageTriggerType)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &b.Name)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &b.Status)
delete(rawMsg, key)
case "updateTriggerEndpoint":
err = unpopulate(val, "UpdateTriggerEndpoint", &b.UpdateTriggerEndpoint)
delete(rawMsg, key)
case "updateTriggerPayloadType":
err = unpopulate(val, "UpdateTriggerPayloadType", &b.UpdateTriggerPayloadType)
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 CacheRule.
func (c CacheRule) 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 CacheRule.
func (c *CacheRule) UnmarshalJSON(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 CacheRuleProperties.
func (c CacheRuleProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "creationDate", c.CreationDate)
populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID)
populate(objectMap, "provisioningState", c.ProvisioningState)
populate(objectMap, "sourceRepository", c.SourceRepository)
populate(objectMap, "targetRepository", c.TargetRepository)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleProperties.
func (c *CacheRuleProperties) UnmarshalJSON(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 "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate)
delete(rawMsg, key)
case "credentialSetResourceId":
err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
delete(rawMsg, key)
case "sourceRepository":
err = unpopulate(val, "SourceRepository", &c.SourceRepository)
delete(rawMsg, key)
case "targetRepository":
err = unpopulate(val, "TargetRepository", &c.TargetRepository)
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 CacheRuleUpdateParameters.
func (c CacheRuleUpdateParameters) 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 CacheRuleUpdateParameters.
func (c *CacheRuleUpdateParameters) UnmarshalJSON(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 CacheRuleUpdateProperties.
func (c CacheRuleUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "credentialSetResourceId", c.CredentialSetResourceID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateProperties.
func (c *CacheRuleUpdateProperties) UnmarshalJSON(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 "credentialSetResourceId":
err = unpopulate(val, "CredentialSetResourceID", &c.CredentialSetResourceID)
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 CacheRulesListResult.
func (c CacheRulesListResult) 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 CacheRulesListResult.
func (c *CacheRulesListResult) UnmarshalJSON(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 CallbackConfig.
func (c CallbackConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "customHeaders", c.CustomHeaders)
populate(objectMap, "serviceUri", c.ServiceURI)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CallbackConfig.
func (c *CallbackConfig) UnmarshalJSON(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 "customHeaders":
err = unpopulate(val, "CustomHeaders", &c.CustomHeaders)
delete(rawMsg, key)
case "serviceUri":
err = unpopulate(val, "ServiceURI", &c.ServiceURI)
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 ConnectedRegistry.
func (c ConnectedRegistry) 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 ConnectedRegistry.
func (c *ConnectedRegistry) UnmarshalJSON(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 ConnectedRegistryListResult.
func (c ConnectedRegistryListResult) 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 ConnectedRegistryListResult.
func (c *ConnectedRegistryListResult) UnmarshalJSON(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 ConnectedRegistryProperties.
func (c ConnectedRegistryProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "activation", c.Activation)
populate(objectMap, "clientTokenIds", c.ClientTokenIDs)
populate(objectMap, "connectionState", c.ConnectionState)
populate(objectMap, "garbageCollection", c.GarbageCollection)
populateDateTimeRFC3339(objectMap, "lastActivityTime", c.LastActivityTime)
populate(objectMap, "logging", c.Logging)
populate(objectMap, "loginServer", c.LoginServer)
populate(objectMap, "mode", c.Mode)
populate(objectMap, "notificationsList", c.NotificationsList)
populate(objectMap, "parent", c.Parent)
populate(objectMap, "provisioningState", c.ProvisioningState)
populate(objectMap, "statusDetails", c.StatusDetails)
populate(objectMap, "version", c.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryProperties.
func (c *ConnectedRegistryProperties) UnmarshalJSON(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 "activation":
err = unpopulate(val, "Activation", &c.Activation)
delete(rawMsg, key)
case "clientTokenIds":
err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs)
delete(rawMsg, key)
case "connectionState":
err = unpopulate(val, "ConnectionState", &c.ConnectionState)
delete(rawMsg, key)
case "garbageCollection":
err = unpopulate(val, "GarbageCollection", &c.GarbageCollection)
delete(rawMsg, key)
case "lastActivityTime":
err = unpopulateDateTimeRFC3339(val, "LastActivityTime", &c.LastActivityTime)
delete(rawMsg, key)
case "logging":
err = unpopulate(val, "Logging", &c.Logging)
delete(rawMsg, key)
case "loginServer":
err = unpopulate(val, "LoginServer", &c.LoginServer)
delete(rawMsg, key)
case "mode":
err = unpopulate(val, "Mode", &c.Mode)
delete(rawMsg, key)
case "notificationsList":
err = unpopulate(val, "NotificationsList", &c.NotificationsList)
delete(rawMsg, key)
case "parent":
err = unpopulate(val, "Parent", &c.Parent)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &c.ProvisioningState)
delete(rawMsg, key)
case "statusDetails":
err = unpopulate(val, "StatusDetails", &c.StatusDetails)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &c.Version)
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 ConnectedRegistryUpdateParameters.
func (c ConnectedRegistryUpdateParameters) 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 ConnectedRegistryUpdateParameters.
func (c *ConnectedRegistryUpdateParameters) UnmarshalJSON(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 ConnectedRegistryUpdateProperties.
func (c ConnectedRegistryUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "clientTokenIds", c.ClientTokenIDs)
populate(objectMap, "garbageCollection", c.GarbageCollection)
populate(objectMap, "logging", c.Logging)
populate(objectMap, "notificationsList", c.NotificationsList)
populate(objectMap, "syncProperties", c.SyncProperties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedRegistryUpdateProperties.
func (c *ConnectedRegistryUpdateProperties) UnmarshalJSON(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 "clientTokenIds":
err = unpopulate(val, "ClientTokenIDs", &c.ClientTokenIDs)
delete(rawMsg, key)
case "garbageCollection":
err = unpopulate(val, "GarbageCollection", &c.GarbageCollection)
delete(rawMsg, key)
case "logging":
err = unpopulate(val, "Logging", &c.Logging)
delete(rawMsg, key)
case "notificationsList":
err = unpopulate(val, "NotificationsList", &c.NotificationsList)
delete(rawMsg, key)
case "syncProperties":
err = unpopulate(val, "SyncProperties", &c.SyncProperties)
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 CredentialHealth.
func (c CredentialHealth) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "errorCode", c.ErrorCode)
populate(objectMap, "errorMessage", c.ErrorMessage)
populate(objectMap, "status", c.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialHealth.
func (c *CredentialHealth) UnmarshalJSON(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 "errorCode":
err = unpopulate(val, "ErrorCode", &c.ErrorCode)
delete(rawMsg, key)
case "errorMessage":
err = unpopulate(val, "ErrorMessage", &c.ErrorMessage)
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 CredentialSet.
func (c CredentialSet) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", c.ID)
populate(objectMap, "identity", c.Identity)
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 CredentialSet.
func (c *CredentialSet) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &c.Identity)
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 CredentialSetListResult.
func (c CredentialSetListResult) 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 CredentialSetListResult.
func (c *CredentialSetListResult) UnmarshalJSON(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 CredentialSetProperties.
func (c CredentialSetProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "authCredentials", c.AuthCredentials)
populateDateTimeRFC3339(objectMap, "creationDate", c.CreationDate)
populate(objectMap, "loginServer", c.LoginServer)
populate(objectMap, "provisioningState", c.ProvisioningState)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetProperties.
func (c *CredentialSetProperties) UnmarshalJSON(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 "authCredentials":
err = unpopulate(val, "AuthCredentials", &c.AuthCredentials)
delete(rawMsg, key)
case "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &c.CreationDate)
delete(rawMsg, key)
case "loginServer":
err = unpopulate(val, "LoginServer", &c.LoginServer)
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 CredentialSetUpdateParameters.
func (c CredentialSetUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", c.Identity)
populate(objectMap, "properties", c.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateParameters.
func (c *CredentialSetUpdateParameters) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &c.Identity)
delete(rawMsg, 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 CredentialSetUpdateProperties.
func (c CredentialSetUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "authCredentials", c.AuthCredentials)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateProperties.
func (c *CredentialSetUpdateProperties) UnmarshalJSON(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 "authCredentials":
err = unpopulate(val, "AuthCredentials", &c.AuthCredentials)
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 Credentials.
func (c Credentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "customRegistries", c.CustomRegistries)
populate(objectMap, "sourceRegistry", c.SourceRegistry)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Credentials.
func (c *Credentials) UnmarshalJSON(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 "customRegistries":
err = unpopulate(val, "CustomRegistries", &c.CustomRegistries)
delete(rawMsg, key)
case "sourceRegistry":
err = unpopulate(val, "SourceRegistry", &c.SourceRegistry)
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 CustomRegistryCredentials.
func (c CustomRegistryCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", c.Identity)
populate(objectMap, "password", c.Password)
populate(objectMap, "userName", c.UserName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRegistryCredentials.
func (c *CustomRegistryCredentials) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &c.Identity)
delete(rawMsg, key)
case "password":
err = unpopulate(val, "Password", &c.Password)
delete(rawMsg, key)
case "userName":
err = unpopulate(val, "UserName", &c.UserName)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", c, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type DockerBuildRequest.
func (d DockerBuildRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", d.AgentConfiguration)
populate(objectMap, "agentPoolName", d.AgentPoolName)
populate(objectMap, "arguments", d.Arguments)
populate(objectMap, "credentials", d.Credentials)
populate(objectMap, "dockerFilePath", d.DockerFilePath)
populate(objectMap, "imageNames", d.ImageNames)
populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled)
populate(objectMap, "isPushEnabled", d.IsPushEnabled)
populate(objectMap, "logTemplate", d.LogTemplate)
populate(objectMap, "noCache", d.NoCache)
populate(objectMap, "platform", d.Platform)
populate(objectMap, "sourceLocation", d.SourceLocation)
populate(objectMap, "target", d.Target)
populate(objectMap, "timeout", d.Timeout)
objectMap["type"] = "DockerBuildRequest"
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildRequest.
func (d *DockerBuildRequest) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &d.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &d.AgentPoolName)
delete(rawMsg, key)
case "arguments":
err = unpopulate(val, "Arguments", &d.Arguments)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &d.Credentials)
delete(rawMsg, key)
case "dockerFilePath":
err = unpopulate(val, "DockerFilePath", &d.DockerFilePath)
delete(rawMsg, key)
case "imageNames":
err = unpopulate(val, "ImageNames", &d.ImageNames)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled)
delete(rawMsg, key)
case "isPushEnabled":
err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &d.LogTemplate)
delete(rawMsg, key)
case "noCache":
err = unpopulate(val, "NoCache", &d.NoCache)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &d.Platform)
delete(rawMsg, key)
case "sourceLocation":
err = unpopulate(val, "SourceLocation", &d.SourceLocation)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &d.Target)
delete(rawMsg, key)
case "timeout":
err = unpopulate(val, "Timeout", &d.Timeout)
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 DockerBuildStep.
func (d DockerBuildStep) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "arguments", d.Arguments)
populate(objectMap, "baseImageDependencies", d.BaseImageDependencies)
populate(objectMap, "contextAccessToken", d.ContextAccessToken)
populate(objectMap, "contextPath", d.ContextPath)
populate(objectMap, "dockerFilePath", d.DockerFilePath)
populate(objectMap, "imageNames", d.ImageNames)
populate(objectMap, "isPushEnabled", d.IsPushEnabled)
populate(objectMap, "noCache", d.NoCache)
populate(objectMap, "target", d.Target)
objectMap["type"] = StepTypeDocker
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStep.
func (d *DockerBuildStep) UnmarshalJSON(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 "arguments":
err = unpopulate(val, "Arguments", &d.Arguments)
delete(rawMsg, key)
case "baseImageDependencies":
err = unpopulate(val, "BaseImageDependencies", &d.BaseImageDependencies)
delete(rawMsg, key)
case "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &d.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &d.ContextPath)
delete(rawMsg, key)
case "dockerFilePath":
err = unpopulate(val, "DockerFilePath", &d.DockerFilePath)
delete(rawMsg, key)
case "imageNames":
err = unpopulate(val, "ImageNames", &d.ImageNames)
delete(rawMsg, key)
case "isPushEnabled":
err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled)
delete(rawMsg, key)
case "noCache":
err = unpopulate(val, "NoCache", &d.NoCache)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &d.Target)
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 DockerBuildStepUpdateParameters.
func (d DockerBuildStepUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "arguments", d.Arguments)
populate(objectMap, "contextAccessToken", d.ContextAccessToken)
populate(objectMap, "contextPath", d.ContextPath)
populate(objectMap, "dockerFilePath", d.DockerFilePath)
populate(objectMap, "imageNames", d.ImageNames)
populate(objectMap, "isPushEnabled", d.IsPushEnabled)
populate(objectMap, "noCache", d.NoCache)
populate(objectMap, "target", d.Target)
objectMap["type"] = StepTypeDocker
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStepUpdateParameters.
func (d *DockerBuildStepUpdateParameters) UnmarshalJSON(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 "arguments":
err = unpopulate(val, "Arguments", &d.Arguments)
delete(rawMsg, key)
case "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &d.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &d.ContextPath)
delete(rawMsg, key)
case "dockerFilePath":
err = unpopulate(val, "DockerFilePath", &d.DockerFilePath)
delete(rawMsg, key)
case "imageNames":
err = unpopulate(val, "ImageNames", &d.ImageNames)
delete(rawMsg, key)
case "isPushEnabled":
err = unpopulate(val, "IsPushEnabled", &d.IsPushEnabled)
delete(rawMsg, key)
case "noCache":
err = unpopulate(val, "NoCache", &d.NoCache)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &d.Target)
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 EncodedTaskRunRequest.
func (e EncodedTaskRunRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", e.AgentConfiguration)
populate(objectMap, "agentPoolName", e.AgentPoolName)
populate(objectMap, "credentials", e.Credentials)
populate(objectMap, "encodedTaskContent", e.EncodedTaskContent)
populate(objectMap, "encodedValuesContent", e.EncodedValuesContent)
populate(objectMap, "isArchiveEnabled", e.IsArchiveEnabled)
populate(objectMap, "logTemplate", e.LogTemplate)
populate(objectMap, "platform", e.Platform)
populate(objectMap, "sourceLocation", e.SourceLocation)
populate(objectMap, "timeout", e.Timeout)
objectMap["type"] = "EncodedTaskRunRequest"
populate(objectMap, "values", e.Values)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskRunRequest.
func (e *EncodedTaskRunRequest) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &e.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &e.AgentPoolName)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &e.Credentials)
delete(rawMsg, key)
case "encodedTaskContent":
err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent)
delete(rawMsg, key)
case "encodedValuesContent":
err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &e.IsArchiveEnabled)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &e.LogTemplate)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &e.Platform)
delete(rawMsg, key)
case "sourceLocation":
err = unpopulate(val, "SourceLocation", &e.SourceLocation)
delete(rawMsg, key)
case "timeout":
err = unpopulate(val, "Timeout", &e.Timeout)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &e.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &e.Values)
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 EncodedTaskStep.
func (e EncodedTaskStep) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageDependencies", e.BaseImageDependencies)
populate(objectMap, "contextAccessToken", e.ContextAccessToken)
populate(objectMap, "contextPath", e.ContextPath)
populate(objectMap, "encodedTaskContent", e.EncodedTaskContent)
populate(objectMap, "encodedValuesContent", e.EncodedValuesContent)
objectMap["type"] = StepTypeEncodedTask
populate(objectMap, "values", e.Values)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStep.
func (e *EncodedTaskStep) UnmarshalJSON(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 "baseImageDependencies":
err = unpopulate(val, "BaseImageDependencies", &e.BaseImageDependencies)
delete(rawMsg, key)
case "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &e.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &e.ContextPath)
delete(rawMsg, key)
case "encodedTaskContent":
err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent)
delete(rawMsg, key)
case "encodedValuesContent":
err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &e.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &e.Values)
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 EncodedTaskStepUpdateParameters.
func (e EncodedTaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "contextAccessToken", e.ContextAccessToken)
populate(objectMap, "contextPath", e.ContextPath)
populate(objectMap, "encodedTaskContent", e.EncodedTaskContent)
populate(objectMap, "encodedValuesContent", e.EncodedValuesContent)
objectMap["type"] = StepTypeEncodedTask
populate(objectMap, "values", e.Values)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStepUpdateParameters.
func (e *EncodedTaskStepUpdateParameters) UnmarshalJSON(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 "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &e.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &e.ContextPath)
delete(rawMsg, key)
case "encodedTaskContent":
err = unpopulate(val, "EncodedTaskContent", &e.EncodedTaskContent)
delete(rawMsg, key)
case "encodedValuesContent":
err = unpopulate(val, "EncodedValuesContent", &e.EncodedValuesContent)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &e.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &e.Values)
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 EncryptionProperty.
func (e EncryptionProperty) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "keyVaultProperties", e.KeyVaultProperties)
populate(objectMap, "status", e.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty.
func (e *EncryptionProperty) UnmarshalJSON(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 "keyVaultProperties":
err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &e.Status)
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 Event.
func (e Event) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "eventRequestMessage", e.EventRequestMessage)
populate(objectMap, "eventResponseMessage", e.EventResponseMessage)
populate(objectMap, "id", e.ID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Event.
func (e *Event) UnmarshalJSON(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 "eventRequestMessage":
err = unpopulate(val, "EventRequestMessage", &e.EventRequestMessage)
delete(rawMsg, key)
case "eventResponseMessage":
err = unpopulate(val, "EventResponseMessage", &e.EventResponseMessage)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &e.ID)
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 EventContent.
func (e EventContent) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "action", e.Action)
populate(objectMap, "actor", e.Actor)
populate(objectMap, "id", e.ID)
populate(objectMap, "request", e.Request)
populate(objectMap, "source", e.Source)
populate(objectMap, "target", e.Target)
populateDateTimeRFC3339(objectMap, "timestamp", e.Timestamp)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EventContent.
func (e *EventContent) UnmarshalJSON(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 "action":
err = unpopulate(val, "Action", &e.Action)
delete(rawMsg, key)
case "actor":
err = unpopulate(val, "Actor", &e.Actor)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &e.ID)
delete(rawMsg, key)
case "request":
err = unpopulate(val, "Request", &e.Request)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &e.Source)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &e.Target)
delete(rawMsg, key)
case "timestamp":
err = unpopulateDateTimeRFC3339(val, "Timestamp", &e.Timestamp)
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 EventInfo.
func (e EventInfo) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", e.ID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EventInfo.
func (e *EventInfo) UnmarshalJSON(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)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", e, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type EventListResult.
func (e EventListResult) 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 EventListResult.
func (e *EventListResult) UnmarshalJSON(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 EventRequestMessage.
func (e EventRequestMessage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "content", e.Content)
populate(objectMap, "headers", e.Headers)
populate(objectMap, "method", e.Method)
populate(objectMap, "requestUri", e.RequestURI)
populate(objectMap, "version", e.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EventRequestMessage.
func (e *EventRequestMessage) UnmarshalJSON(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 "content":
err = unpopulate(val, "Content", &e.Content)
delete(rawMsg, key)
case "headers":
err = unpopulate(val, "Headers", &e.Headers)
delete(rawMsg, key)
case "method":
err = unpopulate(val, "Method", &e.Method)
delete(rawMsg, key)
case "requestUri":
err = unpopulate(val, "RequestURI", &e.RequestURI)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &e.Version)
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 EventResponseMessage.
func (e EventResponseMessage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "content", e.Content)
populate(objectMap, "headers", e.Headers)
populate(objectMap, "reasonPhrase", e.ReasonPhrase)
populate(objectMap, "statusCode", e.StatusCode)
populate(objectMap, "version", e.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type EventResponseMessage.
func (e *EventResponseMessage) UnmarshalJSON(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 "content":
err = unpopulate(val, "Content", &e.Content)
delete(rawMsg, key)
case "headers":
err = unpopulate(val, "Headers", &e.Headers)
delete(rawMsg, key)
case "reasonPhrase":
err = unpopulate(val, "ReasonPhrase", &e.ReasonPhrase)
delete(rawMsg, key)
case "statusCode":
err = unpopulate(val, "StatusCode", &e.StatusCode)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &e.Version)
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 ExportPipeline.
func (e ExportPipeline) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", e.ID)
populate(objectMap, "identity", e.Identity)
populate(objectMap, "location", e.Location)
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 ExportPipeline.
func (e *ExportPipeline) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &e.Identity)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &e.Location)
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 ExportPipelineListResult.
func (e ExportPipelineListResult) 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 ExportPipelineListResult.
func (e *ExportPipelineListResult) UnmarshalJSON(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 ExportPipelineProperties.
func (e ExportPipelineProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "options", e.Options)
populate(objectMap, "provisioningState", e.ProvisioningState)
populate(objectMap, "target", e.Target)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPipelineProperties.
func (e *ExportPipelineProperties) UnmarshalJSON(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 "options":
err = unpopulate(val, "Options", &e.Options)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &e.ProvisioningState)
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 ExportPipelineTargetProperties.
func (e ExportPipelineTargetProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "keyVaultUri", e.KeyVaultURI)
populate(objectMap, "type", e.Type)
populate(objectMap, "uri", e.URI)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPipelineTargetProperties.
func (e *ExportPipelineTargetProperties) UnmarshalJSON(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 "keyVaultUri":
err = unpopulate(val, "KeyVaultURI", &e.KeyVaultURI)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &e.Type)
delete(rawMsg, key)
case "uri":
err = unpopulate(val, "URI", &e.URI)
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 ExportPolicy.
func (e ExportPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", e.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ExportPolicy.
func (e *ExportPolicy) UnmarshalJSON(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 "status":
err = unpopulate(val, "Status", &e.Status)
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 FileTaskRunRequest.
func (f FileTaskRunRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", f.AgentConfiguration)
populate(objectMap, "agentPoolName", f.AgentPoolName)
populate(objectMap, "credentials", f.Credentials)
populate(objectMap, "isArchiveEnabled", f.IsArchiveEnabled)
populate(objectMap, "logTemplate", f.LogTemplate)
populate(objectMap, "platform", f.Platform)
populate(objectMap, "sourceLocation", f.SourceLocation)
populate(objectMap, "taskFilePath", f.TaskFilePath)
populate(objectMap, "timeout", f.Timeout)
objectMap["type"] = "FileTaskRunRequest"
populate(objectMap, "values", f.Values)
populate(objectMap, "valuesFilePath", f.ValuesFilePath)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskRunRequest.
func (f *FileTaskRunRequest) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &f.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &f.AgentPoolName)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &f.Credentials)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &f.IsArchiveEnabled)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &f.LogTemplate)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &f.Platform)
delete(rawMsg, key)
case "sourceLocation":
err = unpopulate(val, "SourceLocation", &f.SourceLocation)
delete(rawMsg, key)
case "taskFilePath":
err = unpopulate(val, "TaskFilePath", &f.TaskFilePath)
delete(rawMsg, key)
case "timeout":
err = unpopulate(val, "Timeout", &f.Timeout)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &f.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &f.Values)
delete(rawMsg, key)
case "valuesFilePath":
err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath)
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 FileTaskStep.
func (f FileTaskStep) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageDependencies", f.BaseImageDependencies)
populate(objectMap, "contextAccessToken", f.ContextAccessToken)
populate(objectMap, "contextPath", f.ContextPath)
populate(objectMap, "taskFilePath", f.TaskFilePath)
objectMap["type"] = StepTypeFileTask
populate(objectMap, "values", f.Values)
populate(objectMap, "valuesFilePath", f.ValuesFilePath)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStep.
func (f *FileTaskStep) UnmarshalJSON(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 "baseImageDependencies":
err = unpopulate(val, "BaseImageDependencies", &f.BaseImageDependencies)
delete(rawMsg, key)
case "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &f.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &f.ContextPath)
delete(rawMsg, key)
case "taskFilePath":
err = unpopulate(val, "TaskFilePath", &f.TaskFilePath)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &f.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &f.Values)
delete(rawMsg, key)
case "valuesFilePath":
err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath)
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 FileTaskStepUpdateParameters.
func (f FileTaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "contextAccessToken", f.ContextAccessToken)
populate(objectMap, "contextPath", f.ContextPath)
populate(objectMap, "taskFilePath", f.TaskFilePath)
objectMap["type"] = StepTypeFileTask
populate(objectMap, "values", f.Values)
populate(objectMap, "valuesFilePath", f.ValuesFilePath)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStepUpdateParameters.
func (f *FileTaskStepUpdateParameters) UnmarshalJSON(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 "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &f.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &f.ContextPath)
delete(rawMsg, key)
case "taskFilePath":
err = unpopulate(val, "TaskFilePath", &f.TaskFilePath)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &f.Type)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &f.Values)
delete(rawMsg, key)
case "valuesFilePath":
err = unpopulate(val, "ValuesFilePath", &f.ValuesFilePath)
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 GarbageCollectionProperties.
func (g GarbageCollectionProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "enabled", g.Enabled)
populate(objectMap, "schedule", g.Schedule)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type GarbageCollectionProperties.
func (g *GarbageCollectionProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "enabled":
err = unpopulate(val, "Enabled", &g.Enabled)
delete(rawMsg, key)
case "schedule":
err = unpopulate(val, "Schedule", &g.Schedule)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsParameters.
func (g GenerateCredentialsParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "expiry", g.Expiry)
populate(objectMap, "name", g.Name)
populate(objectMap, "tokenId", g.TokenID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsParameters.
func (g *GenerateCredentialsParameters) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "expiry":
err = unpopulateDateTimeRFC3339(val, "Expiry", &g.Expiry)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &g.Name)
delete(rawMsg, key)
case "tokenId":
err = unpopulate(val, "TokenID", &g.TokenID)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsResult.
func (g GenerateCredentialsResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "passwords", g.Passwords)
populate(objectMap, "username", g.Username)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsResult.
func (g *GenerateCredentialsResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "passwords":
err = unpopulate(val, "Passwords", &g.Passwords)
delete(rawMsg, key)
case "username":
err = unpopulate(val, "Username", &g.Username)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", g, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type IPRule.
func (i IPRule) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "action", i.Action)
populate(objectMap, "value", i.IPAddressOrRange)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.
func (i *IPRule) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "action":
err = unpopulate(val, "Action", &i.Action)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "IPAddressOrRange", &i.IPAddressOrRange)
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 IdentityProperties.
func (i IdentityProperties) 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 IdentityProperties.
func (i *IdentityProperties) UnmarshalJSON(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 ImageDescriptor.
func (i ImageDescriptor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "digest", i.Digest)
populate(objectMap, "registry", i.Registry)
populate(objectMap, "repository", i.Repository)
populate(objectMap, "tag", i.Tag)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImageDescriptor.
func (i *ImageDescriptor) UnmarshalJSON(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 "digest":
err = unpopulate(val, "Digest", &i.Digest)
delete(rawMsg, key)
case "registry":
err = unpopulate(val, "Registry", &i.Registry)
delete(rawMsg, key)
case "repository":
err = unpopulate(val, "Repository", &i.Repository)
delete(rawMsg, key)
case "tag":
err = unpopulate(val, "Tag", &i.Tag)
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 ImageUpdateTrigger.
func (i ImageUpdateTrigger) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", i.ID)
populate(objectMap, "images", i.Images)
populateDateTimeRFC3339(objectMap, "timestamp", i.Timestamp)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdateTrigger.
func (i *ImageUpdateTrigger) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &i.ID)
delete(rawMsg, key)
case "images":
err = unpopulate(val, "Images", &i.Images)
delete(rawMsg, key)
case "timestamp":
err = unpopulateDateTimeRFC3339(val, "Timestamp", &i.Timestamp)
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 ImportImageParameters.
func (i ImportImageParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "mode", i.Mode)
populate(objectMap, "source", i.Source)
populate(objectMap, "targetTags", i.TargetTags)
populate(objectMap, "untaggedTargetRepositories", i.UntaggedTargetRepositories)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportImageParameters.
func (i *ImportImageParameters) UnmarshalJSON(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 "mode":
err = unpopulate(val, "Mode", &i.Mode)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &i.Source)
delete(rawMsg, key)
case "targetTags":
err = unpopulate(val, "TargetTags", &i.TargetTags)
delete(rawMsg, key)
case "untaggedTargetRepositories":
err = unpopulate(val, "UntaggedTargetRepositories", &i.UntaggedTargetRepositories)
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 ImportPipeline.
func (i ImportPipeline) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", i.ID)
populate(objectMap, "identity", i.Identity)
populate(objectMap, "location", i.Location)
populate(objectMap, "name", i.Name)
populate(objectMap, "properties", i.Properties)
populate(objectMap, "systemData", i.SystemData)
populate(objectMap, "type", i.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipeline.
func (i *ImportPipeline) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &i.ID)
delete(rawMsg, key)
case "identity":
err = unpopulate(val, "Identity", &i.Identity)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &i.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &i.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &i.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &i.SystemData)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &i.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ImportPipelineListResult.
func (i ImportPipelineListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", i.NextLink)
populate(objectMap, "value", i.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineListResult.
func (i *ImportPipelineListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &i.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &i.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ImportPipelineProperties.
func (i ImportPipelineProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "options", i.Options)
populate(objectMap, "provisioningState", i.ProvisioningState)
populate(objectMap, "source", i.Source)
populate(objectMap, "trigger", i.Trigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineProperties.
func (i *ImportPipelineProperties) UnmarshalJSON(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 "options":
err = unpopulate(val, "Options", &i.Options)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &i.ProvisioningState)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &i.Source)
delete(rawMsg, key)
case "trigger":
err = unpopulate(val, "Trigger", &i.Trigger)
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 ImportPipelineSourceProperties.
func (i ImportPipelineSourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "keyVaultUri", i.KeyVaultURI)
populate(objectMap, "type", i.Type)
populate(objectMap, "uri", i.URI)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportPipelineSourceProperties.
func (i *ImportPipelineSourceProperties) UnmarshalJSON(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 "keyVaultUri":
err = unpopulate(val, "KeyVaultURI", &i.KeyVaultURI)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &i.Type)
delete(rawMsg, key)
case "uri":
err = unpopulate(val, "URI", &i.URI)
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 ImportSource.
func (i ImportSource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "credentials", i.Credentials)
populate(objectMap, "registryUri", i.RegistryURI)
populate(objectMap, "resourceId", i.ResourceID)
populate(objectMap, "sourceImage", i.SourceImage)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSource.
func (i *ImportSource) UnmarshalJSON(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 "credentials":
err = unpopulate(val, "Credentials", &i.Credentials)
delete(rawMsg, key)
case "registryUri":
err = unpopulate(val, "RegistryURI", &i.RegistryURI)
delete(rawMsg, key)
case "resourceId":
err = unpopulate(val, "ResourceID", &i.ResourceID)
delete(rawMsg, key)
case "sourceImage":
err = unpopulate(val, "SourceImage", &i.SourceImage)
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 ImportSourceCredentials.
func (i ImportSourceCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "password", i.Password)
populate(objectMap, "username", i.Username)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ImportSourceCredentials.
func (i *ImportSourceCredentials) UnmarshalJSON(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 "password":
err = unpopulate(val, "Password", &i.Password)
delete(rawMsg, key)
case "username":
err = unpopulate(val, "Username", &i.Username)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", i, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties.
func (k KeyVaultProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", k.Identity)
populate(objectMap, "keyIdentifier", k.KeyIdentifier)
populate(objectMap, "keyRotationEnabled", k.KeyRotationEnabled)
populateDateTimeRFC3339(objectMap, "lastKeyRotationTimestamp", k.LastKeyRotationTimestamp)
populate(objectMap, "versionedKeyIdentifier", k.VersionedKeyIdentifier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties.
func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", k, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "identity":
err = unpopulate(val, "Identity", &k.Identity)
delete(rawMsg, key)
case "keyIdentifier":
err = unpopulate(val, "KeyIdentifier", &k.KeyIdentifier)
delete(rawMsg, key)
case "keyRotationEnabled":
err = unpopulate(val, "KeyRotationEnabled", &k.KeyRotationEnabled)
delete(rawMsg, key)
case "lastKeyRotationTimestamp":
err = unpopulateDateTimeRFC3339(val, "LastKeyRotationTimestamp", &k.LastKeyRotationTimestamp)
delete(rawMsg, key)
case "versionedKeyIdentifier":
err = unpopulate(val, "VersionedKeyIdentifier", &k.VersionedKeyIdentifier)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", k, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type LoggingProperties.
func (l LoggingProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "auditLogStatus", l.AuditLogStatus)
populate(objectMap, "logLevel", l.LogLevel)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type LoggingProperties.
func (l *LoggingProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", l, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "auditLogStatus":
err = unpopulate(val, "AuditLogStatus", &l.AuditLogStatus)
delete(rawMsg, key)
case "logLevel":
err = unpopulate(val, "LogLevel", &l.LogLevel)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", l, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type LoginServerProperties.
func (l LoginServerProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "host", l.Host)
populate(objectMap, "tls", l.TLS)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type LoginServerProperties.
func (l *LoginServerProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", l, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "host":
err = unpopulate(val, "Host", &l.Host)
delete(rawMsg, key)
case "tls":
err = unpopulate(val, "TLS", &l.TLS)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", l, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.
func (n NetworkRuleSet) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "defaultAction", n.DefaultAction)
populate(objectMap, "ipRules", n.IPRules)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.
func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", n, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "defaultAction":
err = unpopulate(val, "DefaultAction", &n.DefaultAction)
delete(rawMsg, key)
case "ipRules":
err = unpopulate(val, "IPRules", &n.IPRules)
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 OperationDefinition.
func (o OperationDefinition) 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)
populate(objectMap, "properties", o.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDefinition.
func (o *OperationDefinition) UnmarshalJSON(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 OperationDisplayDefinition.
func (o OperationDisplayDefinition) 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 OperationDisplayDefinition.
func (o *OperationDisplayDefinition) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "description":
err = unpopulate(val, "Description", &o.Description)
delete(rawMsg, key)
case "operation":
err = unpopulate(val, "Operation", &o.Operation)
delete(rawMsg, key)
case "provider":
err = unpopulate(val, "Provider", &o.Provider)
delete(rawMsg, key)
case "resource":
err = unpopulate(val, "Resource", &o.Resource)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (o OperationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", o.NextLink)
populate(objectMap, "value", o.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.
func (o *OperationListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &o.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &o.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OperationLogSpecificationDefinition.
func (o OperationLogSpecificationDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "blobDuration", o.BlobDuration)
populate(objectMap, "displayName", o.DisplayName)
populate(objectMap, "name", o.Name)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogSpecificationDefinition.
func (o *OperationLogSpecificationDefinition) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "blobDuration":
err = unpopulate(val, "BlobDuration", &o.BlobDuration)
delete(rawMsg, key)
case "displayName":
err = unpopulate(val, "DisplayName", &o.DisplayName)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &o.Name)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecificationDefinition.
func (o OperationMetricSpecificationDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "aggregationType", o.AggregationType)
populate(objectMap, "displayDescription", o.DisplayDescription)
populate(objectMap, "displayName", o.DisplayName)
populate(objectMap, "internalMetricName", o.InternalMetricName)
populate(objectMap, "name", o.Name)
populate(objectMap, "unit", o.Unit)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecificationDefinition.
func (o *OperationMetricSpecificationDefinition) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "aggregationType":
err = unpopulate(val, "AggregationType", &o.AggregationType)
delete(rawMsg, key)
case "displayDescription":
err = unpopulate(val, "DisplayDescription", &o.DisplayDescription)
delete(rawMsg, key)
case "displayName":
err = unpopulate(val, "DisplayName", &o.DisplayName)
delete(rawMsg, key)
case "internalMetricName":
err = unpopulate(val, "InternalMetricName", &o.InternalMetricName)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &o.Name)
delete(rawMsg, key)
case "unit":
err = unpopulate(val, "Unit", &o.Unit)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OperationPropertiesDefinition.
func (o OperationPropertiesDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "serviceSpecification", o.ServiceSpecification)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesDefinition.
func (o *OperationPropertiesDefinition) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "serviceSpecification":
err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecificationDefinition.
func (o OperationServiceSpecificationDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "logSpecifications", o.LogSpecifications)
populate(objectMap, "metricSpecifications", o.MetricSpecifications)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecificationDefinition.
func (o *OperationServiceSpecificationDefinition) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "logSpecifications":
err = unpopulate(val, "LogSpecifications", &o.LogSpecifications)
delete(rawMsg, key)
case "metricSpecifications":
err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", o, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type OverrideTaskStepProperties.
func (o OverrideTaskStepProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "arguments", o.Arguments)
populate(objectMap, "contextPath", o.ContextPath)
populate(objectMap, "file", o.File)
populate(objectMap, "target", o.Target)
populate(objectMap, "updateTriggerToken", o.UpdateTriggerToken)
populate(objectMap, "values", o.Values)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type OverrideTaskStepProperties.
func (o *OverrideTaskStepProperties) UnmarshalJSON(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 "arguments":
err = unpopulate(val, "Arguments", &o.Arguments)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &o.ContextPath)
delete(rawMsg, key)
case "file":
err = unpopulate(val, "File", &o.File)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &o.Target)
delete(rawMsg, key)
case "updateTriggerToken":
err = unpopulate(val, "UpdateTriggerToken", &o.UpdateTriggerToken)
delete(rawMsg, key)
case "values":
err = unpopulate(val, "Values", &o.Values)
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 ParentProperties.
func (p ParentProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", p.ID)
populate(objectMap, "syncProperties", p.SyncProperties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ParentProperties.
func (p *ParentProperties) UnmarshalJSON(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 "syncProperties":
err = unpopulate(val, "SyncProperties", &p.SyncProperties)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PipelineRun.
func (p PipelineRun) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]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 PipelineRun.
func (p *PipelineRun) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "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 PipelineRunListResult.
func (p PipelineRunListResult) 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 PipelineRunListResult.
func (p *PipelineRunListResult) UnmarshalJSON(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 PipelineRunProperties.
func (p PipelineRunProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "forceUpdateTag", p.ForceUpdateTag)
populate(objectMap, "provisioningState", p.ProvisioningState)
populate(objectMap, "request", p.Request)
populate(objectMap, "response", p.Response)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunProperties.
func (p *PipelineRunProperties) UnmarshalJSON(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 "forceUpdateTag":
err = unpopulate(val, "ForceUpdateTag", &p.ForceUpdateTag)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
delete(rawMsg, key)
case "request":
err = unpopulate(val, "Request", &p.Request)
delete(rawMsg, key)
case "response":
err = unpopulate(val, "Response", &p.Response)
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 PipelineRunRequest.
func (p PipelineRunRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "artifacts", p.Artifacts)
populate(objectMap, "catalogDigest", p.CatalogDigest)
populate(objectMap, "pipelineResourceId", p.PipelineResourceID)
populate(objectMap, "source", p.Source)
populate(objectMap, "target", p.Target)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunRequest.
func (p *PipelineRunRequest) UnmarshalJSON(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 "artifacts":
err = unpopulate(val, "Artifacts", &p.Artifacts)
delete(rawMsg, key)
case "catalogDigest":
err = unpopulate(val, "CatalogDigest", &p.CatalogDigest)
delete(rawMsg, key)
case "pipelineResourceId":
err = unpopulate(val, "PipelineResourceID", &p.PipelineResourceID)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &p.Source)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &p.Target)
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 PipelineRunResponse.
func (p PipelineRunResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "catalogDigest", p.CatalogDigest)
populateDateTimeRFC3339(objectMap, "finishTime", p.FinishTime)
populate(objectMap, "importedArtifacts", p.ImportedArtifacts)
populate(objectMap, "pipelineRunErrorMessage", p.PipelineRunErrorMessage)
populate(objectMap, "progress", p.Progress)
populate(objectMap, "source", p.Source)
populateDateTimeRFC3339(objectMap, "startTime", p.StartTime)
populate(objectMap, "status", p.Status)
populate(objectMap, "target", p.Target)
populate(objectMap, "trigger", p.Trigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunResponse.
func (p *PipelineRunResponse) UnmarshalJSON(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 "catalogDigest":
err = unpopulate(val, "CatalogDigest", &p.CatalogDigest)
delete(rawMsg, key)
case "finishTime":
err = unpopulateDateTimeRFC3339(val, "FinishTime", &p.FinishTime)
delete(rawMsg, key)
case "importedArtifacts":
err = unpopulate(val, "ImportedArtifacts", &p.ImportedArtifacts)
delete(rawMsg, key)
case "pipelineRunErrorMessage":
err = unpopulate(val, "PipelineRunErrorMessage", &p.PipelineRunErrorMessage)
delete(rawMsg, key)
case "progress":
err = unpopulate(val, "Progress", &p.Progress)
delete(rawMsg, key)
case "source":
err = unpopulate(val, "Source", &p.Source)
delete(rawMsg, key)
case "startTime":
err = unpopulateDateTimeRFC3339(val, "StartTime", &p.StartTime)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &p.Status)
delete(rawMsg, key)
case "target":
err = unpopulate(val, "Target", &p.Target)
delete(rawMsg, key)
case "trigger":
err = unpopulate(val, "Trigger", &p.Trigger)
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 PipelineRunSourceProperties.
func (p PipelineRunSourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", p.Name)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunSourceProperties.
func (p *PipelineRunSourceProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &p.Name)
delete(rawMsg, key)
case "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 PipelineRunTargetProperties.
func (p PipelineRunTargetProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", p.Name)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineRunTargetProperties.
func (p *PipelineRunTargetProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &p.Name)
delete(rawMsg, key)
case "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 PipelineSourceTriggerDescriptor.
func (p PipelineSourceTriggerDescriptor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "timestamp", p.Timestamp)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineSourceTriggerDescriptor.
func (p *PipelineSourceTriggerDescriptor) UnmarshalJSON(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 "timestamp":
err = unpopulateDateTimeRFC3339(val, "Timestamp", &p.Timestamp)
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 PipelineSourceTriggerProperties.
func (p PipelineSourceTriggerProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", p.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineSourceTriggerProperties.
func (p *PipelineSourceTriggerProperties) UnmarshalJSON(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 "status":
err = unpopulate(val, "Status", &p.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PipelineTriggerDescriptor.
func (p PipelineTriggerDescriptor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "sourceTrigger", p.SourceTrigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTriggerDescriptor.
func (p *PipelineTriggerDescriptor) UnmarshalJSON(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 "sourceTrigger":
err = unpopulate(val, "SourceTrigger", &p.SourceTrigger)
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 PipelineTriggerProperties.
func (p PipelineTriggerProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "sourceTrigger", p.SourceTrigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTriggerProperties.
func (p *PipelineTriggerProperties) UnmarshalJSON(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 "sourceTrigger":
err = unpopulate(val, "SourceTrigger", &p.SourceTrigger)
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 PlatformProperties.
func (p PlatformProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "architecture", p.Architecture)
populate(objectMap, "os", p.OS)
populate(objectMap, "variant", p.Variant)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformProperties.
func (p *PlatformProperties) UnmarshalJSON(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 "architecture":
err = unpopulate(val, "Architecture", &p.Architecture)
delete(rawMsg, key)
case "os":
err = unpopulate(val, "OS", &p.OS)
delete(rawMsg, key)
case "variant":
err = unpopulate(val, "Variant", &p.Variant)
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 PlatformUpdateParameters.
func (p PlatformUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "architecture", p.Architecture)
populate(objectMap, "os", p.OS)
populate(objectMap, "variant", p.Variant)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformUpdateParameters.
func (p *PlatformUpdateParameters) UnmarshalJSON(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 "architecture":
err = unpopulate(val, "Architecture", &p.Architecture)
delete(rawMsg, key)
case "os":
err = unpopulate(val, "OS", &p.OS)
delete(rawMsg, key)
case "variant":
err = unpopulate(val, "Variant", &p.Variant)
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 Policies.
func (p Policies) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "azureADAuthenticationAsArmPolicy", p.AzureADAuthenticationAsArmPolicy)
populate(objectMap, "exportPolicy", p.ExportPolicy)
populate(objectMap, "quarantinePolicy", p.QuarantinePolicy)
populate(objectMap, "retentionPolicy", p.RetentionPolicy)
populate(objectMap, "softDeletePolicy", p.SoftDeletePolicy)
populate(objectMap, "trustPolicy", p.TrustPolicy)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Policies.
func (p *Policies) UnmarshalJSON(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 "azureADAuthenticationAsArmPolicy":
err = unpopulate(val, "AzureADAuthenticationAsArmPolicy", &p.AzureADAuthenticationAsArmPolicy)
delete(rawMsg, key)
case "exportPolicy":
err = unpopulate(val, "ExportPolicy", &p.ExportPolicy)
delete(rawMsg, key)
case "quarantinePolicy":
err = unpopulate(val, "QuarantinePolicy", &p.QuarantinePolicy)
delete(rawMsg, key)
case "retentionPolicy":
err = unpopulate(val, "RetentionPolicy", &p.RetentionPolicy)
delete(rawMsg, key)
case "softDeletePolicy":
err = unpopulate(val, "SoftDeletePolicy", &p.SoftDeletePolicy)
delete(rawMsg, key)
case "trustPolicy":
err = unpopulate(val, "TrustPolicy", &p.TrustPolicy)
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, "systemData", p.SystemData)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.
func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "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 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, "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 "privateEndpoint":
err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint)
delete(rawMsg, key)
case "privateLinkServiceConnectionState":
err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &p.ProvisioningState)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.
func (p PrivateLinkResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", p.ID)
populate(objectMap, "name", p.Name)
populate(objectMap, "properties", p.Properties)
populate(objectMap, "type", p.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.
func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &p.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &p.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &p.Properties)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &p.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.
func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", p.NextLink)
populate(objectMap, "value", p.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.
func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "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 PrivateLinkResourceProperties.
func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "groupId", p.GroupID)
populate(objectMap, "requiredMembers", p.RequiredMembers)
populate(objectMap, "requiredZoneNames", p.RequiredZoneNames)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.
func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "groupId":
err = unpopulate(val, "GroupID", &p.GroupID)
delete(rawMsg, key)
case "requiredMembers":
err = unpopulate(val, "RequiredMembers", &p.RequiredMembers)
delete(rawMsg, key)
case "requiredZoneNames":
err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.
func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actionsRequired", p.ActionsRequired)
populate(objectMap, "description", p.Description)
populate(objectMap, "status", p.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.
func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "actionsRequired":
err = unpopulate(val, "ActionsRequired", &p.ActionsRequired)
delete(rawMsg, key)
case "description":
err = unpopulate(val, "Description", &p.Description)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &p.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", p, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ProgressProperties.
func (p ProgressProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "percentage", p.Percentage)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ProgressProperties.
func (p *ProgressProperties) UnmarshalJSON(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 "percentage":
err = unpopulate(val, "Percentage", &p.Percentage)
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 QuarantinePolicy.
func (q QuarantinePolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", q.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type QuarantinePolicy.
func (q *QuarantinePolicy) UnmarshalJSON(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 "status":
err = unpopulate(val, "Status", &q.Status)
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 RegenerateCredentialParameters.
func (r RegenerateCredentialParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", r.Name)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateCredentialParameters.
func (r *RegenerateCredentialParameters) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Registry.
func (r Registry) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", r.ID)
populate(objectMap, "identity", r.Identity)
populate(objectMap, "location", r.Location)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "sku", r.SKU)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "tags", r.Tags)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Registry.
func (r *Registry) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &r.Identity)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &r.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "sku":
err = unpopulate(val, "SKU", &r.SKU)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult.
func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "passwords", r.Passwords)
populate(objectMap, "username", r.Username)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult.
func (r *RegistryListCredentialsResult) UnmarshalJSON(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 "passwords":
err = unpopulate(val, "Passwords", &r.Passwords)
delete(rawMsg, key)
case "username":
err = unpopulate(val, "Username", &r.Username)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RegistryListResult.
func (r RegistryListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListResult.
func (r *RegistryListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RegistryNameCheckRequest.
func (r RegistryNameCheckRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "autoGeneratedDomainNameLabelScope", r.AutoGeneratedDomainNameLabelScope)
populate(objectMap, "name", r.Name)
populate(objectMap, "resourceGroupName", r.ResourceGroupName)
objectMap["type"] = "Microsoft.ContainerRegistry/registries"
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameCheckRequest.
func (r *RegistryNameCheckRequest) UnmarshalJSON(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 "autoGeneratedDomainNameLabelScope":
err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &r.AutoGeneratedDomainNameLabelScope)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "resourceGroupName":
err = unpopulate(val, "ResourceGroupName", &r.ResourceGroupName)
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 RegistryNameStatus.
func (r RegistryNameStatus) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "availableLoginServerName", r.AvailableLoginServerName)
populate(objectMap, "message", r.Message)
populate(objectMap, "nameAvailable", r.NameAvailable)
populate(objectMap, "reason", r.Reason)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameStatus.
func (r *RegistryNameStatus) UnmarshalJSON(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 "availableLoginServerName":
err = unpopulate(val, "AvailableLoginServerName", &r.AvailableLoginServerName)
delete(rawMsg, key)
case "message":
err = unpopulate(val, "Message", &r.Message)
delete(rawMsg, key)
case "nameAvailable":
err = unpopulate(val, "NameAvailable", &r.NameAvailable)
delete(rawMsg, key)
case "reason":
err = unpopulate(val, "Reason", &r.Reason)
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 RegistryPassword.
func (r RegistryPassword) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", r.Name)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPassword.
func (r *RegistryPassword) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RegistryProperties.
func (r RegistryProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "adminUserEnabled", r.AdminUserEnabled)
populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled)
populate(objectMap, "autoGeneratedDomainNameLabelScope", r.AutoGeneratedDomainNameLabelScope)
populateDateTimeRFC3339(objectMap, "creationDate", r.CreationDate)
populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled)
populate(objectMap, "dataEndpointHostNames", r.DataEndpointHostNames)
populate(objectMap, "encryption", r.Encryption)
populate(objectMap, "loginServer", r.LoginServer)
populate(objectMap, "metadataSearch", r.MetadataSearch)
populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions)
populate(objectMap, "networkRuleSet", r.NetworkRuleSet)
populate(objectMap, "policies", r.Policies)
populate(objectMap, "privateEndpointConnections", r.PrivateEndpointConnections)
populate(objectMap, "provisioningState", r.ProvisioningState)
populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess)
populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode)
populate(objectMap, "status", r.Status)
populate(objectMap, "zoneRedundancy", r.ZoneRedundancy)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryProperties.
func (r *RegistryProperties) UnmarshalJSON(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 "adminUserEnabled":
err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled)
delete(rawMsg, key)
case "anonymousPullEnabled":
err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled)
delete(rawMsg, key)
case "autoGeneratedDomainNameLabelScope":
err = unpopulate(val, "AutoGeneratedDomainNameLabelScope", &r.AutoGeneratedDomainNameLabelScope)
delete(rawMsg, key)
case "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &r.CreationDate)
delete(rawMsg, key)
case "dataEndpointEnabled":
err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled)
delete(rawMsg, key)
case "dataEndpointHostNames":
err = unpopulate(val, "DataEndpointHostNames", &r.DataEndpointHostNames)
delete(rawMsg, key)
case "encryption":
err = unpopulate(val, "Encryption", &r.Encryption)
delete(rawMsg, key)
case "loginServer":
err = unpopulate(val, "LoginServer", &r.LoginServer)
delete(rawMsg, key)
case "metadataSearch":
err = unpopulate(val, "MetadataSearch", &r.MetadataSearch)
delete(rawMsg, key)
case "networkRuleBypassOptions":
err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions)
delete(rawMsg, key)
case "networkRuleSet":
err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet)
delete(rawMsg, key)
case "policies":
err = unpopulate(val, "Policies", &r.Policies)
delete(rawMsg, key)
case "privateEndpointConnections":
err = unpopulate(val, "PrivateEndpointConnections", &r.PrivateEndpointConnections)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
delete(rawMsg, key)
case "publicNetworkAccess":
err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess)
delete(rawMsg, key)
case "roleAssignmentMode":
err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &r.Status)
delete(rawMsg, key)
case "zoneRedundancy":
err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy)
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 RegistryPropertiesUpdateParameters.
func (r RegistryPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "adminUserEnabled", r.AdminUserEnabled)
populate(objectMap, "anonymousPullEnabled", r.AnonymousPullEnabled)
populate(objectMap, "dataEndpointEnabled", r.DataEndpointEnabled)
populate(objectMap, "encryption", r.Encryption)
populate(objectMap, "metadataSearch", r.MetadataSearch)
populate(objectMap, "networkRuleBypassOptions", r.NetworkRuleBypassOptions)
populate(objectMap, "networkRuleSet", r.NetworkRuleSet)
populate(objectMap, "policies", r.Policies)
populate(objectMap, "publicNetworkAccess", r.PublicNetworkAccess)
populate(objectMap, "roleAssignmentMode", r.RoleAssignmentMode)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPropertiesUpdateParameters.
func (r *RegistryPropertiesUpdateParameters) UnmarshalJSON(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 "adminUserEnabled":
err = unpopulate(val, "AdminUserEnabled", &r.AdminUserEnabled)
delete(rawMsg, key)
case "anonymousPullEnabled":
err = unpopulate(val, "AnonymousPullEnabled", &r.AnonymousPullEnabled)
delete(rawMsg, key)
case "dataEndpointEnabled":
err = unpopulate(val, "DataEndpointEnabled", &r.DataEndpointEnabled)
delete(rawMsg, key)
case "encryption":
err = unpopulate(val, "Encryption", &r.Encryption)
delete(rawMsg, key)
case "metadataSearch":
err = unpopulate(val, "MetadataSearch", &r.MetadataSearch)
delete(rawMsg, key)
case "networkRuleBypassOptions":
err = unpopulate(val, "NetworkRuleBypassOptions", &r.NetworkRuleBypassOptions)
delete(rawMsg, key)
case "networkRuleSet":
err = unpopulate(val, "NetworkRuleSet", &r.NetworkRuleSet)
delete(rawMsg, key)
case "policies":
err = unpopulate(val, "Policies", &r.Policies)
delete(rawMsg, key)
case "publicNetworkAccess":
err = unpopulate(val, "PublicNetworkAccess", &r.PublicNetworkAccess)
delete(rawMsg, key)
case "roleAssignmentMode":
err = unpopulate(val, "RoleAssignmentMode", &r.RoleAssignmentMode)
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 RegistryUpdateParameters.
func (r RegistryUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", r.Identity)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "sku", r.SKU)
populate(objectMap, "tags", r.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUpdateParameters.
func (r *RegistryUpdateParameters) UnmarshalJSON(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 "identity":
err = unpopulate(val, "Identity", &r.Identity)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "sku":
err = unpopulate(val, "SKU", &r.SKU)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
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 RegistryUsage.
func (r RegistryUsage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "currentValue", r.CurrentValue)
populate(objectMap, "limit", r.Limit)
populate(objectMap, "name", r.Name)
populate(objectMap, "unit", r.Unit)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsage.
func (r *RegistryUsage) UnmarshalJSON(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 "currentValue":
err = unpopulate(val, "CurrentValue", &r.CurrentValue)
delete(rawMsg, key)
case "limit":
err = unpopulate(val, "Limit", &r.Limit)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "unit":
err = unpopulate(val, "Unit", &r.Unit)
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 RegistryUsageListResult.
func (r RegistryUsageListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsageListResult.
func (r *RegistryUsageListResult) UnmarshalJSON(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 "value":
err = unpopulate(val, "Value", &r.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Replication.
func (r Replication) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", r.ID)
populate(objectMap, "location", r.Location)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "tags", r.Tags)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Replication.
func (r *Replication) UnmarshalJSON(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 "location":
err = unpopulate(val, "Location", &r.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &r.Type)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ReplicationListResult.
func (r ReplicationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationListResult.
func (r *ReplicationListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ReplicationProperties.
func (r ReplicationProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "provisioningState", r.ProvisioningState)
populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled)
populate(objectMap, "status", r.Status)
populate(objectMap, "zoneRedundancy", r.ZoneRedundancy)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProperties.
func (r *ReplicationProperties) UnmarshalJSON(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 "provisioningState":
err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
delete(rawMsg, key)
case "regionEndpointEnabled":
err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &r.Status)
delete(rawMsg, key)
case "zoneRedundancy":
err = unpopulate(val, "ZoneRedundancy", &r.ZoneRedundancy)
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 ReplicationUpdateParameters.
func (r ReplicationUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "tags", r.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParameters.
func (r *ReplicationUpdateParameters) UnmarshalJSON(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 "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &r.Tags)
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 ReplicationUpdateParametersProperties.
func (r ReplicationUpdateParametersProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "regionEndpointEnabled", r.RegionEndpointEnabled)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParametersProperties.
func (r *ReplicationUpdateParametersProperties) UnmarshalJSON(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 "regionEndpointEnabled":
err = unpopulate(val, "RegionEndpointEnabled", &r.RegionEndpointEnabled)
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 Request.
func (r Request) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "addr", r.Addr)
populate(objectMap, "host", r.Host)
populate(objectMap, "id", r.ID)
populate(objectMap, "method", r.Method)
populate(objectMap, "useragent", r.Useragent)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Request.
func (r *Request) UnmarshalJSON(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 "addr":
err = unpopulate(val, "Addr", &r.Addr)
delete(rawMsg, key)
case "host":
err = unpopulate(val, "Host", &r.Host)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "method":
err = unpopulate(val, "Method", &r.Method)
delete(rawMsg, key)
case "useragent":
err = unpopulate(val, "Useragent", &r.Useragent)
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 RetentionPolicy.
func (r RetentionPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "days", r.Days)
populateDateTimeRFC3339(objectMap, "lastUpdatedTime", r.LastUpdatedTime)
populate(objectMap, "status", r.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy.
func (r *RetentionPolicy) UnmarshalJSON(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 "days":
err = unpopulate(val, "Days", &r.Days)
delete(rawMsg, key)
case "lastUpdatedTime":
err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &r.LastUpdatedTime)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &r.Status)
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 Run.
func (r Run) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", r.ID)
populate(objectMap, "name", r.Name)
populate(objectMap, "properties", r.Properties)
populate(objectMap, "systemData", r.SystemData)
populate(objectMap, "type", r.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Run.
func (r *Run) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "id":
err = unpopulate(val, "ID", &r.ID)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &r.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &r.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &r.SystemData)
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 RunFilter.
func (r RunFilter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentPoolName", r.AgentPoolName)
populateDateTimeRFC3339(objectMap, "createTime", r.CreateTime)
populateDateTimeRFC3339(objectMap, "finishTime", r.FinishTime)
populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled)
populate(objectMap, "outputImageManifests", r.OutputImageManifests)
populate(objectMap, "runId", r.RunID)
populate(objectMap, "runType", r.RunType)
populate(objectMap, "status", r.Status)
populate(objectMap, "taskName", r.TaskName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunFilter.
func (r *RunFilter) UnmarshalJSON(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 "agentPoolName":
err = unpopulate(val, "AgentPoolName", &r.AgentPoolName)
delete(rawMsg, key)
case "createTime":
err = unpopulateDateTimeRFC3339(val, "CreateTime", &r.CreateTime)
delete(rawMsg, key)
case "finishTime":
err = unpopulateDateTimeRFC3339(val, "FinishTime", &r.FinishTime)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled)
delete(rawMsg, key)
case "outputImageManifests":
err = unpopulate(val, "OutputImageManifests", &r.OutputImageManifests)
delete(rawMsg, key)
case "runId":
err = unpopulate(val, "RunID", &r.RunID)
delete(rawMsg, key)
case "runType":
err = unpopulate(val, "RunType", &r.RunType)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &r.Status)
delete(rawMsg, key)
case "taskName":
err = unpopulate(val, "TaskName", &r.TaskName)
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 RunGetLogResult.
func (r RunGetLogResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "logArtifactLink", r.LogArtifactLink)
populate(objectMap, "logLink", r.LogLink)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunGetLogResult.
func (r *RunGetLogResult) UnmarshalJSON(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 "logArtifactLink":
err = unpopulate(val, "LogArtifactLink", &r.LogArtifactLink)
delete(rawMsg, key)
case "logLink":
err = unpopulate(val, "LogLink", &r.LogLink)
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 RunListResult.
func (r RunListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", r.NextLink)
populate(objectMap, "value", r.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunListResult.
func (r *RunListResult) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "nextLink":
err = unpopulate(val, "NextLink", &r.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &r.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type RunProperties.
func (r RunProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", r.AgentConfiguration)
populate(objectMap, "agentPoolName", r.AgentPoolName)
populateDateTimeRFC3339(objectMap, "createTime", r.CreateTime)
populate(objectMap, "customRegistries", r.CustomRegistries)
populateDateTimeRFC3339(objectMap, "finishTime", r.FinishTime)
populate(objectMap, "imageUpdateTrigger", r.ImageUpdateTrigger)
populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled)
populateDateTimeRFC3339(objectMap, "lastUpdatedTime", r.LastUpdatedTime)
populate(objectMap, "logArtifact", r.LogArtifact)
populate(objectMap, "outputImages", r.OutputImages)
populate(objectMap, "platform", r.Platform)
populate(objectMap, "provisioningState", r.ProvisioningState)
populate(objectMap, "runErrorMessage", r.RunErrorMessage)
populate(objectMap, "runId", r.RunID)
populate(objectMap, "runType", r.RunType)
populate(objectMap, "sourceRegistryAuth", r.SourceRegistryAuth)
populate(objectMap, "sourceTrigger", r.SourceTrigger)
populateDateTimeRFC3339(objectMap, "startTime", r.StartTime)
populate(objectMap, "status", r.Status)
populate(objectMap, "task", r.Task)
populate(objectMap, "timerTrigger", r.TimerTrigger)
populate(objectMap, "updateTriggerToken", r.UpdateTriggerToken)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunProperties.
func (r *RunProperties) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &r.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &r.AgentPoolName)
delete(rawMsg, key)
case "createTime":
err = unpopulateDateTimeRFC3339(val, "CreateTime", &r.CreateTime)
delete(rawMsg, key)
case "customRegistries":
err = unpopulate(val, "CustomRegistries", &r.CustomRegistries)
delete(rawMsg, key)
case "finishTime":
err = unpopulateDateTimeRFC3339(val, "FinishTime", &r.FinishTime)
delete(rawMsg, key)
case "imageUpdateTrigger":
err = unpopulate(val, "ImageUpdateTrigger", &r.ImageUpdateTrigger)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled)
delete(rawMsg, key)
case "lastUpdatedTime":
err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &r.LastUpdatedTime)
delete(rawMsg, key)
case "logArtifact":
err = unpopulate(val, "LogArtifact", &r.LogArtifact)
delete(rawMsg, key)
case "outputImages":
err = unpopulate(val, "OutputImages", &r.OutputImages)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &r.Platform)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &r.ProvisioningState)
delete(rawMsg, key)
case "runErrorMessage":
err = unpopulate(val, "RunErrorMessage", &r.RunErrorMessage)
delete(rawMsg, key)
case "runId":
err = unpopulate(val, "RunID", &r.RunID)
delete(rawMsg, key)
case "runType":
err = unpopulate(val, "RunType", &r.RunType)
delete(rawMsg, key)
case "sourceRegistryAuth":
err = unpopulate(val, "SourceRegistryAuth", &r.SourceRegistryAuth)
delete(rawMsg, key)
case "sourceTrigger":
err = unpopulate(val, "SourceTrigger", &r.SourceTrigger)
delete(rawMsg, key)
case "startTime":
err = unpopulateDateTimeRFC3339(val, "StartTime", &r.StartTime)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &r.Status)
delete(rawMsg, key)
case "task":
err = unpopulate(val, "Task", &r.Task)
delete(rawMsg, key)
case "timerTrigger":
err = unpopulate(val, "TimerTrigger", &r.TimerTrigger)
delete(rawMsg, key)
case "updateTriggerToken":
err = unpopulate(val, "UpdateTriggerToken", &r.UpdateTriggerToken)
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 RunRequest.
func (r RunRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentPoolName", r.AgentPoolName)
populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled)
populate(objectMap, "logTemplate", r.LogTemplate)
objectMap["type"] = r.Type
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunRequest.
func (r *RunRequest) UnmarshalJSON(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 "agentPoolName":
err = unpopulate(val, "AgentPoolName", &r.AgentPoolName)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &r.LogTemplate)
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 RunUpdateParameters.
func (r RunUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isArchiveEnabled", r.IsArchiveEnabled)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type RunUpdateParameters.
func (r *RunUpdateParameters) UnmarshalJSON(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 "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &r.IsArchiveEnabled)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", r, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SKU.
func (s SKU) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", s.Name)
populate(objectMap, "tier", s.Tier)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SKU.
func (s *SKU) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "name":
err = unpopulate(val, "Name", &s.Name)
delete(rawMsg, key)
case "tier":
err = unpopulate(val, "Tier", &s.Tier)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type ScopeMap.
func (s ScopeMap) 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 ScopeMap.
func (s *ScopeMap) UnmarshalJSON(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 ScopeMapListResult.
func (s ScopeMapListResult) 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 ScopeMapListResult.
func (s *ScopeMapListResult) UnmarshalJSON(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 ScopeMapProperties.
func (s ScopeMapProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actions", s.Actions)
populateDateTimeRFC3339(objectMap, "creationDate", s.CreationDate)
populate(objectMap, "description", s.Description)
populate(objectMap, "provisioningState", s.ProvisioningState)
populate(objectMap, "type", s.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapProperties.
func (s *ScopeMapProperties) UnmarshalJSON(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 "actions":
err = unpopulate(val, "Actions", &s.Actions)
delete(rawMsg, key)
case "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &s.CreationDate)
delete(rawMsg, key)
case "description":
err = unpopulate(val, "Description", &s.Description)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &s.ProvisioningState)
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 ScopeMapPropertiesUpdateParameters.
func (s ScopeMapPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actions", s.Actions)
populate(objectMap, "description", s.Description)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapPropertiesUpdateParameters.
func (s *ScopeMapPropertiesUpdateParameters) UnmarshalJSON(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 "actions":
err = unpopulate(val, "Actions", &s.Actions)
delete(rawMsg, key)
case "description":
err = unpopulate(val, "Description", &s.Description)
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 ScopeMapUpdateParameters.
func (s ScopeMapUpdateParameters) 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 ScopeMapUpdateParameters.
func (s *ScopeMapUpdateParameters) UnmarshalJSON(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 SecretObject.
func (s SecretObject) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "type", s.Type)
populate(objectMap, "value", s.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SecretObject.
func (s *SecretObject) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "type":
err = unpopulate(val, "Type", &s.Type)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &s.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SetValue.
func (s SetValue) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "isSecret", s.IsSecret)
populate(objectMap, "name", s.Name)
populate(objectMap, "value", s.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SetValue.
func (s *SetValue) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &s.Name)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &s.Value)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SoftDeletePolicy.
func (s SoftDeletePolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "lastUpdatedTime", s.LastUpdatedTime)
populate(objectMap, "retentionDays", s.RetentionDays)
populate(objectMap, "status", s.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SoftDeletePolicy.
func (s *SoftDeletePolicy) UnmarshalJSON(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 "lastUpdatedTime":
err = unpopulateDateTimeRFC3339(val, "LastUpdatedTime", &s.LastUpdatedTime)
delete(rawMsg, key)
case "retentionDays":
err = unpopulate(val, "RetentionDays", &s.RetentionDays)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &s.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type Source.
func (s Source) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "addr", s.Addr)
populate(objectMap, "instanceID", s.InstanceID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Source.
func (s *Source) UnmarshalJSON(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 "addr":
err = unpopulate(val, "Addr", &s.Addr)
delete(rawMsg, key)
case "instanceID":
err = unpopulate(val, "InstanceID", &s.InstanceID)
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 SourceProperties.
func (s SourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "branch", s.Branch)
populate(objectMap, "repositoryUrl", s.RepositoryURL)
populate(objectMap, "sourceControlAuthProperties", s.SourceControlAuthProperties)
populate(objectMap, "sourceControlType", s.SourceControlType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceProperties.
func (s *SourceProperties) UnmarshalJSON(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 "branch":
err = unpopulate(val, "Branch", &s.Branch)
delete(rawMsg, key)
case "repositoryUrl":
err = unpopulate(val, "RepositoryURL", &s.RepositoryURL)
delete(rawMsg, key)
case "sourceControlAuthProperties":
err = unpopulate(val, "SourceControlAuthProperties", &s.SourceControlAuthProperties)
delete(rawMsg, key)
case "sourceControlType":
err = unpopulate(val, "SourceControlType", &s.SourceControlType)
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 SourceRegistryCredentials.
func (s SourceRegistryCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", s.Identity)
populate(objectMap, "loginMode", s.LoginMode)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceRegistryCredentials.
func (s *SourceRegistryCredentials) UnmarshalJSON(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 "loginMode":
err = unpopulate(val, "LoginMode", &s.LoginMode)
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 SourceTrigger.
func (s SourceTrigger) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", s.Name)
populate(objectMap, "sourceRepository", s.SourceRepository)
populate(objectMap, "sourceTriggerEvents", s.SourceTriggerEvents)
populate(objectMap, "status", s.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTrigger.
func (s *SourceTrigger) UnmarshalJSON(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 "sourceRepository":
err = unpopulate(val, "SourceRepository", &s.SourceRepository)
delete(rawMsg, key)
case "sourceTriggerEvents":
err = unpopulate(val, "SourceTriggerEvents", &s.SourceTriggerEvents)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &s.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SourceTriggerDescriptor.
func (s SourceTriggerDescriptor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "branchName", s.BranchName)
populate(objectMap, "commitId", s.CommitID)
populate(objectMap, "eventType", s.EventType)
populate(objectMap, "id", s.ID)
populate(objectMap, "providerType", s.ProviderType)
populate(objectMap, "pullRequestId", s.PullRequestID)
populate(objectMap, "repositoryUrl", s.RepositoryURL)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerDescriptor.
func (s *SourceTriggerDescriptor) UnmarshalJSON(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 "branchName":
err = unpopulate(val, "BranchName", &s.BranchName)
delete(rawMsg, key)
case "commitId":
err = unpopulate(val, "CommitID", &s.CommitID)
delete(rawMsg, key)
case "eventType":
err = unpopulate(val, "EventType", &s.EventType)
delete(rawMsg, key)
case "id":
err = unpopulate(val, "ID", &s.ID)
delete(rawMsg, key)
case "providerType":
err = unpopulate(val, "ProviderType", &s.ProviderType)
delete(rawMsg, key)
case "pullRequestId":
err = unpopulate(val, "PullRequestID", &s.PullRequestID)
delete(rawMsg, key)
case "repositoryUrl":
err = unpopulate(val, "RepositoryURL", &s.RepositoryURL)
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 SourceTriggerUpdateParameters.
func (s SourceTriggerUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", s.Name)
populate(objectMap, "sourceRepository", s.SourceRepository)
populate(objectMap, "sourceTriggerEvents", s.SourceTriggerEvents)
populate(objectMap, "status", s.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerUpdateParameters.
func (s *SourceTriggerUpdateParameters) UnmarshalJSON(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 "sourceRepository":
err = unpopulate(val, "SourceRepository", &s.SourceRepository)
delete(rawMsg, key)
case "sourceTriggerEvents":
err = unpopulate(val, "SourceTriggerEvents", &s.SourceTriggerEvents)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &s.Status)
delete(rawMsg, key)
}
if err != nil {
return fmt.Errorf("unmarshalling type %T: %v", s, err)
}
}
return nil
}
// MarshalJSON implements the json.Marshaller interface for type SourceUpdateParameters.
func (s SourceUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "branch", s.Branch)
populate(objectMap, "repositoryUrl", s.RepositoryURL)
populate(objectMap, "sourceControlAuthProperties", s.SourceControlAuthProperties)
populate(objectMap, "sourceControlType", s.SourceControlType)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceUpdateParameters.
func (s *SourceUpdateParameters) UnmarshalJSON(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 "branch":
err = unpopulate(val, "Branch", &s.Branch)
delete(rawMsg, key)
case "repositoryUrl":
err = unpopulate(val, "RepositoryURL", &s.RepositoryURL)
delete(rawMsg, key)
case "sourceControlAuthProperties":
err = unpopulate(val, "SourceControlAuthProperties", &s.SourceControlAuthProperties)
delete(rawMsg, key)
case "sourceControlType":
err = unpopulate(val, "SourceControlType", &s.SourceControlType)
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 SourceUploadDefinition.
func (s SourceUploadDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "relativePath", s.RelativePath)
populate(objectMap, "uploadUrl", s.UploadURL)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SourceUploadDefinition.
func (s *SourceUploadDefinition) UnmarshalJSON(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 "relativePath":
err = unpopulate(val, "RelativePath", &s.RelativePath)
delete(rawMsg, key)
case "uploadUrl":
err = unpopulate(val, "UploadURL", &s.UploadURL)
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 Status.
func (s Status) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "displayStatus", s.DisplayStatus)
populate(objectMap, "message", s.Message)
populateDateTimeRFC3339(objectMap, "timestamp", s.Timestamp)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Status.
func (s *Status) UnmarshalJSON(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 "displayStatus":
err = unpopulate(val, "DisplayStatus", &s.DisplayStatus)
delete(rawMsg, key)
case "message":
err = unpopulate(val, "Message", &s.Message)
delete(rawMsg, key)
case "timestamp":
err = unpopulateDateTimeRFC3339(val, "Timestamp", &s.Timestamp)
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 StatusDetailProperties.
func (s StatusDetailProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "code", s.Code)
populate(objectMap, "correlationId", s.CorrelationID)
populate(objectMap, "description", s.Description)
populateDateTimeRFC3339(objectMap, "timestamp", s.Timestamp)
populate(objectMap, "type", s.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type StatusDetailProperties.
func (s *StatusDetailProperties) UnmarshalJSON(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 "code":
err = unpopulate(val, "Code", &s.Code)
delete(rawMsg, key)
case "correlationId":
err = unpopulate(val, "CorrelationID", &s.CorrelationID)
delete(rawMsg, key)
case "description":
err = unpopulate(val, "Description", &s.Description)
delete(rawMsg, key)
case "timestamp":
err = unpopulateDateTimeRFC3339(val, "Timestamp", &s.Timestamp)
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 SyncProperties.
func (s SyncProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "gatewayEndpoint", s.GatewayEndpoint)
populateDateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime)
populate(objectMap, "messageTtl", s.MessageTTL)
populate(objectMap, "schedule", s.Schedule)
populate(objectMap, "syncWindow", s.SyncWindow)
populate(objectMap, "tokenId", s.TokenID)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SyncProperties.
func (s *SyncProperties) UnmarshalJSON(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 "gatewayEndpoint":
err = unpopulate(val, "GatewayEndpoint", &s.GatewayEndpoint)
delete(rawMsg, key)
case "lastSyncTime":
err = unpopulateDateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime)
delete(rawMsg, key)
case "messageTtl":
err = unpopulate(val, "MessageTTL", &s.MessageTTL)
delete(rawMsg, key)
case "schedule":
err = unpopulate(val, "Schedule", &s.Schedule)
delete(rawMsg, key)
case "syncWindow":
err = unpopulate(val, "SyncWindow", &s.SyncWindow)
delete(rawMsg, key)
case "tokenId":
err = unpopulate(val, "TokenID", &s.TokenID)
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 SyncUpdateProperties.
func (s SyncUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "messageTtl", s.MessageTTL)
populate(objectMap, "schedule", s.Schedule)
populate(objectMap, "syncWindow", s.SyncWindow)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type SyncUpdateProperties.
func (s *SyncUpdateProperties) UnmarshalJSON(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 "messageTtl":
err = unpopulate(val, "MessageTTL", &s.MessageTTL)
delete(rawMsg, key)
case "schedule":
err = unpopulate(val, "Schedule", &s.Schedule)
delete(rawMsg, key)
case "syncWindow":
err = unpopulate(val, "SyncWindow", &s.SyncWindow)
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 TLSCertificateProperties.
func (t TLSCertificateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "location", t.Location)
populate(objectMap, "type", t.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TLSCertificateProperties.
func (t *TLSCertificateProperties) UnmarshalJSON(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 "location":
err = unpopulate(val, "Location", &t.Location)
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 TLSProperties.
func (t TLSProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "certificate", t.Certificate)
populate(objectMap, "status", t.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TLSProperties.
func (t *TLSProperties) UnmarshalJSON(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 "certificate":
err = unpopulate(val, "Certificate", &t.Certificate)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
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 Target.
func (t Target) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "digest", t.Digest)
populate(objectMap, "length", t.Length)
populate(objectMap, "mediaType", t.MediaType)
populate(objectMap, "name", t.Name)
populate(objectMap, "repository", t.Repository)
populate(objectMap, "size", t.Size)
populate(objectMap, "tag", t.Tag)
populate(objectMap, "url", t.URL)
populate(objectMap, "version", t.Version)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Target.
func (t *Target) UnmarshalJSON(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 "digest":
err = unpopulate(val, "Digest", &t.Digest)
delete(rawMsg, key)
case "length":
err = unpopulate(val, "Length", &t.Length)
delete(rawMsg, key)
case "mediaType":
err = unpopulate(val, "MediaType", &t.MediaType)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &t.Name)
delete(rawMsg, key)
case "repository":
err = unpopulate(val, "Repository", &t.Repository)
delete(rawMsg, key)
case "size":
err = unpopulate(val, "Size", &t.Size)
delete(rawMsg, key)
case "tag":
err = unpopulate(val, "Tag", &t.Tag)
delete(rawMsg, key)
case "url":
err = unpopulate(val, "URL", &t.URL)
delete(rawMsg, key)
case "version":
err = unpopulate(val, "Version", &t.Version)
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 Task.
func (t Task) 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 Task.
func (t *Task) UnmarshalJSON(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 TaskListResult.
func (t TaskListResult) 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 TaskListResult.
func (t *TaskListResult) UnmarshalJSON(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 TaskProperties.
func (t TaskProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", t.AgentConfiguration)
populate(objectMap, "agentPoolName", t.AgentPoolName)
populateDateTimeRFC3339(objectMap, "creationDate", t.CreationDate)
populate(objectMap, "credentials", t.Credentials)
populate(objectMap, "isSystemTask", t.IsSystemTask)
populate(objectMap, "logTemplate", t.LogTemplate)
populate(objectMap, "platform", t.Platform)
populate(objectMap, "provisioningState", t.ProvisioningState)
populate(objectMap, "status", t.Status)
populate(objectMap, "step", t.Step)
populate(objectMap, "timeout", t.Timeout)
populate(objectMap, "trigger", t.Trigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskProperties.
func (t *TaskProperties) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &t.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &t.AgentPoolName)
delete(rawMsg, key)
case "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &t.CreationDate)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &t.Credentials)
delete(rawMsg, key)
case "isSystemTask":
err = unpopulate(val, "IsSystemTask", &t.IsSystemTask)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &t.LogTemplate)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &t.Platform)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
delete(rawMsg, key)
case "step":
t.Step, err = unmarshalTaskStepPropertiesClassification(val)
delete(rawMsg, key)
case "timeout":
err = unpopulate(val, "Timeout", &t.Timeout)
delete(rawMsg, key)
case "trigger":
err = unpopulate(val, "Trigger", &t.Trigger)
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 TaskPropertiesUpdateParameters.
func (t TaskPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentConfiguration", t.AgentConfiguration)
populate(objectMap, "agentPoolName", t.AgentPoolName)
populate(objectMap, "credentials", t.Credentials)
populate(objectMap, "logTemplate", t.LogTemplate)
populate(objectMap, "platform", t.Platform)
populate(objectMap, "status", t.Status)
populate(objectMap, "step", t.Step)
populate(objectMap, "timeout", t.Timeout)
populate(objectMap, "trigger", t.Trigger)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskPropertiesUpdateParameters.
func (t *TaskPropertiesUpdateParameters) UnmarshalJSON(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 "agentConfiguration":
err = unpopulate(val, "AgentConfiguration", &t.AgentConfiguration)
delete(rawMsg, key)
case "agentPoolName":
err = unpopulate(val, "AgentPoolName", &t.AgentPoolName)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &t.Credentials)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &t.LogTemplate)
delete(rawMsg, key)
case "platform":
err = unpopulate(val, "Platform", &t.Platform)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
delete(rawMsg, key)
case "step":
t.Step, err = unmarshalTaskStepUpdateParametersClassification(val)
delete(rawMsg, key)
case "timeout":
err = unpopulate(val, "Timeout", &t.Timeout)
delete(rawMsg, key)
case "trigger":
err = unpopulate(val, "Trigger", &t.Trigger)
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 TaskRun.
func (t TaskRun) 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, "type", t.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRun.
func (t *TaskRun) UnmarshalJSON(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 "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 TaskRunListResult.
func (t TaskRunListResult) 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 TaskRunListResult.
func (t *TaskRunListResult) UnmarshalJSON(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 TaskRunProperties.
func (t TaskRunProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "forceUpdateTag", t.ForceUpdateTag)
populate(objectMap, "provisioningState", t.ProvisioningState)
populate(objectMap, "runRequest", t.RunRequest)
populate(objectMap, "runResult", t.RunResult)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunProperties.
func (t *TaskRunProperties) UnmarshalJSON(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 "forceUpdateTag":
err = unpopulate(val, "ForceUpdateTag", &t.ForceUpdateTag)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
delete(rawMsg, key)
case "runRequest":
t.RunRequest, err = unmarshalRunRequestClassification(val)
delete(rawMsg, key)
case "runResult":
err = unpopulate(val, "RunResult", &t.RunResult)
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 TaskRunPropertiesUpdateParameters.
func (t TaskRunPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "forceUpdateTag", t.ForceUpdateTag)
populate(objectMap, "runRequest", t.RunRequest)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunPropertiesUpdateParameters.
func (t *TaskRunPropertiesUpdateParameters) UnmarshalJSON(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 "forceUpdateTag":
err = unpopulate(val, "ForceUpdateTag", &t.ForceUpdateTag)
delete(rawMsg, key)
case "runRequest":
t.RunRequest, err = unmarshalRunRequestClassification(val)
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 TaskRunRequest.
func (t TaskRunRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "agentPoolName", t.AgentPoolName)
populate(objectMap, "isArchiveEnabled", t.IsArchiveEnabled)
populate(objectMap, "logTemplate", t.LogTemplate)
populate(objectMap, "overrideTaskStepProperties", t.OverrideTaskStepProperties)
populate(objectMap, "taskId", t.TaskID)
objectMap["type"] = "TaskRunRequest"
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunRequest.
func (t *TaskRunRequest) UnmarshalJSON(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 "agentPoolName":
err = unpopulate(val, "AgentPoolName", &t.AgentPoolName)
delete(rawMsg, key)
case "isArchiveEnabled":
err = unpopulate(val, "IsArchiveEnabled", &t.IsArchiveEnabled)
delete(rawMsg, key)
case "logTemplate":
err = unpopulate(val, "LogTemplate", &t.LogTemplate)
delete(rawMsg, key)
case "overrideTaskStepProperties":
err = unpopulate(val, "OverrideTaskStepProperties", &t.OverrideTaskStepProperties)
delete(rawMsg, key)
case "taskId":
err = unpopulate(val, "TaskID", &t.TaskID)
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 TaskRunUpdateParameters.
func (t TaskRunUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "identity", t.Identity)
populate(objectMap, "location", t.Location)
populate(objectMap, "properties", t.Properties)
populate(objectMap, "tags", t.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunUpdateParameters.
func (t *TaskRunUpdateParameters) UnmarshalJSON(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 "location":
err = unpopulate(val, "Location", &t.Location)
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 TaskStepProperties.
func (t TaskStepProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageDependencies", t.BaseImageDependencies)
populate(objectMap, "contextAccessToken", t.ContextAccessToken)
populate(objectMap, "contextPath", t.ContextPath)
objectMap["type"] = t.Type
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepProperties.
func (t *TaskStepProperties) UnmarshalJSON(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 "baseImageDependencies":
err = unpopulate(val, "BaseImageDependencies", &t.BaseImageDependencies)
delete(rawMsg, key)
case "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &t.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &t.ContextPath)
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 TaskStepUpdateParameters.
func (t TaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "contextAccessToken", t.ContextAccessToken)
populate(objectMap, "contextPath", t.ContextPath)
objectMap["type"] = t.Type
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepUpdateParameters.
func (t *TaskStepUpdateParameters) UnmarshalJSON(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 "contextAccessToken":
err = unpopulate(val, "ContextAccessToken", &t.ContextAccessToken)
delete(rawMsg, key)
case "contextPath":
err = unpopulate(val, "ContextPath", &t.ContextPath)
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 TaskUpdateParameters.
func (t TaskUpdateParameters) 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 TaskUpdateParameters.
func (t *TaskUpdateParameters) UnmarshalJSON(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 TimerTrigger.
func (t TimerTrigger) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", t.Name)
populate(objectMap, "schedule", t.Schedule)
populate(objectMap, "status", t.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTrigger.
func (t *TimerTrigger) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &t.Name)
delete(rawMsg, key)
case "schedule":
err = unpopulate(val, "Schedule", &t.Schedule)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
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 TimerTriggerDescriptor.
func (t TimerTriggerDescriptor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "scheduleOccurrence", t.ScheduleOccurrence)
populate(objectMap, "timerTriggerName", t.TimerTriggerName)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerDescriptor.
func (t *TimerTriggerDescriptor) UnmarshalJSON(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 "scheduleOccurrence":
err = unpopulate(val, "ScheduleOccurrence", &t.ScheduleOccurrence)
delete(rawMsg, key)
case "timerTriggerName":
err = unpopulate(val, "TimerTriggerName", &t.TimerTriggerName)
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 TimerTriggerUpdateParameters.
func (t TimerTriggerUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "name", t.Name)
populate(objectMap, "schedule", t.Schedule)
populate(objectMap, "status", t.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerUpdateParameters.
func (t *TimerTriggerUpdateParameters) UnmarshalJSON(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 "name":
err = unpopulate(val, "Name", &t.Name)
delete(rawMsg, key)
case "schedule":
err = unpopulate(val, "Schedule", &t.Schedule)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
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 Token.
func (t Token) 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 Token.
func (t *Token) UnmarshalJSON(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 TokenCertificate.
func (t TokenCertificate) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "encodedPemCertificate", t.EncodedPemCertificate)
populateDateTimeRFC3339(objectMap, "expiry", t.Expiry)
populate(objectMap, "name", t.Name)
populate(objectMap, "thumbprint", t.Thumbprint)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenCertificate.
func (t *TokenCertificate) UnmarshalJSON(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 "encodedPemCertificate":
err = unpopulate(val, "EncodedPemCertificate", &t.EncodedPemCertificate)
delete(rawMsg, key)
case "expiry":
err = unpopulateDateTimeRFC3339(val, "Expiry", &t.Expiry)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &t.Name)
delete(rawMsg, key)
case "thumbprint":
err = unpopulate(val, "Thumbprint", &t.Thumbprint)
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 TokenCredentialsProperties.
func (t TokenCredentialsProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "certificates", t.Certificates)
populate(objectMap, "passwords", t.Passwords)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenCredentialsProperties.
func (t *TokenCredentialsProperties) UnmarshalJSON(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 "certificates":
err = unpopulate(val, "Certificates", &t.Certificates)
delete(rawMsg, key)
case "passwords":
err = unpopulate(val, "Passwords", &t.Passwords)
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 TokenListResult.
func (t TokenListResult) 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 TokenListResult.
func (t *TokenListResult) UnmarshalJSON(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 TokenPassword.
func (t TokenPassword) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "creationTime", t.CreationTime)
populateDateTimeRFC3339(objectMap, "expiry", t.Expiry)
populate(objectMap, "name", t.Name)
populate(objectMap, "value", t.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenPassword.
func (t *TokenPassword) UnmarshalJSON(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 "creationTime":
err = unpopulateDateTimeRFC3339(val, "CreationTime", &t.CreationTime)
delete(rawMsg, key)
case "expiry":
err = unpopulateDateTimeRFC3339(val, "Expiry", &t.Expiry)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &t.Name)
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 TokenProperties.
func (t TokenProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populateDateTimeRFC3339(objectMap, "creationDate", t.CreationDate)
populate(objectMap, "credentials", t.Credentials)
populate(objectMap, "provisioningState", t.ProvisioningState)
populate(objectMap, "scopeMapId", t.ScopeMapID)
populate(objectMap, "status", t.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenProperties.
func (t *TokenProperties) UnmarshalJSON(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 "creationDate":
err = unpopulateDateTimeRFC3339(val, "CreationDate", &t.CreationDate)
delete(rawMsg, key)
case "credentials":
err = unpopulate(val, "Credentials", &t.Credentials)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &t.ProvisioningState)
delete(rawMsg, key)
case "scopeMapId":
err = unpopulate(val, "ScopeMapID", &t.ScopeMapID)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
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 TokenUpdateParameters.
func (t TokenUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "properties", t.Properties)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenUpdateParameters.
func (t *TokenUpdateParameters) UnmarshalJSON(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 "properties":
err = unpopulate(val, "Properties", &t.Properties)
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 TokenUpdateProperties.
func (t TokenUpdateProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "credentials", t.Credentials)
populate(objectMap, "scopeMapId", t.ScopeMapID)
populate(objectMap, "status", t.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TokenUpdateProperties.
func (t *TokenUpdateProperties) UnmarshalJSON(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 "credentials":
err = unpopulate(val, "Credentials", &t.Credentials)
delete(rawMsg, key)
case "scopeMapId":
err = unpopulate(val, "ScopeMapID", &t.ScopeMapID)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &t.Status)
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 TriggerProperties.
func (t TriggerProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageTrigger", t.BaseImageTrigger)
populate(objectMap, "sourceTriggers", t.SourceTriggers)
populate(objectMap, "timerTriggers", t.TimerTriggers)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerProperties.
func (t *TriggerProperties) UnmarshalJSON(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 "baseImageTrigger":
err = unpopulate(val, "BaseImageTrigger", &t.BaseImageTrigger)
delete(rawMsg, key)
case "sourceTriggers":
err = unpopulate(val, "SourceTriggers", &t.SourceTriggers)
delete(rawMsg, key)
case "timerTriggers":
err = unpopulate(val, "TimerTriggers", &t.TimerTriggers)
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 TriggerUpdateParameters.
func (t TriggerUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "baseImageTrigger", t.BaseImageTrigger)
populate(objectMap, "sourceTriggers", t.SourceTriggers)
populate(objectMap, "timerTriggers", t.TimerTriggers)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerUpdateParameters.
func (t *TriggerUpdateParameters) UnmarshalJSON(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 "baseImageTrigger":
err = unpopulate(val, "BaseImageTrigger", &t.BaseImageTrigger)
delete(rawMsg, key)
case "sourceTriggers":
err = unpopulate(val, "SourceTriggers", &t.SourceTriggers)
delete(rawMsg, key)
case "timerTriggers":
err = unpopulate(val, "TimerTriggers", &t.TimerTriggers)
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 TrustPolicy.
func (t TrustPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "status", t.Status)
populate(objectMap, "type", t.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type TrustPolicy.
func (t *TrustPolicy) UnmarshalJSON(data []byte) error {
var rawMsg map[string]json.RawMessage
if err := json.Unmarshal(data, &rawMsg); err != nil {
return fmt.Errorf("unmarshalling type %T: %v", t, err)
}
for key, val := range rawMsg {
var err error
switch key {
case "status":
err = unpopulate(val, "Status", &t.Status)
delete(rawMsg, key)
case "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 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 Webhook.
func (w Webhook) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "id", w.ID)
populate(objectMap, "location", w.Location)
populate(objectMap, "name", w.Name)
populate(objectMap, "properties", w.Properties)
populate(objectMap, "systemData", w.SystemData)
populate(objectMap, "tags", w.Tags)
populate(objectMap, "type", w.Type)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type Webhook.
func (w *Webhook) UnmarshalJSON(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 "id":
err = unpopulate(val, "ID", &w.ID)
delete(rawMsg, key)
case "location":
err = unpopulate(val, "Location", &w.Location)
delete(rawMsg, key)
case "name":
err = unpopulate(val, "Name", &w.Name)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &w.Properties)
delete(rawMsg, key)
case "systemData":
err = unpopulate(val, "SystemData", &w.SystemData)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &w.Tags)
delete(rawMsg, key)
case "type":
err = unpopulate(val, "Type", &w.Type)
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 WebhookCreateParameters.
func (w WebhookCreateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "location", w.Location)
populate(objectMap, "properties", w.Properties)
populate(objectMap, "tags", w.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookCreateParameters.
func (w *WebhookCreateParameters) UnmarshalJSON(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 "location":
err = unpopulate(val, "Location", &w.Location)
delete(rawMsg, key)
case "properties":
err = unpopulate(val, "Properties", &w.Properties)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &w.Tags)
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 WebhookListResult.
func (w WebhookListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "nextLink", w.NextLink)
populate(objectMap, "value", w.Value)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookListResult.
func (w *WebhookListResult) UnmarshalJSON(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 "nextLink":
err = unpopulate(val, "NextLink", &w.NextLink)
delete(rawMsg, key)
case "value":
err = unpopulate(val, "Value", &w.Value)
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 WebhookProperties.
func (w WebhookProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actions", w.Actions)
populate(objectMap, "provisioningState", w.ProvisioningState)
populate(objectMap, "scope", w.Scope)
populate(objectMap, "status", w.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookProperties.
func (w *WebhookProperties) UnmarshalJSON(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 "actions":
err = unpopulate(val, "Actions", &w.Actions)
delete(rawMsg, key)
case "provisioningState":
err = unpopulate(val, "ProvisioningState", &w.ProvisioningState)
delete(rawMsg, key)
case "scope":
err = unpopulate(val, "Scope", &w.Scope)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &w.Status)
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 WebhookPropertiesCreateParameters.
func (w WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actions", w.Actions)
populate(objectMap, "customHeaders", w.CustomHeaders)
populate(objectMap, "scope", w.Scope)
populate(objectMap, "serviceUri", w.ServiceURI)
populate(objectMap, "status", w.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPropertiesCreateParameters.
func (w *WebhookPropertiesCreateParameters) UnmarshalJSON(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 "actions":
err = unpopulate(val, "Actions", &w.Actions)
delete(rawMsg, key)
case "customHeaders":
err = unpopulate(val, "CustomHeaders", &w.CustomHeaders)
delete(rawMsg, key)
case "scope":
err = unpopulate(val, "Scope", &w.Scope)
delete(rawMsg, key)
case "serviceUri":
err = unpopulate(val, "ServiceURI", &w.ServiceURI)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &w.Status)
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 WebhookPropertiesUpdateParameters.
func (w WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "actions", w.Actions)
populate(objectMap, "customHeaders", w.CustomHeaders)
populate(objectMap, "scope", w.Scope)
populate(objectMap, "serviceUri", w.ServiceURI)
populate(objectMap, "status", w.Status)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPropertiesUpdateParameters.
func (w *WebhookPropertiesUpdateParameters) UnmarshalJSON(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 "actions":
err = unpopulate(val, "Actions", &w.Actions)
delete(rawMsg, key)
case "customHeaders":
err = unpopulate(val, "CustomHeaders", &w.CustomHeaders)
delete(rawMsg, key)
case "scope":
err = unpopulate(val, "Scope", &w.Scope)
delete(rawMsg, key)
case "serviceUri":
err = unpopulate(val, "ServiceURI", &w.ServiceURI)
delete(rawMsg, key)
case "status":
err = unpopulate(val, "Status", &w.Status)
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 WebhookUpdateParameters.
func (w WebhookUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]any)
populate(objectMap, "properties", w.Properties)
populate(objectMap, "tags", w.Tags)
return json.Marshal(objectMap)
}
// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookUpdateParameters.
func (w *WebhookUpdateParameters) UnmarshalJSON(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 "properties":
err = unpopulate(val, "Properties", &w.Properties)
delete(rawMsg, key)
case "tags":
err = unpopulate(val, "Tags", &w.Tags)
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 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
}