/// <summary> /// Serializes this instance of <see cref="MarketplaceRegistrationDefinitionList" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" /// />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="MarketplaceRegistrationDefinitionList" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { if (null != this._value) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RegistrationAssignment" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RegistrationAssignment" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) this._property.ToJson(null, serializationMode) : null, "properties", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._id.ToString()) : null, "id", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._type.ToString()) : null, "type", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._name.ToString()) : null, "name", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RegistrationDefinitionProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RegistrationDefinitionProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._description.ToString()) : null, "description", container.Add); if (null != this._authorization) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray(); foreach (var __x in this._authorization) { AddIf(__x?.ToJson(null, serializationMode), __w.Add); } container.Add("authorizations", __w); } if (null != this._eligibleAuthorization) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.XNodeArray(); foreach (var __s in this._eligibleAuthorization) { AddIf(__s?.ToJson(null, serializationMode), __r.Add); } container.Add("eligibleAuthorizations", __r); } AddIf(null != (((object)this._registrationDefinitionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionName.ToString()) : null, "registrationDefinitionName", container.Add); AddIf(null != (((object)this._managedByTenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantId.ToString()) : null, "managedByTenantId", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._managedByTenantName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._managedByTenantName.ToString()) : null, "managedByTenantName", container.Add); } AfterToJson(ref container); return(container); }
/// <summary> /// Serializes this instance of <see cref="RegistrationAssignmentProperties" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.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.ManagedServices.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="RegistrationAssignmentProperties" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != this._registrationDefinition ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) this._registrationDefinition.ToJson(null, serializationMode) : null, "registrationDefinition", container.Add); } AddIf(null != (((object)this._registrationDefinitionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._registrationDefinitionId.ToString()) : null, "registrationDefinitionId", container.Add); if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.SerializationMode.IncludeReadOnly)) { AddIf(null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ManagedServices.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState", container.Add); } AfterToJson(ref container); return(container); }