Example #1
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="Any" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal Any(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="ProxyResource" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __resource = new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.Resource(json);
            AfterFromJson(json);
        }
Example #3
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="PatchableCustomLocationsTags" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        /// <param name="exclusions"></param>
        internal PatchableCustomLocationsTags(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet <string> exclusions = null)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.JsonSerializable.FromJson(json, ((Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.IAssociativeArray <string>) this).AdditionalProperties, null, exclusions);
            AfterFromJson(json);
        }
Example #4
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="ErrorResponse" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _error = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.ErrorDetail.FromJson(__jsonError) : Error; }
            AfterFromJson(json);
        }
Example #5
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="CustomLocationPropertiesAuthentication" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal CustomLocationPropertiesAuthentication(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _type = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; }
            { _value = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value; }
            AfterFromJson(json);
        }
Example #6
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="ErrorAdditionalInfo" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _type = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; }
            { _info = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Any.FromJson(__jsonInfo) : Info; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="EnabledResourceTypesListResult" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal EnabledResourceTypesListResult(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _nextLink = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink; }
            { _value = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray>("value"), out var __jsonValue) ? If(__jsonValue as Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.IEnabledResourceType[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.IEnabledResourceType)(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.EnabledResourceType.FromJson(__u)))))() : null : Value; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="EnabledResourceTypeProperties" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal EnabledResourceTypeProperties(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _clusterExtensionId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("clusterExtensionId"), out var __jsonClusterExtensionId) ? (string)__jsonClusterExtensionId : (string)ClusterExtensionId; }
            { _extensionType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("extensionType"), out var __jsonExtensionType) ? (string)__jsonExtensionType : (string)ExtensionType; }
            { _typesMetadata = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray>("typesMetadata"), out var __jsonTypesMetadata) ? If(__jsonTypesMetadata as Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.IEnabledResourceTypePropertiesTypesMetadataItem[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.IEnabledResourceTypePropertiesTypesMetadataItem)(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.EnabledResourceTypePropertiesTypesMetadataItem.FromJson(__u)))))() : null : TypesMetadata; }
            AfterFromJson(json);
        }
Example #9
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="EnabledResourceType" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal EnabledResourceType(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __resource = new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.Resource(json);
            { _property = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.EnabledResourceTypeProperties.FromJson(__jsonProperties) : Property; }
            { _systemData = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="PatchableCustomLocations" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal PatchableCustomLocations(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _identity = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.Identity.FromJson(__jsonIdentity) : Identity; }
            { _property = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.CustomLocationProperties.FromJson(__jsonProperties) : Property; }
            { _tag = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.PatchableCustomLocationsTags.FromJson(__jsonTags) : Tag; }
            AfterFromJson(json);
        }
Example #11
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="Identity" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal Identity(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _principalId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId; }
            { _tenantId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId; }
            { _type = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; }
            AfterFromJson(json);
        }
Example #12
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="Resource" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal Resource(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _id = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; }
            { _name = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; }
            { _type = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; }
            AfterFromJson(json);
        }
Example #13
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="EnabledResourceTypePropertiesTypesMetadataItem"
        /// />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal EnabledResourceTypePropertiesTypesMetadataItem(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _apiVersion = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("apiVersion"), out var __jsonApiVersion) ? (string)__jsonApiVersion : (string)ApiVersion; }
            { _resourceProviderNamespace = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("resourceProviderNamespace"), out var __jsonResourceProviderNamespace) ? (string)__jsonResourceProviderNamespace : (string)ResourceProviderNamespace; }
            { _resourceType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType; }
            AfterFromJson(json);
        }
Example #14
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="TrackedResource" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __resource = new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.Resource(json);
            { _tag = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.TrackedResourceTags.FromJson(__jsonTags) : Tag; }
            { _location = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="CustomLocationOperation" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal CustomLocationOperation(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _display = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.CustomLocationOperationValueDisplay.FromJson(__jsonDisplay) : Display; }
            { _isDataAction = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonBoolean>("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction; }
            { _name = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; }
            { _origin = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="CustomLocationIdentity" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal CustomLocationIdentity(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _subscriptionId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; }
            { _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; }
            { _resourceName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName; }
            { _id = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; }
            AfterFromJson(json);
        }
Example #17
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="CustomLocationOperationValueDisplay" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal CustomLocationOperationValueDisplay(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _description = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description; }
            { _operation = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation; }
            { _provider = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider; }
            { _resource = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="ErrorDetail" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _code = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code; }
            { _message = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; }
            { _target = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target; }
            { _detail = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray>("details"), out var __jsonDetails) ? If(__jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.IErrorDetail[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.IErrorDetail)(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.ErrorDetail.FromJson(__u)))))() : null : Detail; }
            { _additionalInfo = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray>("additionalInfo"), out var __jsonAdditionalInfo) ? If(__jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray, out var __q) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.IErrorAdditionalInfo[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p) => (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.IErrorAdditionalInfo)(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20.ErrorAdditionalInfo.FromJson(__p)))))() : null : AdditionalInfo; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="SystemData" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _createdBy = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy; }
            { _createdByType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType; }
            { _createdAt = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt; }
            { _lastModifiedBy = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy; }
            { _lastModifiedByType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType; }
            { _lastModifiedAt = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt; }
            AfterFromJson(json);
        }
