/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="ResourceTags" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> /// <param name="exclusions"></param> internal ResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.JsonSerializable.FromJson(json, ((Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.IAssociativeArray <string>) this).AdditionalProperties, null, exclusions); AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryPropertiesUpdateParameters" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryPropertiesUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _description = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description; } { _query = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("query"), out var __jsonQuery) ? (string)__jsonQuery : (string)Query; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryResource" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryResource(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } __resource = new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.Resource(json); { _property = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.GraphQueryProperties.FromJson(__jsonProperties) : Property; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryListResult" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryListResult(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _nextLink = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink; } { _value = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonArray>("value"), out var __jsonValue) ? If(__jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.IGraphQueryResource[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.IGraphQueryResource)(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.GraphQueryResource.FromJson(__u)))))() : null : Value; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryUpdateParameters" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _property = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject>("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.GraphQueryPropertiesUpdateParameters.FromJson(__jsonProperties) : Property; } { _tag = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject>("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.GraphQueryUpdateParametersTags.FromJson(__jsonTags) : Tag; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryError" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryError(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _code = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code; } { _message = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; } { _detail = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonArray>("details"), out var __jsonDetails) ? If(__jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.IErrorFieldContract[]>(() => global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u) => (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.IErrorFieldContract)(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.ErrorFieldContract.FromJson(__u)))))() : null : Detail; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="ErrorFieldContract" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal ErrorFieldContract(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _code = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code; } { _message = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message; } { _target = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="ResourceGraphIdentity" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal ResourceGraphIdentity(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _subscriptionId = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId; } { _resourceGroupName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName; } { _resourceName = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName; } { _id = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="GraphQueryProperties" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal GraphQueryProperties(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _timeModified = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("timeModified"), out var __jsonTimeModified) ? global::System.DateTime.TryParse((string)__jsonTimeModified, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeModifiedValue) ? __jsonTimeModifiedValue : TimeModified : TimeModified; } { _description = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description; } { _query = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("query"), out var __jsonQuery) ? (string)__jsonQuery : (string)Query; } { _resultKind = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("resultKind"), out var __jsonResultKind) ? (string)__jsonResultKind : (string)ResultKind; } AfterFromJson(json); }
/// <summary> /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject into a new instance of <see cref="Resource" />. /// </summary> /// <param name="json">A Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject instance to deserialize from.</param> internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); if (returnNow) { return; } { _id = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("id"), out var __jsonId) ? (string)__jsonId : (string)Id; } { _name = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("name"), out var __jsonName) ? (string)__jsonName : (string)Name; } { _location = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location; } { _type = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString>("type"), out var __jsonType) ? (string)__jsonType : (string)Type; } { _tag = If(json?.PropertyT <Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject>("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Models.Api20180901Preview.ResourceTags.FromJson(__jsonTags) : Tag; } AfterFromJson(json); }
/// <summary> /// Serializes this instance of <see cref="GraphQueryResource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="GraphQueryResource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="GraphQueryError" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="GraphQueryError" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add); AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add); if (null != this._detail) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.XNodeArray(); foreach (var __x in this._detail) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("details", __w); } AfterToJson(ref container); return(container); }
/// <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.ResourceGraph.Runtime.Json.JsonObject container, ref bool returnNow);
/// <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.ResourceGraph.Runtime.Json.JsonObject json, ref bool returnNow);
/// <summary> /// <c>AfterToJson</c> will be called after the json erialization has finished, allowing customization of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.Json.JsonObject container);
/// <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.ResourceGraph.Runtime.Json.JsonObject json);
/// <summary> /// Serializes this instance of <see cref="GraphQueryPropertiesUpdateParameters" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="GraphQueryPropertiesUpdateParameters" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add); AddIf(null != (((object)this._query)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._query.ToString()) : null, "query", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ResourceGraphIdentity" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ResourceGraphIdentity" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId", container.Add); AddIf(null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName", container.Add); AddIf(null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName", container.Add); AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ResourceTags" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ResourceTags" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.JsonSerializable.ToJson(((Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.IAssociativeArray <string>) this).AdditionalProperties, container); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="ErrorFieldContract" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="ErrorFieldContract" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._code.ToString()) : null, "code", container.Add); AddIf(null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._message.ToString()) : null, "message", container.Add); AddIf(null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._target.ToString()) : null, "target", container.Add); AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="GraphQueryProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="GraphQueryProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._timeModified ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._timeModified?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK", global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timeModified", container.Add); } AddIf(null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add); AddIf(null != (((object)this._query)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._query.ToString()) : null, "query", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._resultKind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._resultKind.ToString()) : null, "resultKind", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="GraphQueryListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="GraphQueryListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._value) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.XNodeArray(); foreach (var __x in this._value) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("value", __w); } } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="Resource" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.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.ResourceGraph.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="Resource" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add); } AddIf(null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._location.ToString()) : null, "location", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add); } AddIf(null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ResourceGraph.Runtime.Json.JsonNode) this._tag.ToJson(null, serializationMode) : null, "tags", container.Add); AfterToJson(ref container); return(container); }