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

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _name = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; }
            AfterFromJson(json);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="TrackedResourceTags" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        /// <param name="exclusions"></param>
        internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.JsonSerializable.FromJson(json, ((Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.IAssociativeArray <string>) this).AdditionalProperties, null, exclusions);
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="ProxyResource" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

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

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

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _display = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject>("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.OperationDisplayInfo.FromJson(__jsonDisplay) : Display; }
            { _name = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; }
            AfterFromJson(json);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="DeviceServiceNameAvailabilityInfo" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal DeviceServiceNameAvailabilityInfo(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _nameAvailable = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonBoolean>("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable; }
            { _reason = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason; }
            { _message = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="DeviceService" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal DeviceService(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.TrackedResource(json);
            { _property = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Models.Api20190601.DeviceServiceProperties.FromJson(__jsonProperties) : Property; }
            { _etag = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag; }
            AfterFromJson(json);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="Resource" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal Resource(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

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

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

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

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _subscriptionId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; }
            { _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; }
            { _deviceName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("deviceName"), out var __jsonDeviceName) ? (string)__jsonDeviceName : (string)DeviceName; }
            { _id = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; }
            AfterFromJson(json);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="ErrorDetails" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _code = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code; }
            { _message = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; }
            { _target = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target; }
            { _detail = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("details"), out var __jsonDetails) ? (string)__jsonDetails : (string)Detail; }
            AfterFromJson(json);
        }
        /// <summary>
        /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject into a new instance of <see cref="DeviceServiceProperties" />.
        /// </summary>
        /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject instance to deserialize from.</param>
        internal DeviceServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject json)
        {
            bool returnNow = false;

            BeforeFromJson(json, ref returnNow);
            if (returnNow)
            {
                return;
            }
            { _note = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)Note; }
            { _startDate = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("startDate"), out var __jsonStartDate) ? global::System.DateTime.TryParse((string)__jsonStartDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateValue) ? __jsonStartDateValue : StartDate : StartDate; }
            { _quantity = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNumber>("quantity"), out var __jsonQuantity) ? (long?)__jsonQuantity : Quantity; }
            { _billingDomainName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("billingDomainName"), out var __jsonBillingDomainName) ? (string)__jsonBillingDomainName : (string)BillingDomainName; }
            { _adminDomainName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString>("adminDomainName"), out var __jsonAdminDomainName) ? (string)__jsonAdminDomainName : (string)AdminDomainName; }
            AfterFromJson(json);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Serializes this instance of <see cref="TrackedResourceTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="TrackedResourceTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container);
            AfterToJson(ref container);
            return(container);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Serializes this instance of <see cref="DeviceServiceCheckNameAvailabilityParameters" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceServiceCheckNameAvailabilityParameters" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode"
        /// />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add);
            AfterToJson(ref container);
            return(container);
        }
Exemplo n.º 16
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.WindowsIotServices.Runtime.Json.JsonObject json, ref bool returnNow);
Exemplo n.º 17
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.WindowsIotServices.Runtime.Json.JsonObject container, ref bool returnNow);
Exemplo n.º 18
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.WindowsIotServices.Runtime.Json.JsonObject json);
Exemplo n.º 19
0
        /// <summary>
        /// <c>AfterToJson</c> will be called after the json erialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.Json.JsonObject container);
        /// <summary>
        /// Serializes this instance of <see cref="DeviceService" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceService" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __trackedResource?.ToJson(container, serializationMode);
            AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add);
            AddIf(null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="ProxyResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="ProxyResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            __resource?.ToJson(container, serializationMode);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DeviceServiceDescriptionListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode"
        /// />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceServiceDescriptionListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (null != this._value)
            {
                var __w = new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.XNodeArray();
                foreach (var __x in this._value)
                {
                    AddIf(__x?.ToJson(null, serializationMode), __w.Add);
                }
                container.Add("value", __w);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add);
            }
            AfterToJson(ref container);
            return(container);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Serializes this instance of <see cref="DeviceServiceNameAvailabilityInfo" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceServiceNameAvailabilityInfo" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable", container.Add);
            }
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason", container.Add);
            }
            AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add);
            AfterToJson(ref container);
            return(container);
        }
        /// <summary>
        /// Serializes this instance of <see cref="DeviceServiceProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </summary>
        /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.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.WindowsIotServices.Runtime.SerializationMode"/>.</param>
        /// <returns>
        /// a serialized instance of <see cref="DeviceServiceProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode" />.
        /// </returns>
        public Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode serializationMode)
        {
            container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonObject();

            bool returnNow = false;

            BeforeToJson(ref container, ref returnNow);
            if (returnNow)
            {
                return(container);
            }
            AddIf(null != (((object)this._note)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._note.ToString()) : null, "notes", container.Add);
            if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.SerializationMode.IncludeReadOnly))
            {
                AddIf(null != this._startDate ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._startDate?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startDate", container.Add);
            }
            AddIf(null != this._quantity ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNumber((long)this._quantity) : null, "quantity", container.Add);
            AddIf(null != (((object)this._billingDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._billingDomainName.ToString()) : null, "billingDomainName", container.Add);
            AddIf(null != (((object)this._adminDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.WindowsIotServices.Runtime.Json.JsonString(this._adminDomainName.ToString()) : null, "adminDomainName", container.Add);
            AfterToJson(ref container);
            return(container);
        }