Example #20
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject into a new instance of <see cref="CustomLocationProperties" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal CustomLocationProperties(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _authentication = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject>("authentication"), out var __jsonAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Models.Api20210815.CustomLocationPropertiesAuthentication.FromJson(__jsonAuthentication) : Authentication; }
            { _clusterExtensionId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray>("clusterExtensionIds"), out var __jsonClusterExtensionIds) ? If(__jsonClusterExtensionIds as Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <string[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (string)(__u is Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null))))() : null : ClusterExtensionId; }
            { _displayName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName; }
            { _hostResourceId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("hostResourceId"), out var __jsonHostResourceId) ? (string)__jsonHostResourceId : (string)HostResourceId; }
            { _hostType = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("hostType"), out var __jsonHostType) ? (string)__jsonHostType : (string)HostType; }
            { _namespace = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("namespace"), out var __jsonNamespace) ? (string)__jsonNamespace : (string)Namespace; }
            { _provisioningState = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString>("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState; }
            AfterFromJson(json);
        }
Example #21
0
        /// <summary>
        /// <c>BeforeToJson</c> will be called before the json serialization has commenced, allowing complete customization of the
        /// object before it is serialized.
        /// If you wish to disable the default serialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="container">The JSON container that the serialization result will be placed in.</param>
        /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, ref bool returnNow);
Example #22
0
        /// <summary>
        /// <c>BeforeFromJson</c> will be called before the json deserialization has commenced, allowing complete customization of
        /// the object before it is deserialized.
        /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <see "returnNow" /> output parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="json">The JsonNode that should be deserialized into this object.</param>
        /// <param name="returnNow">Determines if the rest of the deserialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json, ref bool returnNow);
Example #23
0
        /// <summary>
        /// <c>AfterToJson</c> will be called after the json erialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"
        /// /> before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="container">The JSON container that the serialization result will be placed in.</param>

        partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container);
Example #24
0
        /// <summary>
        /// <c>AfterFromJson</c> will be called after the json deserialization has finished, allowing customization of the object
        /// before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="json">The JsonNode that should be deserialized into this object.</param>

        partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject json);
Example #25
0
        /// <summary>
        /// Serializes this instance of <see cref="CustomLocationProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="CustomLocationProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._authentication ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) this._authentication.ToJson(null, serializationMode) : null, "authentication", container.Add);
            if (null != this._clusterExtensionId)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.XNodeArray();
                foreach (var __x in this._clusterExtensionId)
                {
                    AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(__x.ToString()) : null, __w.Add);
                }
                container.Add("clusterExtensionIds", __w);
            }
            AddIf(null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName", container.Add);
            AddIf(null != (((object)this._hostResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._hostResourceId.ToString()) : null, "hostResourceId", container.Add);
            AddIf(null != (((object)this._hostType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._hostType.ToString()) : null, "hostType", container.Add);
            AddIf(null != (((object)this._namespace)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._namespace.ToString()) : null, "namespace", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #26
0
        /// <summary>
        /// Serializes this instance of <see cref="PatchableCustomLocationsTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="PatchableCustomLocationsTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="SystemData" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="SystemData" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy", container.Add);
            AddIf(null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType", container.Add);
            AddIf(null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt", container.Add);
            AddIf(null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy", container.Add);
            AddIf(null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType", container.Add);
            AddIf(null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #28
0
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="TrackedResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __resource?.ToJson(container, serializationMode);
            AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add);
            AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Example #29
0
        /// <summary>
        /// Serializes this instance of <see cref="EnabledResourceType" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="EnabledResourceType" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __resource?.ToJson(container, serializationMode);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) this._systemData.ToJson(null, serializationMode) : null, "systemData", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Example #30
0
        /// <summary>
        /// Serializes this instance of <see cref="ErrorResponse" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller
        /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param>
        /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ErrorResponse" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.CustomLocation.Runtime.Json.JsonNode) this._error.ToJson(null, serializationMode) : null, "error", container.Add);
            AfterToJson(ref container);
            return(container);
        }